Sensor reporting over USB CDC

Dependencies:   MAG3110 MMA8451Q SLCD- TSI USBDevice mbed

Committer:
wue
Date:
Wed Apr 16 12:20:12 2014 +0000
Revision:
0:7b58cdacf811
Sensor reporting over USB CDC

Who changed what in which revision?

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