conf_usb.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 #ifndef _CONF_USB_H_
00015 #define _CONF_USB_H_
00016 
00017 
00018 
00022 
00023 
00024    // _________________ OTG MODE CONFIGURATION ____________________________
00025    //
00030 
00034       #define USB_OTG_FEATURE                         ENABLED
00035 
00040       #define OTG_VBUS_AUTO_WHEN_A_PLUG               DISABLED
00041 
00060       #define OTG_MESSAGING_OUTPUT                    OTGMSG_FAIL
00061 
00065       #define OTG_USE_TIMER                           TIMER16_1
00067       #define USE_TIMER16                             BOTH_TIMER16
00068 
00073       #define OTG_ENABLE_HNP_AFTER_SRP                ENABLED
00074 
00078       #define OTG_ADEV_SRP_REACTION                   VBUS_PULSE
00080 
00081 
00082    // _________________ USB MODE CONFIGURATION ____________________________
00083    //
00088 
00092       #define USB_HOST_FEATURE            ENABLED
00093 
00097       #define USB_DEVICE_FEATURE          ENABLED
00098 
00100 
00101    // _________________ USB REGULATOR CONFIGURATION _______________________
00102    //
00105 
00110 #ifndef USE_USB_PADS_REGULATOR
00111    #define USE_USB_PADS_REGULATOR   ENABLE      // Possible values ENABLE or DISABLE
00112 #endif
00114 
00115    // _________________ HOST MODE CONFIGURATION ____________________________
00116    //
00120 
00121    #define HID_CLASS          0x03
00122    #define MS_CLASS           0x08
00123    #define NO_SUBCLASS        0x00
00124    #define BOOT_SUBCLASS      0x01
00125    #define MOUSE_PROTOCOL     0x02
00126    #define NO_PROTOCOL        0x00
00127 
00128 
00139    #define VID_PID_TABLE            { 0x03EB, 1, 0x2031 }
00140 
00151    #define CLASS_SUBCLASS_PROTOCOL     {0x00, 0x00, 0x00,\
00152                                        MS_CLASS, 0x06, 0x50,\
00153                                        HID_CLASS, NO_SUBCLASS, MOUSE_PROTOCOL,\
00154                                        HID_CLASS, BOOT_SUBCLASS, MOUSE_PROTOCOL,\
00155                                        HID_CLASS, NO_SUBCLASS, NO_PROTOCOL}
00156    /* ^^ Irrelevant here ^^ */
00157 
00159    #define SIZEOF_DATA_STAGE        250
00160 
00162    #define DEVICE_ADDRESS           0x05
00163 
00165    #define MAX_INTERFACE_SUPPORTED  0x03
00166 
00168    #define MAX_EP_PER_INTERFACE     3
00169 
00173    #define HOST_STRICT_VID_PID_TABLE      ENABLE
00174 
00176    #define HOST_AUTO_CFG_ENDPOINT         ENABLE
00177 
00179    #define HOST_CONTINUOUS_SOF_INTERRUPT  DISABLE
00180 
00182    #define HOST_ERROR_RESTART             ENABLE
00183 
00185    #define USB_HOST_PIPE_INTERRUPT_TRANSFER  ENABLE
00186 
00188    #define ID_PIN_CHANGE_GENERATE_RESET   ENABLE
00189 
00191    #define TIMEOUT_DELAY_ENABLE           ENABLE
00192 
00194    #define TIMEOUT_DELAY               10
00195 
00197    #define NAK_TIMEOUT_ENABLE          DISABLE
00198 
00200    #define NAK_SEND_TIMEOUT            0x0FFF
00201 
00203    #define NAK_RECEIVE_TIMEOUT         0x0FFF
00204 
00206    #define SOFTWARE_VBUS_CTRL          ENABLE
00207 
00208    #if (HOST_AUTO_CFG_ENDPOINT==FALSE)
00210       #define        User_configure_endpoint()
00211    #endif
00212 
00216    // write here the action to associate to each USB host event
00217    // be carefull not to waste time in order not disturbing the functions
00218    #define Usb_id_transition_action()
00219    #define Host_device_disconnection_action()
00220    #define Host_device_connection_action()
00221    #define Host_sof_action()
00222    #define Host_suspend_action()
00223    #define Host_hwup_action()
00224    #define Host_vbus_action()
00225 #if (USB_OTG_FEATURE == ENABLED)
00226    #define Host_device_not_supported_action()         otg_not_supported_device()
00227 #else
00228    #define Host_device_not_supported_action()
00229 #endif
00230    #define Host_device_supported_action()
00231 #if (USB_OTG_FEATURE == ENABLED)
00232    #define Host_device_error_action()                 otg_not_supported_device()
00233 #else
00234    #define Host_device_error_action()
00235 #endif
00237 
00238 extern void set_power_down_mode(void);
00239 extern void host_sof_action(void);
00240 //extern void Lcd_print_otg_status(U8);
00241 extern volatile U8 spider_connected;
00243 
00244 
00245 // _________________ DEVICE MODE CONFIGURATION __________________________
00246 
00250 #define NB_ENDPOINTS          1  // number of endpoints in the application
00251 #define EP_SPIDER_IN          1
00252 
00253 #define Usb_unicode(a)        ((U16)(a))
00254 
00258    // write here the action to associate to each USB event
00259    // be carefull not to waste time in order not disturbing the functions
00260 #define Usb_sof_action()
00261 #define Usb_wake_up_action()
00262 #define Usb_resume_action()
00263 #define Usb_suspend_action()
00264   #define Usb_reset_action()
00265 #define Usb_vbus_on_action()
00266 #define Usb_vbus_off_action()
00267 #define Usb_set_configuration_action()
00269 
00271 
00273 
00274 #endif // _CONF_USB_H_

Generated on Mon Feb 19 09:31:47 2007 for Atmel by  doxygen 1.5.1-p1