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 * 00033 * USB Device Framework configurations. 00034 * 00035 */ 00036 00037 #ifndef USBD_CONFIG_H 00038 #define USBD_CONFIG_H 00039 00040 /*---------------------------------------------------------------------------- 00041 * Headers 00042 *----------------------------------------------------------------------------*/ 00043 00044 #include "board.h" 00045 00046 /** \addtogroup usbd_config 00047 *@{ 00048 */ 00049 /*---------------------------------------------------------------------------- 00050 * Constants 00051 *----------------------------------------------------------------------------*/ 00052 00053 /** \addtogroup usbd_ids USBD Device IDs 00054 * @{ 00055 */ 00056 #define USBD_VID_ATMEL 0x03EB /**< Vendor ID: Atmel */ 00057 00058 #define USBD_PID_ENUM 0x0001 /**< Product ID: Enum (Core) */ 00059 #define USBD_PID_CDCDSERIAL 0x6119 /**< Product ID: CDC Serial */ 00060 #define USBD_PID_HIDKEYBOARD 0x6127 /**< Product ID: HID Keyboard */ 00061 #define USBD_PID_AUDIO 0x6128 /**< Product ID: Audio devices */ 00062 #define USBD_PID_MSD 0x6129 /**< Product ID: Massstorage */ 00063 #define USBD_PID_CDCHID 0x6130 /**< Product ID: composite */ 00064 #define USBD_PID_CDCAUDIO 0x6131 /**< Product ID: composite */ 00065 #define USBD_PID_CDCMSD 0x6132 /**< Product ID: composite */ 00066 #define USBD_PID_CDCCDC 0x6133 /**< Product ID: composite */ 00067 #define USBD_PID_HIDAUDIO 0x6134 /**< Product ID: composite */ 00068 #define USBD_PID_HIDMSD 0x6135 /**< Product ID: composite */ 00069 #define USBD_PID_HIDMOUSE 0x6200 /**< Product ID: HID Mouse */ 00070 #define USBD_PID_HIDTRANSFER 0x6201 /**< Product ID: HID Transfer */ 00071 #define USBD_PID_CCID 0x6203 /**< Product ID: CCID */ 00072 #define USBD_PID_UVC 0x6136 /**< Product ID: UVC */ 00073 #define USBD_PID_CDCEEM 0x6137 /**< Product ID: CDC EEM */ 00074 00075 #define USBD_RELEASE_1_00 0x0100 /**< Release: 1.00 */ 00076 #define USBD_RELEASE_0_01 0x0001 /**< Release: 0.01 */ 00077 /** @}*/ 00078 00079 /** \addtogroup usbd_general_config USBD General Configure 00080 * @{ 00081 * This page lists general configurations for all USB device drivers. 00082 * - \ref USBD_BMATTRIBUTES 00083 */ 00084 /** default USB Device attributes configuration descriptor 00085 * (bus or self powered, remote wakeup) */ 00086 #define USBD_BMATTRIBUTES BOARD_USB_BMATTRIBUTES 00087 /** @}*/ 00088 00089 /*---------------------------------------------------------------------------- 00090 * USB Device - Mass storage 00091 *----------------------------------------------------------------------------*/ 00092 00093 /** \addtogroup usbd_msdd_config USB MassStorage Configure 00094 * @{ 00095 * This page lists the defines used by the Mass Storage driver. 00096 * 00097 * \section msd_ep_addr Endpoint Addresses 00098 * - \ref MSDDriverDescriptors_BULKOUT 00099 * - \ref MSDDriverDescriptors_BULKIN 00100 */ 00101 /** Address of the Mass Storage bulk-out endpoint.*/ 00102 #define MSDDriverDescriptors_BULKOUT 2 00103 /** Address of the Mass Storage bulk-in endpoint.*/ 00104 #define MSDDriverDescriptors_BULKIN 3 00105 /** @}*/ 00106 00107 /*---------------------------------------------------------------------------- 00108 * USB Device - CDC Serial 00109 *----------------------------------------------------------------------------*/ 00110 00111 /** \addtogroup usbd_cdc_serial_config USB CDC Serial Configure 00112 * @{ 00113 * This page lists the defines used by the CDC Serial Device Driver. 00114 * 00115 * \section cdcd_ep_addr Endpoint Addresses 00116 * - \ref CDCDSerialDriverDescriptors_DATAOUT 00117 * - \ref CDCDSerialDriverDescriptors_DATAIN 00118 * - \ref CDCDSerialDriverDescriptors_NOTIFICATION 00119 */ 00120 /** Data OUT endpoint number */ 00121 #define CDCDSerialDriverDescriptors_DATAOUT 2 00122 /** Data IN endpoint number */ 00123 #define CDCDSerialDriverDescriptors_DATAIN 3 00124 /** Notification endpoint number */ 00125 #define CDCDSerialDriverDescriptors_NOTIFICATION 4 00126 /** @}*/ 00127 00128 /*---------------------------------------------------------------------------- 00129 * USB Device - CDC EEM 00130 *----------------------------------------------------------------------------*/ 00131 00132 /** \addtogroup usbd_cdc_eem_config USB CDC EEM Configure 00133 * @{ 00134 * This page lists the defines used by the CDC EEM Device Driver. 00135 * 00136 * \section eemd_ep_addr Endpoint Addresses 00137 * - \ref CDCDEEMDriverDescriptors_BULKOUT 00138 * - \ref CDCDEEMDriverDescriptors_BULKIN 00139 */ 00140 /** Bulk OUT endpoint number */ 00141 #define CDCDEEMDriverDescriptors_BULKOUT 1 00142 /** Bulk IN endpoint number */ 00143 #define CDCDEEMDriverDescriptors_BULKIN 2 00144 /** @}*/ 00145 00146 /*---------------------------------------------------------------------------- 00147 * USB Device - Audio 00148 *----------------------------------------------------------------------------*/ 00149 00150 /** \addtogroup usbd_audio_config USB Audio General Configure 00151 * @{ 00152 * This page lists definitions for USB Audio Devices Drivers. 00153 * - \ref 00154 */ 00155 00156 /** Sample rate in Hz. */ 00157 #define AUDDevice_SAMPLERATE 48000UL 00158 /** Number of channels in audio stream. */ 00159 #define AUDDevice_NUMCHANNELS 2 00160 /** Number of bytes in one sample. */ 00161 #define AUDDevice_BYTESPERSAMPLE 2 00162 00163 /** Number of bits in one sample. */ 00164 #define AUDDevice_BITSPERSAMPLE (AUDDevice_BYTESPERSAMPLE * 8) 00165 /** Number of bytes in one USB subframe. */ 00166 #define AUDDevice_BYTESPERSUBFRAME (AUDDevice_NUMCHANNELS * \ 00167 AUDDevice_BYTESPERSAMPLE) 00168 /** Number of samples in one USB frame. */ 00169 #define AUDDevice_SAMPLESPERFRAME (AUDDevice_SAMPLERATE / 1000 \ 00170 * AUDDevice_NUMCHANNELS) 00171 /** Number of bytes in one USB frame. */ 00172 #define AUDDevice_BYTESPERFRAME (AUDDevice_SAMPLESPERFRAME * \ 00173 AUDDevice_BYTESPERSAMPLE) 00174 /** @}*/ 00175 00176 /*---------------------------------------------------------------------------- 00177 * USB Device - Audio - Desktop Speaker 00178 *----------------------------------------------------------------------------*/ 00179 00180 /** \addtogroup usbd_audio_speaker_config USB Speaker Configure 00181 * @{ 00182 * This page lists the definitions for USB Audio Speaker Device Driver. 00183 * - \ref AUDDSpeakerDriverDescriptors_DATAOUT 00184 * - \ref AUDDSpeakerDriverDescriptors_FS_INTERVAL 00185 * - \ref AUDDSpeakerDriverDescriptors_HS_INTERVAL 00186 * 00187 * \note for UDP, uses IN EPs that support double buffer; for UDPHS, uses 00188 * IN EPs that support DMA and High bandwidth. 00189 */ 00190 /** Data out endpoint number. */ 00191 #define AUDDSpeakerDriverDescriptors_DATAOUT 0x02 00192 /** Endpoint polling interval 2^(x-1) * 125us */ 00193 #define AUDDSpeakerDriverDescriptors_HS_INTERVAL 0x04 00194 /** Endpoint polling interval 2^(x-1) * ms */ 00195 #define AUDDSpeakerDriverDescriptors_FS_INTERVAL 0x01 00196 /** @}*/ 00197 00198 /*---------------------------------------------------------------------------- 00199 * USB Device - Audio - Speaker Phone 00200 *----------------------------------------------------------------------------*/ 00201 00202 /** \addtogroup usbd_audio_speakerphone_config USB Speaker Phone Configure 00203 * @{ 00204 * This page lists the definitions for USB Audio Speaker Phone Device Driver. 00205 * - \ref AUDDSpeakerPhoneDriverDescriptors_DATAOUT 00206 * - \ref AUDDSpeakerPhoneDriverDescriptors_DATAIN 00207 * - \ref AUDDSpeakerPhoneDriverDescriptors_HS_INTERVAL 00208 * - \ref AUDDSpeakerPhoneDriverDescriptors_FS_INTERVAL 00209 */ 00210 00211 00212 /** Data out endpoint number, size 192B */ 00213 #define AUDDSpeakerPhoneDriverDescriptors_DATAOUT 0x02 00214 /** Data in endpoint number, size 192B */ 00215 #define AUDDSpeakerPhoneDriverDescriptors_DATAIN 0x01 00216 00217 /** Endpoint polling interval 2^(x-1) * 125us */ 00218 #define AUDDSpeakerPhoneDriverDescriptors_HS_INTERVAL 0x04 00219 /** Endpoint polling interval 2^(x-1) * ms */ 00220 #define AUDDSpeakerPhoneDriverDescriptors_FS_INTERVAL 0x01 00221 /** @}*/ 00222 00223 /*---------------------------------------------------------------------------- 00224 * USB Device - HID - Keyboard 00225 *----------------------------------------------------------------------------*/ 00226 00227 /** \addtogroup usbd_hid_keyboard_config USB HID Keyboard Device Configure 00228 * @{ 00229 * This page lists the defines used by the HID Keyboard Device Driver. 00230 * 00231 * \section hidd_k_ep_addr Endpoint Addresses 00232 * - \ref HIDDKeyboardDriverDescriptors_INTERRUPTIN 00233 * - \ref HIDDKeyboardDriverDescriptors_INTERRUPTOUT 00234 * \section hidd_k_ep_polling Endpoint Polling Rate 00235 * - \ref HIDDKeyboardDriverDescriptors_INTERRUPTIN_POLLING 00236 * - \ref HIDDKeyboardDriverDescriptors_INTERRUPTOUT_POLLING 00237 */ 00238 /** Interrupt IN endpoint number */ 00239 #define HIDDKeyboardDriverDescriptors_INTERRUPTIN 2 00240 /** Interrupt IN endpoint polling rate (in milliseconds) */ 00241 #define HIDDKeyboardDriverDescriptors_INTERRUPTIN_POLLING 10 00242 /** Interrupt OUT endpoint number */ 00243 #define HIDDKeyboardDriverDescriptors_INTERRUPTOUT 3 00244 /** Interrupt OUT endpoint polling rate (in milliseconds) */ 00245 #define HIDDKeyboardDriverDescriptors_INTERRUPTOUT_POLLING 10 00246 /** @}*/ 00247 00248 /*---------------------------------------------------------------------------- 00249 * USB Device - HID - Mouse 00250 *----------------------------------------------------------------------------*/ 00251 00252 /** \addtogroup usbd_hid_mouse_config USB HID Mouse Device Configure 00253 * @{ 00254 * This page lists the defines used by the HID Mouse Device Driver. 00255 * 00256 * \section hidd_m_ep_addr Endpoint Addresses 00257 * - \ref HIDDMouseDriverDescriptors_INTERRUPTIN 00258 * \section hidd_m_ep_polling Endpoint Polling Rate 00259 * - \ref HIDDMouseDriverDescriptors_INTERRUPTIN_POLLING 00260 */ 00261 /** Interrupt IN endpoint number */ 00262 #define HIDDMouseDriverDescriptors_INTERRUPTIN 2 00263 /** Interrupt IN endpoint polling rate (in milliseconds) */ 00264 #define HIDDMouseDriverDescriptors_INTERRUPTIN_POLLING 8 00265 /** @}*/ 00266 00267 /*---------------------------------------------------------------------------- 00268 * USB Device - HID - Transfer (Customize device) 00269 *----------------------------------------------------------------------------*/ 00270 00271 /** \addtogroup usbd_hid_xfr_config USB HID Transfer Device Configure 00272 * @{ 00273 * This page lists the defines used by the HID Transfer Device Driver. 00274 * 00275 * \section hidd_t_ep_addr Endpoint Addresses 00276 * - \ref HIDDTransferDriverDescriptors_INTERRUPTIN 00277 * - \ref HIDDTransferDriverDescriptors_INTERRUPTOUT 00278 * \section hidd_t_ep_polling Endpoint Polling Rate 00279 * - \ref HIDDTransferDriverDescriptors_INTERRUPTIN_POLLING 00280 * - \ref HIDDTransferDriverDescriptors_INTERRUPTOUT_POLLING 00281 */ 00282 /** Interrupt IN endpoint number. */ 00283 #define HIDDTransferDriverDescriptors_INTERRUPTIN 2 00284 /** Polling rate in ms */ 00285 #define HIDDTransferDriverDescriptors_INTERRUPTIN_POLLING 50 00286 /** Interrupt IN endpoint polling rate (in milliseconds). */ 00287 #define HIDDTransferDriverDescriptors_INTERRUPTOUT 3 00288 /** Polling rate in ms */ 00289 #define HIDDTransferDriverDescriptors_INTERRUPTOUT_POLLING 50 00290 /** @}*/ 00291 00292 /*---------------------------------------------------------------------------- 00293 * USB Device - Composite 00294 *----------------------------------------------------------------------------*/ 00295 00296 /** \addtogroup usbd_composite_config USB Composite Device Configure 00297 * @{ 00298 */ 00299 00300 /*---------------------------------------------------------------------------- 00301 * USB Device - HID_AUD 00302 *----------------------------------------------------------------------------*/ 00303 00304 /** Address of the HID interrupt IN endpoint. */ 00305 #define HIDAUDD_Descriptors_INTERRUPTIN 0x03 00306 /** Address of the HID interrupt OUT endpoint. */ 00307 #define HIDAUDD_Descriptors_INTERRUPTOUT 0x04 00308 00309 /** Audio data out endpoint number */ 00310 #define HIDAUDD_Descriptors_ISO_DATAOUT 0x02 00311 00312 00313 /*---------------------------------------------------------------------------- 00314 * USB Device - CDC AUD 00315 *----------------------------------------------------------------------------*/ 00316 00317 /** Address of the CDC interrupt-in endpoint. */ 00318 #define CDCAUDD_Descriptors_NOTIFICATION0 0x04 00319 /** Address of the CDC bulk-in endpoint. */ 00320 #define CDCAUDD_Descriptors_DATAIN0 0x03 00321 /** Address of the CDC bulk-out endpoint. */ 00322 #define CDCAUDD_Descriptors_DATAOUT0 0x02 00323 /** Address of the Audio ISO-out endpoint. */ 00324 #define CDCAUDD_Descriptors_ISO_DATAOUT 0x01 00325 00326 00327 /*---------------------------------------------------------------------------- 00328 * USB Device - DUAL CDC 00329 *----------------------------------------------------------------------------*/ 00330 00331 /// Address of the CDC0 interrupt-in endpoint. 00332 #define CDCD_Descriptors_NOTIFICATION0 3 00333 /// Address of the CDC0 bulk-in endpoint. 00334 #define CDCD_Descriptors_DATAIN0 2 00335 /// Address of the CDC0 bulk-out endpoint. 00336 #define CDCD_Descriptors_DATAOUT0 1 00337 00338 /// Address of the CDC1 interrupt-in endpoint. 00339 #define CDCD_Descriptors_NOTIFICATION1 6 00340 /// Address of the CDC1 bulk-in endpoint. 00341 #define CDCD_Descriptors_DATAIN1 5 00342 /// Address of the CDC1 bulk-out endpoint. 00343 #define CDCD_Descriptors_DATAOUT1 4 00344 00345 00346 /*---------------------------------------------------------------------------- 00347 * USB Device - HID CDC 00348 *----------------------------------------------------------------------------*/ 00349 00350 00351 /** Address of the CDC interrupt-in endpoint. */ 00352 #define CDCD_Descriptors_NOTIFICATION0 3 00353 /** Address of the CDC bulk-in endpoint. */ 00354 #define CDCD_Descriptors_DATAIN0 2 00355 /** Address of the CDC bulk-out endpoint. */ 00356 #define CDCD_Descriptors_DATAOUT0 1 00357 00358 /** Address of the HID interrupt IN endpoint. */ 00359 #define HIDD_Descriptors_INTERRUPTIN 4 00360 /** Address of the HID interrupt OUT endpoint. */ 00361 #define HIDD_Descriptors_INTERRUPTOUT 5 00362 00363 00364 00365 /*---------------------------------------------------------------------------- 00366 * USB Device - HID MSD 00367 *----------------------------------------------------------------------------*/ 00368 00369 /** Address of the Mass Storage bulk-out endpoint. */ 00370 #define HIDMSDD_Descriptors_BULKOUT 2 00371 /** Address of the Mass Storage bulk-in endpoint. */ 00372 #define HIDMSDD_Descriptors_BULKIN 3 00373 00374 /** Address of the HID interrupt IN endpoint. */ 00375 #define HIDMSDD_Descriptors_INTERRUPTIN 4 00376 /** Address of the HID interrupt OUT endpoint. */ 00377 #define HIDMSDD_Descriptors_INTERRUPTOUT 5 00378 00379 /*---------------------------------------------------------------------------- 00380 * USB Device - MSD CDC 00381 *----------------------------------------------------------------------------*/ 00382 00383 /** Address of the CDC interrupt-in endpoint. */ 00384 #define CDCD_Descriptors_NOTIFICATION0 3 00385 /** Address of the CDC bulk-in endpoint. */ 00386 #define CDCD_Descriptors_DATAIN0 2 00387 /** Address of the CDC bulk-out endpoint. */ 00388 #define CDCD_Descriptors_DATAOUT0 1 00389 /** Address of the Mass Storage bulk-out endpoint. */ 00390 #define MSDD_Descriptors_BULKOUT 4 00391 /** Address of the Mass Storage bulk-in endpoint. */ 00392 #define MSDD_Descriptors_BULKIN 5 00393 00394 /** @}*/ 00395 00396 /**@}*/ 00397 #endif //#ifndef USBD_CONFIG_H 00398 00399