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