00001
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef _CONF_USB_H_
00044 #define _CONF_USB_H_
00045
00046
00047 #include "modules/usb/usb_commun.h"
00048 #include "modules/usb/usb_commun_cdc.h"
00049
00053
00054
00055
00056
00061
00065 #define USB_HOST_FEATURE ENABLED
00066
00070 #define USB_DEVICE_FEATURE DISABLED
00071
00073
00074
00075
00078
00083 #ifndef USE_USB_PADS_REGULATOR
00084 #define USE_USB_PADS_REGULATOR ENABLE // Possible values ENABLE or DISABLE
00085 #endif
00087
00088
00089
00093
00094 #define CDC_GLOB_CLASS 0x02
00095 #define CDC_COMM_CLASS 0x02
00096 #define CDC_DATA_CLASS 0x0A
00097 #define CDC_GLOB_SUBCLASS 0x00
00098 #define CDC_COMM_SUBCLASS 0x02
00099 #define CDC_DATA_SUBCLASS 0x00
00100 #define CDC_GLOB_PROTOCOL 0x00
00101 #define CDC_COMM_PROTOCOL 0x01
00102 #define CDC_DATA_PROTOCOL 0x00
00103
00104
00105 #define PIPE_CDC_COMM pipe_cdc_comm_int
00106 #define PIPE_CDC_DATA_IN pipe_cdc_data_bulkin
00107 #define PIPE_CDC_DATA_OUT pipe_cdc_data_bulkout
00108
00109 extern U8 pipe_cdc_comm_int;
00110 extern U8 pipe_cdc_data_bulkin;
00111 extern U8 pipe_cdc_data_bulkout;
00112
00113
00114
00123 #define VID_PID_TABLE {VID_ATMEL, 1, PID_MegaCDC}
00124
00135 #ifdef CDC_USE_MANAGEMENT_INTERFACE
00136 # ifdef CDC_USE_SPECIFIC_VENDOR_INTERFACE // Force specific vendor interface like CDC Device
00137 # define CLASS_SUBCLASS_PROTOCOL {\
00138 0xEF, 0x01, 0x01, \
00139 CDC_COMM_CLASS, CDC_COMM_SUBCLASS, CDC_COMM_PROTOCOL, \
00140 CDC_DATA_CLASS, CDC_DATA_SUBCLASS, CDC_DATA_PROTOCOL, \
00141 0xFF, 0x00, 0x00 \
00142 }
00143 # else
00144 # define CLASS_SUBCLASS_PROTOCOL {\
00145 0xEF, 0x01, 0x01, \
00146 CDC_COMM_CLASS, CDC_COMM_SUBCLASS, CDC_COMM_PROTOCOL, \
00147 CDC_DATA_CLASS, CDC_DATA_SUBCLASS, CDC_DATA_PROTOCOL \
00148 }
00149 # endif
00150 #else
00151 # ifdef CDC_USE_SPECIFIC_VENDOR_INTERFACE // Force specific vendor interface like CDC Device
00152 # define CLASS_SUBCLASS_PROTOCOL {\
00153 CDC_COMM_CLASS, CDC_COMM_SUBCLASS, CDC_COMM_PROTOCOL, \
00154 CDC_DATA_CLASS, CDC_DATA_SUBCLASS, CDC_DATA_PROTOCOL, \
00155 0xFF, 0x00, 0x00 \
00156 }
00157 # else
00158 # define CLASS_SUBCLASS_PROTOCOL {\
00159 CDC_COMM_CLASS, CDC_COMM_SUBCLASS, CDC_COMM_PROTOCOL, \
00160 CDC_DATA_CLASS, CDC_DATA_SUBCLASS, CDC_DATA_PROTOCOL \
00161 }
00162 # endif
00163 #endif
00164
00166 #define SIZEOF_DATA_STAGE 250
00167
00169 #define DEVICE_BASE_ADDRESS 0x05
00170
00172 #define MAX_EP_PER_INTERFACE 3
00173
00175 #define MAX_INTERFACE_FOR_DEVICE 3
00176
00178 #define MAX_DEVICE_IN_USB_TREE 1
00179
00180 #define SAVE_INTERRUPT_PIPE_FOR_DMS_INTERFACE ENABLE
00181
00183 #if (MAX_DEVICE_IN_USB_TREE>1)
00184 #define USB_HUB_SUPPORT ENABLE
00185 #define USB_MAX_HUB_NUMBER 4
00186 #define HUB_MAX_NB_PORT 4
00187 #else
00188 #define USB_HUB_SUPPORT DISABLE
00189 #endif
00190
00194 #define HOST_STRICT_VID_PID_TABLE DISABLE
00195
00197 #define HOST_AUTO_CFG_ENDPOINT ENABLE
00198
00200 #define HOST_CONTINUOUS_SOF_INTERRUPT DISABLE
00201
00203 #define HOST_ERROR_RESTART ENABLE
00204
00206 #define USB_HOST_PIPE_INTERRUPT_TRANSFER ENABLE
00207
00209 #define ID_PIN_CHANGE_GENERATE_RESET ENABLE
00210
00212 #define TIMEOUT_DELAY_ENABLE ENABLE
00213
00215 #define TIMEOUT_DELAY 10
00216
00218 #define NAK_TIMEOUT_ENABLE DISABLE
00219
00221 #define NAK_SEND_TIMEOUT 0x0FFF
00222
00224 #define NAK_RECEIVE_TIMEOUT 0x0FFF
00225
00227 #define SOFTWARE_VBUS_CTRL ENABLE
00228
00229 #if (HOST_AUTO_CFG_ENDPOINT==FALSE)
00231 #define User_configure_endpoint()
00232 #endif
00233
00237
00238
00239 #define Usb_id_transition_action()
00240 #define Host_device_disconnection_action()
00241 #define Host_device_connection_action()
00242 #define Host_sof_action() sof_action()
00243 #define Host_suspend_action()
00244 #define Host_hwup_action()
00245 #define Host_device_not_supported_action()
00246 #define Host_device_class_not_supported_action()
00247 #define Host_device_supported_action()
00248 #define Host_device_error_action()
00249
00250 extern void sof_action(void);
00252
00254
00255
00256
00257
00261
00262 #define USB_DEVICE_SN_USE DISABLE // DISABLE
00263 #define USE_DEVICE_SN_UNIQUE DISABLE // ignore if USB_DEVICE_SN_USE = DISABLE
00264
00265
00266 #define Usb_unicode(a) ((U16)(a))
00267
00271
00272
00273 #define Usb_sof_action()
00274 #define Usb_wake_up_action()
00275 #define Usb_resume_action()
00276 #define Usb_suspend_action()
00277 #define Usb_reset_action()
00278 #define Usb_vbus_on_action()
00279 #define Usb_vbus_off_action()
00280 #define Usb_set_configuration_action()
00282
00284
00285
00287
00288 #endif // _CONF_USB_H_