USBDevice stack

Dependents:   erg USBSerial_HelloWorld Slingshot SuperScanner ... more

Committer:
samux
Date:
Wed May 30 18:28:11 2012 +0000
Revision:
0:140cdf8e2d60

        

Who changed what in which revision?

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