00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
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 #include "board.h"
00041 #include "USBD_Config.h"
00042 #include "CDCDEEMDriver.h"
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #define CDCDEEMDriverDescriptors_PRODUCTID USBD_PID_CDCEEM
00060
00061 #define CDCDEEMDriverDescriptors_VENDORID USBD_VID_ATMEL
00062
00063 #define CDCDEEMDriverDescriptors_RELEASE USBD_RELEASE_1_00
00064
00065
00066
00067
00068
00069
00070
00071 #define MIN(a, b) ((a < b) ? a : b)
00072
00073
00074
00075
00076
00077
00078 const USBDeviceDescriptor deviceDescriptor = {
00079
00080 sizeof(USBDeviceDescriptor),
00081 USBGenericDescriptor_DEVICE,
00082 USBDeviceDescriptor_USB2_00,
00083 CDCDeviceDescriptor_CLASS,
00084 CDCDeviceDescriptor_SUBCLASS,
00085 CDCDeviceDescriptor_PROTOCOL,
00086 CHIP_USB_ENDPOINTS_MAXPACKETSIZE(0),
00087 CDCDEEMDriverDescriptors_VENDORID,
00088 CDCDEEMDriverDescriptors_PRODUCTID,
00089 CDCDEEMDriverDescriptors_RELEASE,
00090 0,
00091 1,
00092 0,
00093 1
00094 };
00095
00096
00097 const CDCDEEMDriverConfigurationDescriptors configurationDescriptorsFS = {
00098
00099
00100 {
00101 sizeof(USBConfigurationDescriptor),
00102 USBGenericDescriptor_CONFIGURATION,
00103 sizeof(CDCDEEMDriverConfigurationDescriptors),
00104 1,
00105 1,
00106 0,
00107 USBD_BMATTRIBUTES,
00108 USBConfigurationDescriptor_POWER(100)
00109 },
00110
00111 {
00112 sizeof(USBInterfaceDescriptor),
00113 USBGenericDescriptor_INTERFACE,
00114 0,
00115 0,
00116 2,
00117 CDCCommunicationInterfaceDescriptor_CLASS,
00118 CDCCommunicationInterfaceDescriptor_ETHERNETEMULATIONMODEL,
00119 CDCCommunicationInterfaceDescriptor_EEMPROTOCOL,
00120 0
00121 },
00122
00123 {
00124 sizeof(USBEndpointDescriptor),
00125 USBGenericDescriptor_ENDPOINT,
00126 USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_OUT,
00127 CDCDEEMDriverDescriptors_BULKOUT),
00128 USBEndpointDescriptor_BULK,
00129 MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDEEMDriverDescriptors_BULKOUT),
00130 USBEndpointDescriptor_MAXBULKSIZE_FS),
00131 0
00132 },
00133
00134 {
00135 sizeof(USBEndpointDescriptor),
00136 USBGenericDescriptor_ENDPOINT,
00137 USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN,
00138 CDCDEEMDriverDescriptors_BULKIN),
00139 USBEndpointDescriptor_BULK,
00140 MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDEEMDriverDescriptors_BULKIN),
00141 USBEndpointDescriptor_MAXBULKSIZE_FS),
00142 0
00143 }
00144 };
00145
00146
00147 const CDCDEEMDriverConfigurationDescriptors otherSpeedDescriptorsFS = {
00148
00149
00150 {
00151 sizeof(USBConfigurationDescriptor),
00152 USBGenericDescriptor_OTHERSPEEDCONFIGURATION,
00153 sizeof(CDCDEEMDriverConfigurationDescriptors),
00154 1,
00155 1,
00156 0,
00157 BOARD_USB_BMATTRIBUTES,
00158 USBConfigurationDescriptor_POWER(100)
00159 },
00160
00161 {
00162 sizeof(USBInterfaceDescriptor),
00163 USBGenericDescriptor_INTERFACE,
00164 0,
00165 0,
00166 2,
00167 CDCCommunicationInterfaceDescriptor_CLASS,
00168 CDCCommunicationInterfaceDescriptor_ETHERNETEMULATIONMODEL,
00169 CDCCommunicationInterfaceDescriptor_EEMPROTOCOL,
00170 0
00171 },
00172
00173 {
00174 sizeof(USBEndpointDescriptor),
00175 USBGenericDescriptor_ENDPOINT,
00176 USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_OUT,
00177 CDCDEEMDriverDescriptors_BULKOUT),
00178 USBEndpointDescriptor_BULK,
00179 MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDEEMDriverDescriptors_BULKOUT),
00180 USBEndpointDescriptor_MAXBULKSIZE_HS),
00181 0
00182 },
00183
00184 {
00185 sizeof(USBEndpointDescriptor),
00186 USBGenericDescriptor_ENDPOINT,
00187 USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN,
00188 CDCDEEMDriverDescriptors_BULKIN),
00189 USBEndpointDescriptor_BULK,
00190 MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDEEMDriverDescriptors_BULKIN),
00191 USBEndpointDescriptor_MAXBULKSIZE_HS),
00192 0
00193 }
00194 };
00195
00196
00197 const CDCDEEMDriverConfigurationDescriptors configurationDescriptorsHS = {
00198
00199
00200 {
00201 sizeof(USBConfigurationDescriptor),
00202 USBGenericDescriptor_CONFIGURATION,
00203 sizeof(CDCDEEMDriverConfigurationDescriptors),
00204 1,
00205 1,
00206 0,
00207 BOARD_USB_BMATTRIBUTES,
00208 USBConfigurationDescriptor_POWER(100)
00209 },
00210
00211 {
00212 sizeof(USBInterfaceDescriptor),
00213 USBGenericDescriptor_INTERFACE,
00214 0,
00215 0,
00216 2,
00217 CDCCommunicationInterfaceDescriptor_CLASS,
00218 CDCCommunicationInterfaceDescriptor_ETHERNETEMULATIONMODEL,
00219 CDCCommunicationInterfaceDescriptor_EEMPROTOCOL,
00220 0
00221 },
00222
00223 {
00224 sizeof(USBEndpointDescriptor),
00225 USBGenericDescriptor_ENDPOINT,
00226 USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_OUT,
00227 CDCDEEMDriverDescriptors_BULKOUT),
00228 USBEndpointDescriptor_BULK,
00229 MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDEEMDriverDescriptors_BULKOUT),
00230 USBEndpointDescriptor_MAXBULKSIZE_HS),
00231 0
00232 },
00233
00234 {
00235 sizeof(USBEndpointDescriptor),
00236 USBGenericDescriptor_ENDPOINT,
00237 USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN,
00238 CDCDEEMDriverDescriptors_BULKIN),
00239 USBEndpointDescriptor_BULK,
00240 MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDEEMDriverDescriptors_BULKIN),
00241 USBEndpointDescriptor_MAXBULKSIZE_HS),
00242 0
00243 }
00244 };
00245
00246
00247 const CDCDEEMDriverConfigurationDescriptors otherSpeedDescriptorsHS = {
00248
00249
00250 {
00251 sizeof(USBConfigurationDescriptor),
00252 USBGenericDescriptor_OTHERSPEEDCONFIGURATION,
00253 sizeof(CDCDEEMDriverConfigurationDescriptors),
00254 1,
00255 1,
00256 0,
00257 BOARD_USB_BMATTRIBUTES,
00258 USBConfigurationDescriptor_POWER(100)
00259 },
00260
00261 {
00262 sizeof(USBInterfaceDescriptor),
00263 USBGenericDescriptor_INTERFACE,
00264 0,
00265 0,
00266 2,
00267 CDCCommunicationInterfaceDescriptor_CLASS,
00268 CDCCommunicationInterfaceDescriptor_ETHERNETEMULATIONMODEL,
00269 CDCCommunicationInterfaceDescriptor_EEMPROTOCOL,
00270 0
00271 },
00272
00273 {
00274 sizeof(USBEndpointDescriptor),
00275 USBGenericDescriptor_ENDPOINT,
00276 USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_OUT,
00277 CDCDEEMDriverDescriptors_BULKOUT),
00278 USBEndpointDescriptor_BULK,
00279 MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDEEMDriverDescriptors_BULKOUT),
00280 USBEndpointDescriptor_MAXBULKSIZE_FS),
00281 0
00282 },
00283
00284 {
00285 sizeof(USBEndpointDescriptor),
00286 USBGenericDescriptor_ENDPOINT,
00287 USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN,
00288 CDCDEEMDriverDescriptors_BULKIN),
00289 USBEndpointDescriptor_BULK,
00290 MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDEEMDriverDescriptors_BULKIN),
00291 USBEndpointDescriptor_MAXBULKSIZE_FS),
00292 0
00293 }
00294 };
00295
00296
00297 const unsigned char languageIdStringDescriptor[] = {
00298
00299 USBStringDescriptor_LENGTH(1),
00300 USBGenericDescriptor_STRING,
00301 USBStringDescriptor_ENGLISH_US
00302 };
00303
00304
00305 const unsigned char productStringDescriptor[] = {
00306
00307 USBStringDescriptor_LENGTH(12),
00308 USBGenericDescriptor_STRING,
00309 USBStringDescriptor_UNICODE('A'),
00310 USBStringDescriptor_UNICODE('T'),
00311 USBStringDescriptor_UNICODE('9'),
00312 USBStringDescriptor_UNICODE('1'),
00313 USBStringDescriptor_UNICODE('E'),
00314 USBStringDescriptor_UNICODE('t'),
00315 USBStringDescriptor_UNICODE('h'),
00316 USBStringDescriptor_UNICODE('e'),
00317 USBStringDescriptor_UNICODE('r'),
00318 USBStringDescriptor_UNICODE('n'),
00319 USBStringDescriptor_UNICODE('e'),
00320 USBStringDescriptor_UNICODE('t')
00321 };
00322
00323
00324 const unsigned char *stringDescriptors[] = {
00325
00326 languageIdStringDescriptor,
00327 productStringDescriptor,
00328 };
00329
00330
00331 WEAK const USBDDriverDescriptors cdcdEEMDriverDescriptors = {
00332
00333 &deviceDescriptor,
00334 (USBConfigurationDescriptor *) &(configurationDescriptorsFS),
00335 0,
00336 (USBConfigurationDescriptor *) &(otherSpeedDescriptorsFS),
00337 0,
00338 (USBConfigurationDescriptor *) &(configurationDescriptorsHS),
00339 0,
00340 (USBConfigurationDescriptor *) &(otherSpeedDescriptorsHS),
00341 stringDescriptors,
00342 2
00343 };
00344
00345