SAMV71 Xplained Ultra Software Package 1.4

USBDDriverDescriptors.c

Go to the documentation of this file.
00001 /* ----------------------------------------------------------------------------
00002  *         SAM Software Package License 
00003  * ----------------------------------------------------------------------------
00004  * Copyright (c) 2011, Atmel Corporation
00005  *
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions are met:
00010  *
00011  * - Redistributions of source code must retain the above copyright notice,
00012  * this list of conditions and the disclaimer below.
00013  *
00014  * Atmel's name may not be used to endorse or promote products derived from
00015  * this software without specific prior written permission.
00016  *
00017  * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
00018  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00019  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
00020  * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00022  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
00023  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00024  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00025  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00026  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  * ----------------------------------------------------------------------------
00028  */
00029 
00030 
00031 /** \file
00032  * \addtogroup usbd_cdc
00033  *@{
00034  */
00035 
00036 /*------------------------------------------------------------------------------
00037  *         Headers
00038  *----------------------------------------------------------------------------*/
00039 
00040 #include "board.h"
00041 #include "USBD_Config.h"
00042 #include "CDCDSerialDriver.h"
00043 
00044 /*------------------------------------------------------------------------------
00045  *         Definitions
00046  *----------------------------------------------------------------------------*/
00047 
00048 /** \addtogroup usbd_cdc_serial_device_ids CDC Serial Device IDs
00049  *      @{
00050  * This page lists the IDs used in the CDC Serial Device Descriptor.
00051  *
00052  * \section IDs
00053  * - CDCDSerialDriverDescriptors_PRODUCTID
00054  * - CDCDSerialDriverDescriptors_VENDORID
00055  * - CDCDSerialDriverDescriptors_RELEASE
00056  */
00057 
00058 /** Device product ID. */
00059 #define CDCDSerialDriverDescriptors_PRODUCTID       USBD_PID_CDCDSERIAL
00060 /** Device vendor ID (Atmel). */
00061 #define CDCDSerialDriverDescriptors_VENDORID        USBD_VID_ATMEL
00062 /** Device release number. */
00063 #define CDCDSerialDriverDescriptors_RELEASE         USBD_RELEASE_1_00
00064 /**      @}*/
00065 
00066 /*------------------------------------------------------------------------------
00067  *         Macros
00068  *----------------------------------------------------------------------------*/
00069 
00070 /** Returns the minimum between two values. */
00071 #define MIN(a, b)       ((a < b) ? a : b)
00072 
00073 /*------------------------------------------------------------------------------
00074  *         Exported variables
00075  *----------------------------------------------------------------------------*/
00076 
00077 /** Standard USB device descriptor for the CDC serial driver */
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     CDCDSerialDriverDescriptors_VENDORID,
00088     CDCDSerialDriverDescriptors_PRODUCTID,
00089     CDCDSerialDriverDescriptors_RELEASE,
00090     0, /* No string descriptor for manufacturer */
00091     1, /* Index of product string descriptor is #1 */
00092     0, /* No string descriptor for serial number */
00093     1 /* Device has 1 possible configuration */
00094 };
00095 
00096 
00097 /** Device qualifier descriptor (Necessary to pass USB test). */
00098 static const USBDeviceQualifierDescriptor qualifierDescriptor = {
00099 
00100     sizeof(USBDeviceQualifierDescriptor),
00101     USBGenericDescriptor_DEVICEQUALIFIER,
00102     USBDeviceDescriptor_USB2_00,
00103     CDCDeviceDescriptor_CLASS,
00104     CDCDeviceDescriptor_SUBCLASS,
00105     CDCDeviceDescriptor_PROTOCOL,
00106     CHIP_USB_ENDPOINTS_MAXPACKETSIZE(0),
00107     1, // Device has one possible configuration.
00108     0x00
00109 };
00110 /** Standard USB configuration descriptor for the CDC serial driver */
00111 const CDCDSerialDriverConfigurationDescriptors configurationDescriptorsFS = {
00112 
00113     /* Standard configuration descriptor */
00114     {
00115         sizeof(USBConfigurationDescriptor),
00116         USBGenericDescriptor_CONFIGURATION,
00117         sizeof(CDCDSerialDriverConfigurationDescriptors),
00118         2, /* There are two interfaces in this configuration */
00119         1, /* This is configuration #1 */
00120         0, /* No string descriptor for this configuration */
00121         USBD_BMATTRIBUTES,
00122         USBConfigurationDescriptor_POWER(100)
00123     },
00124     /* Communication class interface standard descriptor */
00125     {
00126         sizeof(USBInterfaceDescriptor),
00127         USBGenericDescriptor_INTERFACE,
00128         0, /* This is interface #0 */
00129         0, /* This is alternate setting #0 for this interface */
00130         1, /* This interface uses 1 endpoint */
00131         CDCCommunicationInterfaceDescriptor_CLASS,
00132         CDCCommunicationInterfaceDescriptor_ABSTRACTCONTROLMODEL,
00133         CDCCommunicationInterfaceDescriptor_NOPROTOCOL,
00134         0  /* No string descriptor for this interface */
00135     },
00136     /* Class-specific header functional descriptor */
00137     {
00138         sizeof(CDCHeaderDescriptor),
00139         CDCGenericDescriptor_INTERFACE,
00140         CDCGenericDescriptor_HEADER,
00141         CDCGenericDescriptor_CDC1_10
00142     },
00143     /* Class-specific call management functional descriptor */
00144     {
00145         sizeof(CDCCallManagementDescriptor),
00146         CDCGenericDescriptor_INTERFACE,
00147         CDCGenericDescriptor_CALLMANAGEMENT,
00148         CDCCallManagementDescriptor_SELFCALLMANAGEMENT,
00149         0 /* No associated data interface */
00150     },
00151     /* Class-specific abstract control management functional descriptor */
00152     {
00153         sizeof(CDCAbstractControlManagementDescriptor),
00154         CDCGenericDescriptor_INTERFACE,
00155         CDCGenericDescriptor_ABSTRACTCONTROLMANAGEMENT,
00156         CDCAbstractControlManagementDescriptor_LINE
00157     },
00158     /* Class-specific union functional descriptor with one slave interface */
00159     {
00160         sizeof(CDCUnionDescriptor),
00161         CDCGenericDescriptor_INTERFACE,
00162         CDCGenericDescriptor_UNION,
00163         0, /* Number of master interface is #0 */
00164         1 /* First slave interface is #1 */
00165     },
00166     /* Notification endpoint standard descriptor */
00167     {
00168         sizeof(USBEndpointDescriptor),
00169         USBGenericDescriptor_ENDPOINT,
00170         USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN,
00171                                     CDCDSerialDriverDescriptors_NOTIFICATION),
00172         USBEndpointDescriptor_INTERRUPT,
00173         MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_NOTIFICATION),
00174             USBEndpointDescriptor_MAXINTERRUPTSIZE_FS),
00175         10 /* Endpoint is polled every 10ms */
00176     },
00177     /* Data class interface standard descriptor */
00178     {
00179         sizeof(USBInterfaceDescriptor),
00180         USBGenericDescriptor_INTERFACE,
00181         1, /* This is interface #1 */
00182         0, /* This is alternate setting #0 for this interface */
00183         2, /* This interface uses 2 endpoints */
00184         CDCDataInterfaceDescriptor_CLASS,
00185         CDCDataInterfaceDescriptor_SUBCLASS,
00186         CDCDataInterfaceDescriptor_NOPROTOCOL,
00187         0  /* No string descriptor for this interface */
00188     },
00189     /* Bulk-OUT endpoint standard descriptor */
00190     {
00191         sizeof(USBEndpointDescriptor),
00192         USBGenericDescriptor_ENDPOINT,
00193         USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_OUT,
00194                                     CDCDSerialDriverDescriptors_DATAOUT),
00195         USBEndpointDescriptor_BULK,
00196         MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_DATAOUT),
00197             USBEndpointDescriptor_MAXBULKSIZE_FS),
00198         0 /* Must be 0 for full-speed bulk endpoints */
00199     },
00200     /* Bulk-IN endpoint descriptor */
00201     {
00202         sizeof(USBEndpointDescriptor),
00203         USBGenericDescriptor_ENDPOINT,
00204         USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN,
00205                                     CDCDSerialDriverDescriptors_DATAIN),
00206         USBEndpointDescriptor_BULK,
00207         MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_DATAIN),
00208             USBEndpointDescriptor_MAXBULKSIZE_FS),
00209         0 /* Must be 0 for full-speed bulk endpoints */
00210     }
00211 };
00212 
00213 /** Other-speed configuration descriptor (when in full-speed). */
00214 const CDCDSerialDriverConfigurationDescriptors otherSpeedDescriptorsFS = {
00215 
00216     /* Standard configuration descriptor */
00217     {
00218         sizeof(USBConfigurationDescriptor),
00219         USBGenericDescriptor_OTHERSPEEDCONFIGURATION,
00220         sizeof(CDCDSerialDriverConfigurationDescriptors),
00221         2, /* There are two interfaces in this configuration */
00222         1, /* This is configuration #1 */
00223         0, /* No string descriptor for this configuration */
00224         BOARD_USB_BMATTRIBUTES,
00225         USBConfigurationDescriptor_POWER(100)
00226     },
00227     /* Communication class interface standard descriptor */
00228     {
00229         sizeof(USBInterfaceDescriptor),
00230         USBGenericDescriptor_INTERFACE,
00231         0, /* This is interface #0 */
00232         0, /* This is alternate setting #0 for this interface */
00233         1, /* This interface uses 1 endpoint */
00234         CDCCommunicationInterfaceDescriptor_CLASS,
00235         CDCCommunicationInterfaceDescriptor_ABSTRACTCONTROLMODEL,
00236         CDCCommunicationInterfaceDescriptor_NOPROTOCOL,
00237         0  /* No string descriptor for this interface */
00238     },
00239     /* Class-specific header functional descriptor */
00240     {
00241         sizeof(CDCHeaderDescriptor),
00242         CDCGenericDescriptor_INTERFACE,
00243         CDCGenericDescriptor_HEADER,
00244         CDCGenericDescriptor_CDC1_10
00245     },
00246     /* Class-specific call management functional descriptor */
00247     {
00248         sizeof(CDCCallManagementDescriptor),
00249         CDCGenericDescriptor_INTERFACE,
00250         CDCGenericDescriptor_CALLMANAGEMENT,
00251         CDCCallManagementDescriptor_SELFCALLMANAGEMENT,
00252         0 /* No associated data interface */
00253     },
00254     /* Class-specific abstract control management functional descriptor */
00255     {
00256         sizeof(CDCAbstractControlManagementDescriptor),
00257         CDCGenericDescriptor_INTERFACE,
00258         CDCGenericDescriptor_ABSTRACTCONTROLMANAGEMENT,
00259         CDCAbstractControlManagementDescriptor_LINE
00260     },
00261     /* Class-specific union functional descriptor with one slave interface */
00262     {
00263         sizeof(CDCUnionDescriptor),
00264         CDCGenericDescriptor_INTERFACE,
00265         CDCGenericDescriptor_UNION,
00266         0, /* Number of master interface is #0 */
00267         1 /* First slave interface is #1 */
00268     },
00269     /* Notification endpoint standard descriptor */
00270     {
00271         sizeof(USBEndpointDescriptor), 
00272         USBGenericDescriptor_ENDPOINT,
00273         USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN,
00274                                     CDCDSerialDriverDescriptors_NOTIFICATION),
00275         USBEndpointDescriptor_INTERRUPT,
00276         MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_NOTIFICATION),
00277             USBEndpointDescriptor_MAXINTERRUPTSIZE_FS),
00278         8 /* Endpoint is polled every 16ms */
00279     },
00280     /* Data class interface standard descriptor */
00281     {
00282         sizeof(USBInterfaceDescriptor),
00283         USBGenericDescriptor_INTERFACE,
00284         1, /* This is interface #1 */
00285         0, /* This is alternate setting #0 for this interface */
00286         2, /* This interface uses 2 endpoints */
00287         CDCDataInterfaceDescriptor_CLASS,
00288         CDCDataInterfaceDescriptor_SUBCLASS,
00289         CDCDataInterfaceDescriptor_NOPROTOCOL,
00290         0  /* No string descriptor for this interface */
00291     },
00292     /* Bulk-OUT endpoint standard descriptor */
00293     {
00294         sizeof(USBEndpointDescriptor), 
00295         USBGenericDescriptor_ENDPOINT,
00296         USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_OUT,
00297                                     CDCDSerialDriverDescriptors_DATAOUT),
00298         USBEndpointDescriptor_BULK,
00299         MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_DATAOUT),
00300             USBEndpointDescriptor_MAXBULKSIZE_HS),
00301         0 /* Must be 0 for full-speed bulk endpoints */
00302     },
00303     /* Bulk-IN endpoint descriptor */
00304     {
00305         sizeof(USBEndpointDescriptor),
00306         USBGenericDescriptor_ENDPOINT,
00307         USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN,
00308                                     CDCDSerialDriverDescriptors_DATAIN),
00309         USBEndpointDescriptor_BULK,
00310         MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_DATAIN),
00311             USBEndpointDescriptor_MAXBULKSIZE_HS),
00312         0 /* Must be 0 for full-speed bulk endpoints */
00313     }
00314 };
00315 
00316 /** Configuration descriptor (when in high-speed). */
00317 const CDCDSerialDriverConfigurationDescriptors configurationDescriptorsHS = {
00318 
00319     /* Standard configuration descriptor */
00320     {
00321         sizeof(USBConfigurationDescriptor),
00322         USBGenericDescriptor_CONFIGURATION,
00323         sizeof(CDCDSerialDriverConfigurationDescriptors),
00324         2, /* There are two interfaces in this configuration */
00325         1, /* This is configuration #1 */
00326         0, /* No string descriptor for this configuration */
00327         BOARD_USB_BMATTRIBUTES,
00328         USBConfigurationDescriptor_POWER(100)
00329     },
00330     /* Communication class interface standard descriptor */
00331     {
00332         sizeof(USBInterfaceDescriptor),
00333         USBGenericDescriptor_INTERFACE,
00334         0, /* This is interface #0 */
00335         0, /* This is alternate setting #0 for this interface */
00336         1, /* This interface uses 1 endpoint */
00337         CDCCommunicationInterfaceDescriptor_CLASS,
00338         CDCCommunicationInterfaceDescriptor_ABSTRACTCONTROLMODEL,
00339         CDCCommunicationInterfaceDescriptor_NOPROTOCOL,
00340         0  /* No string descriptor for this interface */
00341     },
00342     /* Class-specific header functional descriptor */
00343     {
00344         sizeof(CDCHeaderDescriptor),
00345         CDCGenericDescriptor_INTERFACE,
00346         CDCGenericDescriptor_HEADER,
00347         CDCGenericDescriptor_CDC1_10
00348     },
00349     /* Class-specific call management functional descriptor */
00350     {
00351         sizeof(CDCCallManagementDescriptor),
00352         CDCGenericDescriptor_INTERFACE,
00353         CDCGenericDescriptor_CALLMANAGEMENT,
00354         CDCCallManagementDescriptor_SELFCALLMANAGEMENT,
00355         0 /* No associated data interface */
00356     },
00357     /* Class-specific abstract control management functional descriptor */
00358     {
00359         sizeof(CDCAbstractControlManagementDescriptor),
00360         CDCGenericDescriptor_INTERFACE,
00361         CDCGenericDescriptor_ABSTRACTCONTROLMANAGEMENT,
00362         CDCAbstractControlManagementDescriptor_LINE
00363     },
00364     /* Class-specific union functional descriptor with one slave interface */
00365     {
00366         sizeof(CDCUnionDescriptor),
00367         CDCGenericDescriptor_INTERFACE,
00368         CDCGenericDescriptor_UNION,
00369         0, /* Number of master interface is #0 */
00370         1 /* First slave interface is #1 */
00371     },
00372     /* Notification endpoint standard descriptor */
00373     {
00374         sizeof(USBEndpointDescriptor), 
00375         USBGenericDescriptor_ENDPOINT,
00376         USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN,
00377                                     CDCDSerialDriverDescriptors_NOTIFICATION),
00378         USBEndpointDescriptor_INTERRUPT,
00379         MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_NOTIFICATION),
00380             USBEndpointDescriptor_MAXINTERRUPTSIZE_FS),
00381         8  /* Endpoint is polled every 16ms */
00382     },
00383     /* Data class interface standard descriptor */
00384     {
00385         sizeof(USBInterfaceDescriptor),
00386         USBGenericDescriptor_INTERFACE,
00387         1, /* This is interface #1 */
00388         0, /* This is alternate setting #0 for this interface */
00389         2, /* This interface uses 2 endpoints */
00390         CDCDataInterfaceDescriptor_CLASS,
00391         CDCDataInterfaceDescriptor_SUBCLASS,
00392         CDCDataInterfaceDescriptor_NOPROTOCOL,
00393         0  /* No string descriptor for this interface */
00394     },
00395     /* Bulk-OUT endpoint standard descriptor */
00396     {
00397         sizeof(USBEndpointDescriptor), 
00398         USBGenericDescriptor_ENDPOINT,
00399         USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_OUT,
00400                                     CDCDSerialDriverDescriptors_DATAOUT),
00401         USBEndpointDescriptor_BULK,
00402         MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_DATAOUT),
00403             USBEndpointDescriptor_MAXBULKSIZE_HS),
00404         0 /* Must be 0 for full-speed bulk endpoints */
00405     },
00406     /* Bulk-IN endpoint descriptor */
00407     {
00408         sizeof(USBEndpointDescriptor),
00409         USBGenericDescriptor_ENDPOINT,
00410         USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN,
00411                                     CDCDSerialDriverDescriptors_DATAIN),
00412         USBEndpointDescriptor_BULK,
00413         MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_DATAIN),
00414             USBEndpointDescriptor_MAXBULKSIZE_HS),
00415         0 /* Must be 0 for full-speed bulk endpoints */
00416     }
00417 };
00418 
00419 /** Other-speed configuration descriptor (when in high-speed). */
00420 const CDCDSerialDriverConfigurationDescriptors otherSpeedDescriptorsHS = {
00421 
00422     /* Standard configuration descriptor */
00423     {
00424         sizeof(USBConfigurationDescriptor),
00425         USBGenericDescriptor_OTHERSPEEDCONFIGURATION,
00426         sizeof(CDCDSerialDriverConfigurationDescriptors),
00427         2, /* There are two interfaces in this configuration */
00428         1, /* This is configuration #1 */
00429         0, /* No string descriptor for this configuration */
00430         BOARD_USB_BMATTRIBUTES,
00431         USBConfigurationDescriptor_POWER(100)
00432     },
00433     /* Communication class interface standard descriptor */
00434     {
00435         sizeof(USBInterfaceDescriptor),
00436         USBGenericDescriptor_INTERFACE,
00437         0, /* This is interface #0 */
00438         0, /* This is alternate setting #0 for this interface */
00439         1, /* This interface uses 1 endpoint */
00440         CDCCommunicationInterfaceDescriptor_CLASS,
00441         CDCCommunicationInterfaceDescriptor_ABSTRACTCONTROLMODEL,
00442         CDCCommunicationInterfaceDescriptor_NOPROTOCOL,
00443         0  /* No string descriptor for this interface */
00444     },
00445     /* Class-specific header functional descriptor */
00446     {
00447         sizeof(CDCHeaderDescriptor),
00448         CDCGenericDescriptor_INTERFACE,
00449         CDCGenericDescriptor_HEADER,
00450         CDCGenericDescriptor_CDC1_10
00451     },
00452     /* Class-specific call management functional descriptor */
00453     {
00454         sizeof(CDCCallManagementDescriptor),
00455         CDCGenericDescriptor_INTERFACE,
00456         CDCGenericDescriptor_CALLMANAGEMENT,
00457         CDCCallManagementDescriptor_SELFCALLMANAGEMENT,
00458         0 /* No associated data interface */
00459     },
00460     /* Class-specific abstract control management functional descriptor */
00461     {
00462         sizeof(CDCAbstractControlManagementDescriptor),
00463         CDCGenericDescriptor_INTERFACE,
00464         CDCGenericDescriptor_ABSTRACTCONTROLMANAGEMENT,
00465         CDCAbstractControlManagementDescriptor_LINE
00466     },
00467     /* Class-specific union functional descriptor with one slave interface */
00468     {
00469         sizeof(CDCUnionDescriptor),
00470         CDCGenericDescriptor_INTERFACE,
00471         CDCGenericDescriptor_UNION,
00472         0, /* Number of master interface is #0 */
00473         1 /* First slave interface is #1 */
00474     },
00475     /* Notification endpoint standard descriptor */
00476     {
00477         sizeof(USBEndpointDescriptor), 
00478         USBGenericDescriptor_ENDPOINT,
00479         USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN,
00480                                     CDCDSerialDriverDescriptors_NOTIFICATION),
00481         USBEndpointDescriptor_INTERRUPT,
00482         MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_NOTIFICATION),
00483             USBEndpointDescriptor_MAXINTERRUPTSIZE_FS),
00484         10 /* Endpoint is polled every 10ms */
00485     },
00486     /* Data class interface standard descriptor */
00487     {
00488         sizeof(USBInterfaceDescriptor),
00489         USBGenericDescriptor_INTERFACE,
00490         1, /* This is interface #1 */
00491         0, /* This is alternate setting #0 for this interface */
00492         2, /* This interface uses 2 endpoints */
00493         CDCDataInterfaceDescriptor_CLASS,
00494         CDCDataInterfaceDescriptor_SUBCLASS,
00495         CDCDataInterfaceDescriptor_NOPROTOCOL,
00496         0  /* No string descriptor for this interface */
00497     },
00498     /* Bulk-OUT endpoint standard descriptor */
00499     {
00500         sizeof(USBEndpointDescriptor), 
00501         USBGenericDescriptor_ENDPOINT,
00502         USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_OUT,
00503                                     CDCDSerialDriverDescriptors_DATAOUT),
00504         USBEndpointDescriptor_BULK,
00505         MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_DATAOUT),
00506             USBEndpointDescriptor_MAXBULKSIZE_FS),
00507         0 /* Must be 0 for full-speed bulk endpoints */
00508     },
00509     /* Bulk-IN endpoint descriptor */
00510     {
00511         sizeof(USBEndpointDescriptor),
00512         USBGenericDescriptor_ENDPOINT,
00513         USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN,
00514                                     CDCDSerialDriverDescriptors_DATAIN),
00515         USBEndpointDescriptor_BULK,
00516         MIN(CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_DATAIN),
00517             USBEndpointDescriptor_MAXBULKSIZE_FS),
00518         0 /* Must be 0 for full-speed bulk endpoints */
00519     }
00520 };
00521 
00522 
00523 
00524 
00525 /** Language ID string descriptor */
00526 const unsigned char languageIdStringDescriptor[] = {
00527 
00528     USBStringDescriptor_LENGTH(1),
00529     USBGenericDescriptor_STRING,
00530     USBStringDescriptor_ENGLISH_US
00531 };
00532 
00533 /** Product string descriptor */
00534 const unsigned char productStringDescriptor[] = {
00535 
00536     USBStringDescriptor_LENGTH(13),
00537     USBGenericDescriptor_STRING,
00538     USBStringDescriptor_UNICODE('A'),
00539     USBStringDescriptor_UNICODE('T'),
00540     USBStringDescriptor_UNICODE('9'),
00541     USBStringDescriptor_UNICODE('1'),
00542     USBStringDescriptor_UNICODE('U'),
00543     USBStringDescriptor_UNICODE('S'),
00544     USBStringDescriptor_UNICODE('B'),
00545     USBStringDescriptor_UNICODE('S'),
00546     USBStringDescriptor_UNICODE('e'),
00547     USBStringDescriptor_UNICODE('r'),
00548     USBStringDescriptor_UNICODE('i'),
00549     USBStringDescriptor_UNICODE('a'),
00550     USBStringDescriptor_UNICODE('l')
00551 };
00552 
00553 /** List of string descriptors used by the device */
00554 const unsigned char *stringDescriptors[] = {
00555 
00556     languageIdStringDescriptor,
00557     productStringDescriptor,
00558 };
00559 
00560 /** List of standard descriptors for the serial driver. */
00561 WEAK const USBDDriverDescriptors cdcdSerialDriverDescriptors = {
00562 
00563     &deviceDescriptor,
00564     (USBConfigurationDescriptor *) &(configurationDescriptorsFS),
00565     &qualifierDescriptor,
00566     (USBConfigurationDescriptor *) &(otherSpeedDescriptorsFS),
00567     0, /* No high-speed device descriptor (uses FS one) */
00568     (USBConfigurationDescriptor *) &(configurationDescriptorsHS),
00569     &qualifierDescriptor,
00570     (USBConfigurationDescriptor *) &(otherSpeedDescriptorsHS),
00571     stringDescriptors,
00572     2 /* 2 string descriptors in list */
00573 };
00574 
00575 /**@}*/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines