USBMSD SD card Hello World for Mbed platforms

Dependencies:   mbed USBMSD_SD USBDevice

Committer:
samux
Date:
Tue Dec 06 12:07:12 2011 +0000
Revision:
14:757226626acb
protection enabled when usb cable plugged. filesystem has no access when plugged

Who changed what in which revision?

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