USBDevice
Dependents: QEI_X1_LCD_test3 macnica_test
USBAudio/USBAudio_Types.h@0:2d8d0b73e1ff, 2013-04-18 (annotated)
- Committer:
- toucyy
- Date:
- Thu Apr 18 07:49:37 2013 +0000
- Revision:
- 0:2d8d0b73e1ff
[mbed] converted /QEI_HelloWorld/USBDevice
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
toucyy | 0:2d8d0b73e1ff | 1 | /* Copyright (c) 2010-2011 mbed.org, MIT License |
toucyy | 0:2d8d0b73e1ff | 2 | * |
toucyy | 0:2d8d0b73e1ff | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
toucyy | 0:2d8d0b73e1ff | 4 | * and associated documentation files (the "Software"), to deal in the Software without |
toucyy | 0:2d8d0b73e1ff | 5 | * restriction, including without limitation the rights to use, copy, modify, merge, publish, |
toucyy | 0:2d8d0b73e1ff | 6 | * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the |
toucyy | 0:2d8d0b73e1ff | 7 | * Software is furnished to do so, subject to the following conditions: |
toucyy | 0:2d8d0b73e1ff | 8 | * |
toucyy | 0:2d8d0b73e1ff | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
toucyy | 0:2d8d0b73e1ff | 10 | * substantial portions of the Software. |
toucyy | 0:2d8d0b73e1ff | 11 | * |
toucyy | 0:2d8d0b73e1ff | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
toucyy | 0:2d8d0b73e1ff | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
toucyy | 0:2d8d0b73e1ff | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
toucyy | 0:2d8d0b73e1ff | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
toucyy | 0:2d8d0b73e1ff | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
toucyy | 0:2d8d0b73e1ff | 17 | */ |
toucyy | 0:2d8d0b73e1ff | 18 | |
toucyy | 0:2d8d0b73e1ff | 19 | #ifndef USBAUDIO_TYPES_H |
toucyy | 0:2d8d0b73e1ff | 20 | #define USBAUDIO_TYPES_H |
toucyy | 0:2d8d0b73e1ff | 21 | |
toucyy | 0:2d8d0b73e1ff | 22 | |
toucyy | 0:2d8d0b73e1ff | 23 | #define DEFAULT_CONFIGURATION (1) |
toucyy | 0:2d8d0b73e1ff | 24 | |
toucyy | 0:2d8d0b73e1ff | 25 | // Audio Request Codes |
toucyy | 0:2d8d0b73e1ff | 26 | #define REQUEST_SET_CUR 0x01 |
toucyy | 0:2d8d0b73e1ff | 27 | #define REQUEST_GET_CUR 0x81 |
toucyy | 0:2d8d0b73e1ff | 28 | #define REQUEST_SET_MIN 0x02 |
toucyy | 0:2d8d0b73e1ff | 29 | #define REQUEST_GET_MIN 0x82 |
toucyy | 0:2d8d0b73e1ff | 30 | #define REQUEST_SET_MAX 0x03 |
toucyy | 0:2d8d0b73e1ff | 31 | #define REQUEST_GET_MAX 0x83 |
toucyy | 0:2d8d0b73e1ff | 32 | #define REQUEST_SET_RES 0x04 |
toucyy | 0:2d8d0b73e1ff | 33 | #define REQUEST_GET_RES 0x84 |
toucyy | 0:2d8d0b73e1ff | 34 | |
toucyy | 0:2d8d0b73e1ff | 35 | #define MUTE_CONTROL 0x01 |
toucyy | 0:2d8d0b73e1ff | 36 | #define VOLUME_CONTROL 0x02 |
toucyy | 0:2d8d0b73e1ff | 37 | |
toucyy | 0:2d8d0b73e1ff | 38 | |
toucyy | 0:2d8d0b73e1ff | 39 | // Audio Descriptor Sizes |
toucyy | 0:2d8d0b73e1ff | 40 | #define CONTROL_INTERFACE_DESCRIPTOR_LENGTH 0x09 |
toucyy | 0:2d8d0b73e1ff | 41 | #define STREAMING_INTERFACE_DESCRIPTOR_LENGTH 0x07 |
toucyy | 0:2d8d0b73e1ff | 42 | #define INPUT_TERMINAL_DESCRIPTOR_LENGTH 0x0C |
toucyy | 0:2d8d0b73e1ff | 43 | #define OUTPUT_TERMINAL_DESCRIPTOR_LENGTH 0x09 |
toucyy | 0:2d8d0b73e1ff | 44 | #define FEATURE_UNIT_DESCRIPTOR_LENGTH 0x09 |
toucyy | 0:2d8d0b73e1ff | 45 | #define STREAMING_ENDPOINT_DESCRIPTOR_LENGTH 0x07 |
toucyy | 0:2d8d0b73e1ff | 46 | |
toucyy | 0:2d8d0b73e1ff | 47 | // Audio Format Type Descriptor Sizes |
toucyy | 0:2d8d0b73e1ff | 48 | #define FORMAT_TYPE_I_DESCRIPTOR_LENGTH 0x0b |
toucyy | 0:2d8d0b73e1ff | 49 | |
toucyy | 0:2d8d0b73e1ff | 50 | #define AUDIO_CLASS 0x01 |
toucyy | 0:2d8d0b73e1ff | 51 | #define SUBCLASS_AUDIOCONTROL 0x01 |
toucyy | 0:2d8d0b73e1ff | 52 | #define SUBCLASS_AUDIOSTREAMING 0x02 |
toucyy | 0:2d8d0b73e1ff | 53 | |
toucyy | 0:2d8d0b73e1ff | 54 | // Audio Descriptor Types |
toucyy | 0:2d8d0b73e1ff | 55 | #define INTERFACE_DESCRIPTOR_TYPE 0x24 |
toucyy | 0:2d8d0b73e1ff | 56 | #define ENDPOINT_DESCRIPTOR_TYPE 0x25 |
toucyy | 0:2d8d0b73e1ff | 57 | |
toucyy | 0:2d8d0b73e1ff | 58 | // Audio Control Interface Descriptor Subtypes |
toucyy | 0:2d8d0b73e1ff | 59 | #define CONTROL_HEADER 0x01 |
toucyy | 0:2d8d0b73e1ff | 60 | #define CONTROL_INPUT_TERMINAL 0x02 |
toucyy | 0:2d8d0b73e1ff | 61 | #define CONTROL_OUTPUT_TERMINAL 0x03 |
toucyy | 0:2d8d0b73e1ff | 62 | #define CONTROL_FEATURE_UNIT 0x06 |
toucyy | 0:2d8d0b73e1ff | 63 | |
toucyy | 0:2d8d0b73e1ff | 64 | // USB Terminal Types |
toucyy | 0:2d8d0b73e1ff | 65 | #define TERMINAL_USB_STREAMING 0x0101 |
toucyy | 0:2d8d0b73e1ff | 66 | |
toucyy | 0:2d8d0b73e1ff | 67 | // Predefined Audio Channel Configuration Bits |
toucyy | 0:2d8d0b73e1ff | 68 | // Mono |
toucyy | 0:2d8d0b73e1ff | 69 | #define CHANNEL_M 0x0000 |
toucyy | 0:2d8d0b73e1ff | 70 | #define CHANNEL_L 0x0001 /* Left Front */ |
toucyy | 0:2d8d0b73e1ff | 71 | #define CHANNEL_R 0x0002 /* Right Front */ |
toucyy | 0:2d8d0b73e1ff | 72 | |
toucyy | 0:2d8d0b73e1ff | 73 | // Feature Unit Control Bits |
toucyy | 0:2d8d0b73e1ff | 74 | #define CONTROL_MUTE 0x0001 |
toucyy | 0:2d8d0b73e1ff | 75 | #define CONTROL_VOLUME 0x0002 |
toucyy | 0:2d8d0b73e1ff | 76 | |
toucyy | 0:2d8d0b73e1ff | 77 | // Output Terminal Types |
toucyy | 0:2d8d0b73e1ff | 78 | #define TERMINAL_SPEAKER 0x0301 |
toucyy | 0:2d8d0b73e1ff | 79 | #define TERMINAL_HEADPHONES 0x0302 |
toucyy | 0:2d8d0b73e1ff | 80 | |
toucyy | 0:2d8d0b73e1ff | 81 | // Audio Streaming Interface Descriptor Subtypes |
toucyy | 0:2d8d0b73e1ff | 82 | #define STREAMING_GENERAL 0x01 |
toucyy | 0:2d8d0b73e1ff | 83 | #define STREAMING_FORMAT_TYPE 0x02 |
toucyy | 0:2d8d0b73e1ff | 84 | |
toucyy | 0:2d8d0b73e1ff | 85 | // Audio Data Format Type I Codes |
toucyy | 0:2d8d0b73e1ff | 86 | #define FORMAT_PCM 0x0001 |
toucyy | 0:2d8d0b73e1ff | 87 | |
toucyy | 0:2d8d0b73e1ff | 88 | // Audio Format Types |
toucyy | 0:2d8d0b73e1ff | 89 | #define FORMAT_TYPE_I 0x01 |
toucyy | 0:2d8d0b73e1ff | 90 | |
toucyy | 0:2d8d0b73e1ff | 91 | // Audio Endpoint Descriptor Subtypes |
toucyy | 0:2d8d0b73e1ff | 92 | #define ENDPOINT_GENERAL 0x01 |
toucyy | 0:2d8d0b73e1ff | 93 | |
toucyy | 0:2d8d0b73e1ff | 94 | #endif |