00001 /* ---------------------------------------------------------------------------- */ 00002 /* Atmel Microcontroller Software Support */ 00003 /* SAM Software Package License */ 00004 /* ---------------------------------------------------------------------------- */ 00005 /* Copyright (c) 2015, Atmel Corporation */ 00006 /* */ 00007 /* All rights reserved. */ 00008 /* */ 00009 /* Redistribution and use in source and binary forms, with or without */ 00010 /* modification, are permitted provided that the following condition is met: */ 00011 /* */ 00012 /* - Redistributions of source code must retain the above copyright notice, */ 00013 /* this list of conditions and the disclaimer below. */ 00014 /* */ 00015 /* Atmel's name may not be used to endorse or promote products derived from */ 00016 /* this software without specific prior written permission. */ 00017 /* */ 00018 /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ 00019 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ 00020 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ 00021 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ 00022 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ 00023 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ 00024 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ 00025 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ 00026 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ 00027 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 00028 /* ---------------------------------------------------------------------------- */ 00029 /** 00030 * \file 00031 * 00032 * USB Device Framework configurations. 00033 * 00034 */ 00035 00036 #ifndef USBD_CONFIG_H 00037 #define USBD_CONFIG_H 00038 00039 /*---------------------------------------------------------------------------- 00040 * Headers 00041 *----------------------------------------------------------------------------*/ 00042 00043 #include "board.h" 00044 00045 /** \addtogroup usbd_config 00046 *@{ 00047 */ 00048 /*---------------------------------------------------------------------------- 00049 * Constants 00050 *----------------------------------------------------------------------------*/ 00051 00052 /** \addtogroup usbd_ids USBD Device IDs 00053 * @{ 00054 */ 00055 #define USBD_VID_ATMEL 0x03EB /**< Vendor ID: Atmel */ 00056 00057 #define USBD_PID_ENUM 0x0001 /**< Product ID: Enum (Core) */ 00058 #define USBD_PID_CDCDSERIAL 0x6124 /**< Product ID: CDC Serial */ 00059 #define USBD_PID_HIDKEYBOARD 0x6127 /**< Product ID: HID Keyboard */ 00060 #define USBD_PID_AUDIO 0x6128 /**< Product ID: Audio devices */ 00061 #define USBD_PID_MSD 0x6129 /**< Product ID: Massstorage */ 00062 #define USBD_PID_CDCHID 0x6130 /**< Product ID: composite */ 00063 #define USBD_PID_CDCAUDIO 0x6131 /**< Product ID: composite */ 00064 #define USBD_PID_CDCMSD 0x6132 /**< Product ID: composite */ 00065 #define USBD_PID_CDCCDC 0x6133 /**< Product ID: composite */ 00066 #define USBD_PID_HIDAUDIO 0x6134 /**< Product ID: composite */ 00067 #define USBD_PID_HIDMSD 0x6135 /**< Product ID: composite */ 00068 #define USBD_PID_HIDMOUSE 0x6200 /**< Product ID: HID Mouse */ 00069 #define USBD_PID_HIDTRANSFER 0x6201 /**< Product ID: HID Transfer */ 00070 #define USBD_PID_CCID 0x6203 /**< Product ID: CCID */ 00071 #define USBD_PID_UVC 0x6136 /**< Product ID: UVC */ 00072 #define USBD_PID_CDCEEM 0x6137 /**< Product ID: CDC EEM */ 00073 00074 #define USBD_RELEASE_1_00 0x0100 /**< Release: 1.00 */ 00075 #define USBD_RELEASE_0_01 0x0001 /**< Release: 0.01 */ 00076 /** @}*/ 00077 00078 /** \addtogroup usbd_general_config USBD General Configure 00079 * @{ 00080 * This page lists general configurations for all USB device drivers. 00081 * - \ref USBD_BMATTRIBUTES 00082 */ 00083 /** default USB Device attributes configuration descriptor 00084 * (bus or self powered, remote wakeup) */ 00085 #define USBD_BMATTRIBUTES BOARD_USB_BMATTRIBUTES 00086 /** @}*/ 00087 00088 /*---------------------------------------------------------------------------- 00089 * USB Device - Mass storage 00090 *----------------------------------------------------------------------------*/ 00091 00092 /** \addtogroup usbd_msdd_config USB MassStorage Configure 00093 * @{ 00094 * This page lists the defines used by the Mass Storage driver. 00095 * 00096 * \section msd_ep_addr Endpoint Addresses 00097 * - \ref MSDDriverDescriptors_BULKOUT 00098 * - \ref MSDDriverDescriptors_BULKIN 00099 */ 00100 /** Address of the Mass Storage bulk-out endpoint.*/ 00101 #define MSDDriverDescriptors_BULKOUT 2 00102 /** Address of the Mass Storage bulk-in endpoint.*/ 00103 #define MSDDriverDescriptors_BULKIN 3 00104 /** @}*/ 00105 00106 /*---------------------------------------------------------------------------- 00107 * USB Device - CDC Serial 00108 *----------------------------------------------------------------------------*/ 00109 00110 /** \addtogroup usbd_cdc_serial_config USB CDC Serial Configure 00111 * @{ 00112 * This page lists the defines used by the CDC Serial Device Driver. 00113 * 00114 * \section cdcd_ep_addr Endpoint Addresses 00115 * - \ref CDCDSerialDriverDescriptors_DATAOUT 00116 * - \ref CDCDSerialDriverDescriptors_DATAIN 00117 * - \ref CDCDSerialDriverDescriptors_NOTIFICATION 00118 */ 00119 /** Data OUT endpoint number */ 00120 #define CDCDSerialDriverDescriptors_DATAOUT 2 00121 /** Data IN endpoint number */ 00122 #define CDCDSerialDriverDescriptors_DATAIN 3 00123 /** Notification endpoint number */ 00124 #define CDCDSerialDriverDescriptors_NOTIFICATION 4 00125 /** @}*/ 00126 00127 /*---------------------------------------------------------------------------- 00128 * USB Device - CDC EEM 00129 *----------------------------------------------------------------------------*/ 00130 00131 /** \addtogroup usbd_cdc_eem_config USB CDC EEM Configure 00132 * @{ 00133 * This page lists the defines used by the CDC EEM Device Driver. 00134 * 00135 * \section eemd_ep_addr Endpoint Addresses 00136 * - \ref CDCDEEMDriverDescriptors_BULKOUT 00137 * - \ref CDCDEEMDriverDescriptors_BULKIN 00138 */ 00139 /** Bulk OUT endpoint number */ 00140 #define CDCDEEMDriverDescriptors_BULKOUT 1 00141 /** Bulk IN endpoint number */ 00142 #define CDCDEEMDriverDescriptors_BULKIN 2 00143 /** @}*/ 00144 00145 /*---------------------------------------------------------------------------- 00146 * USB Device - Audio 00147 *----------------------------------------------------------------------------*/ 00148 00149 /** \addtogroup usbd_audio_config USB Audio General Configure 00150 * @{ 00151 * This page lists definitions for USB Audio Devices Drivers. 00152 * - \ref 00153 */ 00154 00155 /** Sample rate in Hz. */ 00156 #define AUDDevice_SAMPLERATE 48000UL 00157 /** Number of channels in audio stream. */ 00158 #define AUDDevice_NUMCHANNELS 2 00159 /** Number of bytes in one sample. */ 00160 #define AUDDevice_BYTESPERSAMPLE 2 00161 00162 /** Number of bits in one sample. */ 00163 #define AUDDevice_BITSPERSAMPLE (AUDDevice_BYTESPERSAMPLE * 8) 00164 /** Number of bytes in one USB subframe. */ 00165 #define AUDDevice_BYTESPERSUBFRAME (AUDDevice_NUMCHANNELS * \ 00166 AUDDevice_BYTESPERSAMPLE) 00167 /** Number of samples in one USB frame. */ 00168 #define AUDDevice_SAMPLESPERFRAME (AUDDevice_SAMPLERATE / 1000 \ 00169 * AUDDevice_NUMCHANNELS) 00170 /** Number of bytes in one USB frame. */ 00171 #define AUDDevice_BYTESPERFRAME (AUDDevice_SAMPLESPERFRAME * \ 00172 AUDDevice_BYTESPERSAMPLE) 00173 /** @}*/ 00174 00175 /*---------------------------------------------------------------------------- 00176 * USB Device - Audio - Desktop Speaker 00177 *----------------------------------------------------------------------------*/ 00178 00179 /** \addtogroup usbd_audio_speaker_config USB Speaker Configure 00180 * @{ 00181 * This page lists the definitions for USB Audio Speaker Device Driver. 00182 * - \ref AUDDSpeakerDriverDescriptors_DATAOUT 00183 * - \ref AUDDSpeakerDriverDescriptors_FS_INTERVAL 00184 * - \ref AUDDSpeakerDriverDescriptors_HS_INTERVAL 00185 * 00186 * \note for UDP, uses IN EPs that support double buffer; for UDPHS, uses 00187 * IN EPs that support DMA and High bandwidth. 00188 */ 00189 /** Data out endpoint number. */ 00190 #define AUDDSpeakerDriverDescriptors_DATAOUT 0x02 00191 /** Endpoint polling interval 2^(x-1) * 125us */ 00192 #define AUDDSpeakerDriverDescriptors_HS_INTERVAL 0x04 00193 /** Endpoint polling interval 2^(x-1) * ms */ 00194 #define AUDDSpeakerDriverDescriptors_FS_INTERVAL 0x01 00195 /** @}*/ 00196 00197 /*---------------------------------------------------------------------------- 00198 * USB Device - Audio - Speaker Phone 00199 *----------------------------------------------------------------------------*/ 00200 00201 /** \addtogroup usbd_audio_speakerphone_config USB Speaker Phone Configure 00202 * @{ 00203 * This page lists the definitions for USB Audio Speaker Phone Device Driver. 00204 * - \ref AUDDSpeakerPhoneDriverDescriptors_DATAOUT 00205 * - \ref AUDDSpeakerPhoneDriverDescriptors_DATAIN 00206 * - \ref AUDDSpeakerPhoneDriverDescriptors_HS_INTERVAL 00207 * - \ref AUDDSpeakerPhoneDriverDescriptors_FS_INTERVAL 00208 */ 00209 00210 00211 /** Data out endpoint number, size 192B */ 00212 #define AUDDSpeakerPhoneDriverDescriptors_DATAOUT 0x02 00213 /** Data in endpoint number, size 192B */ 00214 #define AUDDSpeakerPhoneDriverDescriptors_DATAIN 0x01 00215 00216 /** Endpoint polling interval 2^(x-1) * 125us */ 00217 #define AUDDSpeakerPhoneDriverDescriptors_HS_INTERVAL 0x04 00218 /** Endpoint polling interval 2^(x-1) * ms */ 00219 #define AUDDSpeakerPhoneDriverDescriptors_FS_INTERVAL 0x01 00220 /** @}*/ 00221 00222 /*---------------------------------------------------------------------------- 00223 * USB Device - HID - Keyboard 00224 *----------------------------------------------------------------------------*/ 00225 00226 /** \addtogroup usbd_hid_keyboard_config USB HID Keyboard Device Configure 00227 * @{ 00228 * This page lists the defines used by the HID Keyboard Device Driver. 00229 * 00230 * \section hidd_k_ep_addr Endpoint Addresses 00231 * - \ref HIDDKeyboardDriverDescriptors_INTERRUPTIN 00232 * - \ref HIDDKeyboardDriverDescriptors_INTERRUPTOUT 00233 * \section hidd_k_ep_polling Endpoint Polling Rate 00234 * - \ref HIDDKeyboardDriverDescriptors_INTERRUPTIN_POLLING 00235 * - \ref HIDDKeyboardDriverDescriptors_INTERRUPTOUT_POLLING 00236 */ 00237 /** Interrupt IN endpoint number */ 00238 #define HIDDKeyboardDriverDescriptors_INTERRUPTIN 2 00239 /** Interrupt IN endpoint polling rate (in milliseconds) */ 00240 #define HIDDKeyboardDriverDescriptors_INTERRUPTIN_POLLING 10 00241 /** Interrupt OUT endpoint number */ 00242 #define HIDDKeyboardDriverDescriptors_INTERRUPTOUT 3 00243 /** Interrupt OUT endpoint polling rate (in milliseconds) */ 00244 #define HIDDKeyboardDriverDescriptors_INTERRUPTOUT_POLLING 10 00245 /** @}*/ 00246 00247 /*---------------------------------------------------------------------------- 00248 * USB Device - HID - Mouse 00249 *----------------------------------------------------------------------------*/ 00250 00251 /** \addtogroup usbd_hid_mouse_config USB HID Mouse Device Configure 00252 * @{ 00253 * This page lists the defines used by the HID Mouse Device Driver. 00254 * 00255 * \section hidd_m_ep_addr Endpoint Addresses 00256 * - \ref HIDDMouseDriverDescriptors_INTERRUPTIN 00257 * \section hidd_m_ep_polling Endpoint Polling Rate 00258 * - \ref HIDDMouseDriverDescriptors_INTERRUPTIN_POLLING 00259 */ 00260 /** Interrupt IN endpoint number */ 00261 #define HIDDMouseDriverDescriptors_INTERRUPTIN 2 00262 /** Interrupt IN endpoint polling rate (in milliseconds) */ 00263 #define HIDDMouseDriverDescriptors_INTERRUPTIN_POLLING 8 00264 /** @}*/ 00265 00266 /*---------------------------------------------------------------------------- 00267 * USB Device - HID - Transfer (Customize device) 00268 *----------------------------------------------------------------------------*/ 00269 00270 /** \addtogroup usbd_hid_xfr_config USB HID Transfer Device Configure 00271 * @{ 00272 * This page lists the defines used by the HID Transfer Device Driver. 00273 * 00274 * \section hidd_t_ep_addr Endpoint Addresses 00275 * - \ref HIDDTransferDriverDescriptors_INTERRUPTIN 00276 * - \ref HIDDTransferDriverDescriptors_INTERRUPTOUT 00277 * \section hidd_t_ep_polling Endpoint Polling Rate 00278 * - \ref HIDDTransferDriverDescriptors_INTERRUPTIN_POLLING 00279 * - \ref HIDDTransferDriverDescriptors_INTERRUPTOUT_POLLING 00280 */ 00281 /** Interrupt IN endpoint number. */ 00282 #define HIDDTransferDriverDescriptors_INTERRUPTIN 2 00283 /** Polling rate in ms */ 00284 #define HIDDTransferDriverDescriptors_INTERRUPTIN_POLLING 50 00285 /** Interrupt IN endpoint polling rate (in milliseconds). */ 00286 #define HIDDTransferDriverDescriptors_INTERRUPTOUT 3 00287 /** Polling rate in ms */ 00288 #define HIDDTransferDriverDescriptors_INTERRUPTOUT_POLLING 50 00289 /** @}*/ 00290 00291 /*---------------------------------------------------------------------------- 00292 * USB Device - Composite 00293 *----------------------------------------------------------------------------*/ 00294 00295 /** \addtogroup usbd_composite_config USB Composite Device Configure 00296 * @{ 00297 */ 00298 00299 /*---------------------------------------------------------------------------- 00300 * USB Device - HID_AUD 00301 *----------------------------------------------------------------------------*/ 00302 00303 /** Address of the HID interrupt IN endpoint. */ 00304 #define HIDAUDD_Descriptors_INTERRUPTIN 0x03 00305 /** Address of the HID interrupt OUT endpoint. */ 00306 #define HIDAUDD_Descriptors_INTERRUPTOUT 0x04 00307 00308 /** Audio data out endpoint number */ 00309 #define HIDAUDD_Descriptors_ISO_DATAOUT 0x02 00310 00311 00312 /*---------------------------------------------------------------------------- 00313 * USB Device - CDC AUD 00314 *----------------------------------------------------------------------------*/ 00315 00316 /** Address of the CDC interrupt-in endpoint. */ 00317 #define CDCAUDD_Descriptors_NOTIFICATION0 0x04 00318 /** Address of the CDC bulk-in endpoint. */ 00319 #define CDCAUDD_Descriptors_DATAIN0 0x03 00320 /** Address of the CDC bulk-out endpoint. */ 00321 #define CDCAUDD_Descriptors_DATAOUT0 0x02 00322 /** Address of the Audio ISO-out endpoint. */ 00323 #define CDCAUDD_Descriptors_ISO_DATAOUT 0x01 00324 00325 00326 /*---------------------------------------------------------------------------- 00327 * USB Device - DUAL CDC 00328 *----------------------------------------------------------------------------*/ 00329 00330 /// Address of the CDC0 interrupt-in endpoint. 00331 #define CDCD_Descriptors_NOTIFICATION0 3 00332 /// Address of the CDC0 bulk-in endpoint. 00333 #define CDCD_Descriptors_DATAIN0 2 00334 /// Address of the CDC0 bulk-out endpoint. 00335 #define CDCD_Descriptors_DATAOUT0 1 00336 00337 /// Address of the CDC1 interrupt-in endpoint. 00338 #define CDCD_Descriptors_NOTIFICATION1 6 00339 /// Address of the CDC1 bulk-in endpoint. 00340 #define CDCD_Descriptors_DATAIN1 5 00341 /// Address of the CDC1 bulk-out endpoint. 00342 #define CDCD_Descriptors_DATAOUT1 4 00343 00344 00345 /*---------------------------------------------------------------------------- 00346 * USB Device - HID CDC 00347 *----------------------------------------------------------------------------*/ 00348 00349 00350 /** Address of the CDC interrupt-in endpoint. */ 00351 #define CDCD_Descriptors_NOTIFICATION0 3 00352 /** Address of the CDC bulk-in endpoint. */ 00353 #define CDCD_Descriptors_DATAIN0 2 00354 /** Address of the CDC bulk-out endpoint. */ 00355 #define CDCD_Descriptors_DATAOUT0 1 00356 00357 /** Address of the HID interrupt IN endpoint. */ 00358 #define HIDD_Descriptors_INTERRUPTIN 4 00359 /** Address of the HID interrupt OUT endpoint. */ 00360 #define HIDD_Descriptors_INTERRUPTOUT 5 00361 00362 00363 00364 /*---------------------------------------------------------------------------- 00365 * USB Device - HID MSD 00366 *----------------------------------------------------------------------------*/ 00367 00368 /** Address of the Mass Storage bulk-out endpoint. */ 00369 #define HIDMSDD_Descriptors_BULKOUT 2 00370 /** Address of the Mass Storage bulk-in endpoint. */ 00371 #define HIDMSDD_Descriptors_BULKIN 3 00372 00373 /** Address of the HID interrupt IN endpoint. */ 00374 #define HIDMSDD_Descriptors_INTERRUPTIN 4 00375 /** Address of the HID interrupt OUT endpoint. */ 00376 #define HIDMSDD_Descriptors_INTERRUPTOUT 5 00377 00378 /*---------------------------------------------------------------------------- 00379 * USB Device - MSD CDC 00380 *----------------------------------------------------------------------------*/ 00381 00382 /** Address of the CDC interrupt-in endpoint. */ 00383 #define CDCD_Descriptors_NOTIFICATION0 3 00384 /** Address of the CDC bulk-in endpoint. */ 00385 #define CDCD_Descriptors_DATAIN0 2 00386 /** Address of the CDC bulk-out endpoint. */ 00387 #define CDCD_Descriptors_DATAOUT0 1 00388 /** Address of the Mass Storage bulk-out endpoint. */ 00389 #define MSDD_Descriptors_BULKOUT 4 00390 /** Address of the Mass Storage bulk-in endpoint. */ 00391 #define MSDD_Descriptors_BULKIN 5 00392 00393 /** @}*/ 00394 00395 /**@}*/ 00396 #endif //#ifndef USBD_CONFIG_H 00397 00398