Christina Quast | 53b2105 | 2014-12-09 15:34:35 +0100 | [diff] [blame] | 1 | /* ---------------------------------------------------------------------------- |
| 2 | * ATMEL Microcontroller Software Support |
| 3 | * ---------------------------------------------------------------------------- |
| 4 | * Copyright (c) 2008, Atmel Corporation |
| 5 | * |
| 6 | * All rights reserved. |
| 7 | * |
| 8 | * Redistribution and use in source and binary forms, with or without |
| 9 | * modification, are permitted provided that the following conditions are met: |
| 10 | * |
| 11 | * - Redistributions of source code must retain the above copyright notice, |
| 12 | * this list of conditions and the disclaimer below. |
| 13 | * |
| 14 | * Atmel's name may not be used to endorse or promote products derived from |
| 15 | * this software without specific prior written permission. |
| 16 | * |
| 17 | * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR |
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE |
| 20 | * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, |
| 23 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
| 26 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | * ---------------------------------------------------------------------------- |
| 28 | */ |
| 29 | |
| 30 | /** |
| 31 | * \file |
| 32 | * |
| 33 | * USB Device Framework configurations. |
| 34 | * |
| 35 | */ |
| 36 | |
| 37 | #ifndef USBD_CONFIG_H |
| 38 | #define USBD_CONFIG_H |
| 39 | |
| 40 | /*---------------------------------------------------------------------------- |
| 41 | * Headers |
| 42 | *----------------------------------------------------------------------------*/ |
| 43 | |
| 44 | /** \addtogroup usbd_config |
| 45 | *@{ |
| 46 | */ |
| 47 | /*---------------------------------------------------------------------------- |
| 48 | * Constants |
| 49 | *----------------------------------------------------------------------------*/ |
| 50 | |
| 51 | /** \addtogroup usbd_ids USBD Device IDs |
| 52 | * @{ |
| 53 | */ |
| 54 | #define USBD_VID_ATMEL 0x03EB /**< Vendor ID: Atmel */ |
| 55 | |
| 56 | #define USBD_PID_ENUM 0x0001 /**< Product ID: Enum (Core) */ |
| 57 | #define USBD_PID_CDCDSERIAL 0x6119 /**< Product ID: CDC Serial */ |
| 58 | #define USBD_PID_HIDKEYBOARD 0x6127 /**< Product ID: HID Keyboard */ |
| 59 | #define USBD_PID_AUDIO 0x6128 /**< Product ID: Audio devices */ |
| 60 | #define USBD_PID_MSD 0x6129 /**< Product ID: Massstorage */ |
| 61 | #define USBD_PID_CDCHID 0x6130 /**< Product ID: composite */ |
| 62 | #define USBD_PID_CDCAUDIO 0x6131 /**< Product ID: composite */ |
| 63 | #define USBD_PID_CDCMSD 0x6132 /**< Product ID: composite */ |
| 64 | #define USBD_PID_CDCCDC 0x6133 /**< Product ID: composite */ |
| 65 | #define USBD_PID_HIDAUDIO 0x6134 /**< Product ID: composite */ |
| 66 | #define USBD_PID_HIDMSD 0x6135 /**< Product ID: composite */ |
| 67 | #define USBD_PID_HIDMOUSE 0x6200 /**< Product ID: HID Mouse */ |
| 68 | #define USBD_PID_HIDTRANSFER 0x6201 /**< Product ID: HID Transfer */ |
| 69 | #define USBD_PID_CCID 0x6203 /**< Product ID: CCID */ |
| 70 | |
| 71 | #define USBD_RELEASE_1_00 0x0100 /**< Release: 1.00 */ |
| 72 | /** @}*/ |
| 73 | |
| 74 | /** \addtogroup usbd_general_config USBD General Configure |
| 75 | * @{ |
| 76 | * This page lists general configurations for all USB device drivers. |
| 77 | * - \ref USBD_BMATTRIBUTES |
| 78 | */ |
| 79 | /** default USB Device attributes configuration descriptor |
| 80 | * (bus or self powered, remote wakeup) */ |
| 81 | #define USBD_BMATTRIBUTES BOARD_USB_BMATTRIBUTES |
| 82 | /** @}*/ |
| 83 | |
| 84 | /*---------------------------------------------------------------------------- |
| 85 | * USB Device - Mass storage |
| 86 | *----------------------------------------------------------------------------*/ |
| 87 | |
| 88 | /** \addtogroup usbd_msdd_config USB MassStorage Configure |
| 89 | * @{ |
| 90 | * This page lists the defines used by the Mass Storage driver. |
| 91 | * |
| 92 | * \section msd_ep_addr Endpoint Addresses |
| 93 | * - \ref MSDDriverDescriptors_BULKOUT |
| 94 | * - \ref MSDDriverDescriptors_BULKIN |
| 95 | */ |
| 96 | /** Address of the Mass Storage bulk-out endpoint.*/ |
| 97 | #define MSDDriverDescriptors_BULKOUT 1 |
| 98 | /** Address of the Mass Storage bulk-in endpoint.*/ |
| 99 | #define MSDDriverDescriptors_BULKIN 2 |
| 100 | /** @}*/ |
| 101 | |
| 102 | /*---------------------------------------------------------------------------- |
| 103 | * USB Device - CDC Serial |
| 104 | *----------------------------------------------------------------------------*/ |
| 105 | |
| 106 | /** \addtogroup usbd_cdc_serial_config USB CDC Serial Configure |
| 107 | * @{ |
| 108 | * This page lists the defines used by the CDC Serial Device Driver. |
| 109 | * |
| 110 | * \section cdcd_ep_addr Endpoint Addresses |
| 111 | * - \ref CDCDSerialDriverDescriptors_DATAOUT |
| 112 | * - \ref CDCDSerialDriverDescriptors_DATAIN |
| 113 | * - \ref CDCDSerialDriverDescriptors_NOTIFICATION |
| 114 | */ |
| 115 | /** Data OUT endpoint number */ |
| 116 | #define CDCDSerialDriverDescriptors_DATAOUT 1 |
| 117 | /** Data IN endpoint number */ |
| 118 | #define CDCDSerialDriverDescriptors_DATAIN 2 |
| 119 | /** Notification endpoint number */ |
| 120 | #define CDCDSerialDriverDescriptors_NOTIFICATION 3 |
| 121 | /** @}*/ |
| 122 | |
| 123 | /*---------------------------------------------------------------------------- |
| 124 | * USB Device - Audio |
| 125 | *----------------------------------------------------------------------------*/ |
| 126 | |
| 127 | /** \addtogroup usbd_audio_config USB Audio General Configure |
| 128 | * @{ |
| 129 | * This page lists definitions for USB Audio Devices Drivers. |
| 130 | * - \ref |
| 131 | */ |
| 132 | #if defined(at91sam7s) || defined(at91sam9xe) |
| 133 | /** Sample rate in Hz. */ |
| 134 | #define AUDDevice_SAMPLERATE 32000UL |
| 135 | /** Number of channels in audio stream. */ |
| 136 | #define AUDDevice_NUMCHANNELS 1 |
| 137 | /** Number of bytes in one sample. */ |
| 138 | #define AUDDevice_BYTESPERSAMPLE 2 |
| 139 | #else |
| 140 | /** Sample rate in Hz. */ |
| 141 | #define AUDDevice_SAMPLERATE 48000UL |
| 142 | /** Number of channels in audio stream. */ |
| 143 | #define AUDDevice_NUMCHANNELS 2 |
| 144 | /** Number of bytes in one sample. */ |
| 145 | #define AUDDevice_BYTESPERSAMPLE 2 |
| 146 | #endif |
| 147 | /** Number of bits in one sample. */ |
| 148 | #define AUDDevice_BITSPERSAMPLE (AUDDevice_BYTESPERSAMPLE * 8) |
| 149 | /** Number of bytes in one USB subframe. */ |
| 150 | #define AUDDevice_BYTESPERSUBFRAME (AUDDevice_NUMCHANNELS * \ |
| 151 | AUDDevice_BYTESPERSAMPLE) |
| 152 | /** Number of samples in one USB frame. */ |
| 153 | #define AUDDevice_SAMPLESPERFRAME (AUDDevice_SAMPLERATE / 1000 \ |
| 154 | * AUDDevice_NUMCHANNELS) |
| 155 | /** Number of bytes in one USB frame. */ |
| 156 | #define AUDDevice_BYTESPERFRAME (AUDDevice_SAMPLESPERFRAME * \ |
| 157 | AUDDevice_BYTESPERSAMPLE) |
| 158 | /** @}*/ |
| 159 | |
| 160 | /*---------------------------------------------------------------------------- |
| 161 | * USB Device - Audio - Desktop Speaker |
| 162 | *----------------------------------------------------------------------------*/ |
| 163 | |
| 164 | /** \addtogroup usbd_audio_speaker_config USB Speaker Configure |
| 165 | * @{ |
| 166 | * This page lists the definitions for USB Audio Speaker Device Driver. |
| 167 | * - \ref AUDDSpeakerDriverDescriptors_DATAOUT |
| 168 | * - \ref AUDDSpeakerDriverDescriptors_FS_INTERVAL |
| 169 | * - \ref AUDDSpeakerDriverDescriptors_HS_INTERVAL |
| 170 | * |
| 171 | * \note for UDP, uses IN EPs that support double buffer; for UDPHS, uses |
| 172 | * IN EPs that support DMA and High bandwidth. |
| 173 | */ |
| 174 | /** Data out endpoint number. */ |
| 175 | #define AUDDSpeakerDriverDescriptors_DATAOUT 0x04 |
| 176 | /** Endpoint polling interval 2^(x-1) * 125us */ |
| 177 | #define AUDDSpeakerDriverDescriptors_HS_INTERVAL 0x04 |
| 178 | /** Endpoint polling interval 2^(x-1) * ms */ |
| 179 | #define AUDDSpeakerDriverDescriptors_FS_INTERVAL 0x01 |
| 180 | /** @}*/ |
| 181 | |
| 182 | /*---------------------------------------------------------------------------- |
| 183 | * USB Device - Audio - Speaker Phone |
| 184 | *----------------------------------------------------------------------------*/ |
| 185 | |
| 186 | /** \addtogroup usbd_audio_speakerphone_config USB Speaker Phone Configure |
| 187 | * @{ |
| 188 | * This page lists the definitions for USB Audio Speaker Phone Device Driver. |
| 189 | * - \ref AUDDSpeakerPhoneDriverDescriptors_DATAOUT |
| 190 | * - \ref AUDDSpeakerPhoneDriverDescriptors_DATAIN |
| 191 | * - \ref AUDDSpeakerPhoneDriverDescriptors_HS_INTERVAL |
| 192 | * - \ref AUDDSpeakerPhoneDriverDescriptors_FS_INTERVAL |
| 193 | */ |
| 194 | |
| 195 | #if defined(at91sam7s) || defined(at91sam9xe) |
| 196 | /** Data out endpoint number, size 64B */ |
| 197 | #define AUDDSpeakerPhoneDriverDescriptors_DATAOUT 0x01 |
| 198 | /** Data in endpoint number, size 64B */ |
| 199 | #define AUDDSpeakerPhoneDriverDescriptors_DATAIN 0x02 |
| 200 | #elif defined(CHIP_USB_UDP) |
| 201 | /** Data out endpoint number, size 192B */ |
| 202 | #define AUDDSpeakerPhoneDriverDescriptors_DATAOUT 0x04 |
| 203 | /** Data in endpoint number, size 192B */ |
| 204 | #define AUDDSpeakerPhoneDriverDescriptors_DATAIN 0x05 |
| 205 | #elif defined(at91sam9m10ek) |
| 206 | /** Data out endpoint number, size 192B */ |
| 207 | #define AUDDSpeakerPhoneDriverDescriptors_DATAOUT 0x01 |
| 208 | /** Data in endpoint number, size 192B */ |
| 209 | #define AUDDSpeakerPhoneDriverDescriptors_DATAIN 0x06 |
| 210 | #else |
| 211 | /** Data out endpoint number, size 192B */ |
| 212 | #define AUDDSpeakerPhoneDriverDescriptors_DATAOUT 0x05 |
| 213 | /** Data in endpoint number, size 192B */ |
| 214 | #define AUDDSpeakerPhoneDriverDescriptors_DATAIN 0x06 |
| 215 | #endif |
| 216 | /** Endpoint polling interval 2^(x-1) * 125us */ |
| 217 | #define AUDDSpeakerPhoneDriverDescriptors_HS_INTERVAL 0x04 |
| 218 | /** Endpoint polling interval 2^(x-1) * ms */ |
| 219 | #define AUDDSpeakerPhoneDriverDescriptors_FS_INTERVAL 0x01 |
| 220 | /** @}*/ |
| 221 | |
| 222 | /*---------------------------------------------------------------------------- |
| 223 | * USB Device - HID - Keyboard |
| 224 | *----------------------------------------------------------------------------*/ |
| 225 | |
| 226 | /** \addtogroup usbd_hid_keyboard_config USB HID Keyboard Device Configure |
| 227 | * @{ |
| 228 | * This page lists the defines used by the HID Keyboard Device Driver. |
| 229 | * |
| 230 | * \section hidd_k_ep_addr Endpoint Addresses |
| 231 | * - \ref HIDDKeyboardDriverDescriptors_INTERRUPTIN |
| 232 | * - \ref HIDDKeyboardDriverDescriptors_INTERRUPTOUT |
| 233 | * \section hidd_k_ep_polling Endpoint Polling Rate |
| 234 | * - \ref HIDDKeyboardDriverDescriptors_INTERRUPTIN_POLLING |
| 235 | * - \ref HIDDKeyboardDriverDescriptors_INTERRUPTOUT_POLLING |
| 236 | */ |
| 237 | /** Interrupt IN endpoint number */ |
| 238 | #define HIDDKeyboardDriverDescriptors_INTERRUPTIN 1 |
| 239 | /** Interrupt IN endpoint polling rate (in milliseconds) */ |
| 240 | #define HIDDKeyboardDriverDescriptors_INTERRUPTIN_POLLING 10 |
| 241 | /** Interrupt OUT endpoint number */ |
| 242 | #define HIDDKeyboardDriverDescriptors_INTERRUPTOUT 2 |
| 243 | /** Interrupt OUT endpoint polling rate (in milliseconds) */ |
| 244 | #define HIDDKeyboardDriverDescriptors_INTERRUPTOUT_POLLING 10 |
| 245 | /** @}*/ |
| 246 | |
| 247 | /*---------------------------------------------------------------------------- |
| 248 | * USB Device - HID - Mouse |
| 249 | *----------------------------------------------------------------------------*/ |
| 250 | |
| 251 | /** \addtogroup usbd_hid_mouse_config USB HID Mouse Device Configure |
| 252 | * @{ |
| 253 | * This page lists the defines used by the HID Mouse Device Driver. |
| 254 | * |
| 255 | * \section hidd_m_ep_addr Endpoint Addresses |
| 256 | * - \ref HIDDMouseDriverDescriptors_INTERRUPTIN |
| 257 | * \section hidd_m_ep_polling Endpoint Polling Rate |
| 258 | * - \ref HIDDMouseDriverDescriptors_INTERRUPTIN_POLLING |
| 259 | */ |
| 260 | /** Interrupt IN endpoint number */ |
| 261 | #define HIDDMouseDriverDescriptors_INTERRUPTIN 1 |
| 262 | /** Interrupt IN endpoint polling rate (in milliseconds) */ |
| 263 | #define HIDDMouseDriverDescriptors_INTERRUPTIN_POLLING 10 |
| 264 | /** @}*/ |
| 265 | |
| 266 | /*---------------------------------------------------------------------------- |
| 267 | * USB Device - HID - Transfer (Customize device) |
| 268 | *----------------------------------------------------------------------------*/ |
| 269 | |
| 270 | /** \addtogroup usbd_hid_xfr_config USB HID Transfer Device Configure |
| 271 | * @{ |
| 272 | * This page lists the defines used by the HID Transfer Device Driver. |
| 273 | * |
| 274 | * \section hidd_t_ep_addr Endpoint Addresses |
| 275 | * - \ref HIDDTransferDriverDescriptors_INTERRUPTIN |
| 276 | * - \ref HIDDTransferDriverDescriptors_INTERRUPTOUT |
| 277 | * \section hidd_t_ep_polling Endpoint Polling Rate |
| 278 | * - \ref HIDDTransferDriverDescriptors_INTERRUPTIN_POLLING |
| 279 | * - \ref HIDDTransferDriverDescriptors_INTERRUPTOUT_POLLING |
| 280 | */ |
| 281 | /** Interrupt IN endpoint number. */ |
| 282 | #define HIDDTransferDriverDescriptors_INTERRUPTIN 1 |
| 283 | /** Polling rate in ms */ |
| 284 | #define HIDDTransferDriverDescriptors_INTERRUPTIN_POLLING 50 |
| 285 | /** Interrupt IN endpoint polling rate (in milliseconds). */ |
| 286 | #define HIDDTransferDriverDescriptors_INTERRUPTOUT 2 |
| 287 | /** Polling rate in ms */ |
| 288 | #define HIDDTransferDriverDescriptors_INTERRUPTOUT_POLLING 50 |
| 289 | /** @}*/ |
| 290 | |
| 291 | /*---------------------------------------------------------------------------- |
| 292 | * USB Device - Composite |
| 293 | *----------------------------------------------------------------------------*/ |
| 294 | |
| 295 | /** \addtogroup usbd_composite_config USB Composite Device Configure |
| 296 | * @{ |
| 297 | */ |
| 298 | /** @}*/ |
| 299 | |
| 300 | /**@}*/ |
| 301 | #endif //#ifndef USBD_CONFIG_H |
| 302 | |
| 303 | |