Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

USBAudio_Types.h 3.4KB

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