diff options
author | Dean Camera <[email protected]> | 2011-05-29 12:41:14 +0000 |
---|---|---|
committer | Dean Camera <[email protected]> | 2011-05-29 12:41:14 +0000 |
commit | ea922c98d187eb74c31535afa3334ead5bd50526 (patch) | |
tree | 0add2892e10e4686e555ddf1d98c9110ebb4ba9f /LUFA | |
parent | cc9b190919abbc567cd179b31afeef565efb1f17 (diff) | |
download | qmk_firmware-ea922c98d187eb74c31535afa3334ead5bd50526.tar.gz qmk_firmware-ea922c98d187eb74c31535afa3334ead5bd50526.zip |
Added new incomplete AudioInputHost Host LowLevel demo.
Added missing Audio class control request definitions.
Added support for the Audio class GET STATUS request so that it is correctly ACKed when sent by the host.
Diffstat (limited to 'LUFA')
-rw-r--r-- | LUFA/Drivers/USB/Class/Common/Audio.h | 20 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Class/Device/Audio.c | 7 | ||||
-rw-r--r-- | LUFA/ManPages/ChangeLog.txt | 6 | ||||
-rw-r--r-- | LUFA/ManPages/FutureChanges.txt | 9 |
4 files changed, 33 insertions, 9 deletions
diff --git a/LUFA/Drivers/USB/Class/Common/Audio.h b/LUFA/Drivers/USB/Class/Common/Audio.h index c838411f06..713c96f7c7 100644 --- a/LUFA/Drivers/USB/Class/Common/Audio.h +++ b/LUFA/Drivers/USB/Class/Common/Audio.h @@ -204,7 +204,7 @@ * * \param[in] freq Required audio sampling frequency in HZ */ - #define AUDIO_SAMPLE_FREQ(freq) {.Byte1 = (freq & 0x0000FF), .Byte2 = ((freq >> 8) & 0xFF), .Byte3 = ((freq >> 16) & 0xFF)} + #define AUDIO_SAMPLE_FREQ(freq) {.Byte1 = ((uint32_t)freq & 0x0000FF), .Byte2 = (((uint32_t)freq >> 8) & 0xFF), .Byte3 = (((uint32_t)freq >> 16) & 0xFF)} /** Mask for the attributes parameter of an Audio class-specific Endpoint descriptor, indicating that the endpoint * accepts only filled endpoint packets of audio samples. @@ -215,7 +215,7 @@ * will accept partially filled endpoint packets of audio samples. */ #define AUDIO_EP_ACCEPTS_SMALL_PACKETS (0 << 7) - + /* Enums: */ /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Audio * device class. @@ -269,6 +269,22 @@ AUDIO_DSUBTYPE_CSEndpoint_General = 0x01, /**< Audio class specific endpoint general descriptor. */ }; + /** Enum for the Audio class specific control requests that can be issued by the USB bus host. */ + enum Audio_ClassRequests_t + { + AUDIO_REQ_SetCurrent = 0x01, /**< Audio class-specific request to set the current value of a parameter within the device. */ + AUDIO_REQ_SetMinimum = 0x02, /**< Audio class-specific request to set the minimum value of a parameter within the device. */ + AUDIO_REQ_SetMaximum = 0x03, /**< Audio class-specific request to set the maximum value of a parameter within the device. */ + AUDIO_REQ_SetResolution = 0x04, /**< Audio class-specific request to set the resolution value of a parameter within the device. */ + AUDIO_REQ_SetMemory = 0x05, /**< Audio class-specific request to set the memory value of a parameter within the device. */ + AUDIO_REQ_GetCurrent = 0x81, /**< Audio class-specific request to get the current value of a parameter within the device. */ + AUDIO_REQ_GetMinimum = 0x82, /**< Audio class-specific request to get the minimum value of a parameter within the device. */ + AUDIO_REQ_GetMaximum = 0x83, /**< Audio class-specific request to get the maximum value of a parameter within the device. */ + AUDIO_REQ_GetResolution = 0x84, /**< Audio class-specific request to get the resolution value of a parameter within the device. */ + AUDIO_REQ_GetMemory = 0x85, /**< Audio class-specific request to get the memory value of a parameter within the device. */ + AUDIO_REQ_GetStatus = 0xFF, /**< Audio class-specific request to get the device status. */ + }; + /* Type Defines: */ /** \brief Audio class-specific Input Terminal Descriptor (LUFA naming conventions). * diff --git a/LUFA/Drivers/USB/Class/Device/Audio.c b/LUFA/Drivers/USB/Class/Device/Audio.c index f18db74560..8c5c9960d5 100644 --- a/LUFA/Drivers/USB/Class/Device/Audio.c +++ b/LUFA/Drivers/USB/Class/Device/Audio.c @@ -57,6 +57,13 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi } break; + case AUDIO_REQ_GetStatus: + if ((USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) || + (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_ENDPOINT))) + { + Endpoint_ClearSETUP(); + Endpoint_ClearStatusStage(); + } } } diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index f619983ec1..4fe30411e0 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -12,14 +12,16 @@ * - Added USE_LUFA_CONFIG_HEADER compile time option to include a LUFAConfig.h header in the user director for LUFA configuration * tokens as an alternative to tokens defined in the project makefile * - Added new USB_Host_SetInterfaceAltSetting() convenience function for the selection of an interface's alternative setting + * - Added Audio class control request definitions * - Library Applications: + * - Added RNDIS device mode to the Webserver project * - Added new MediaControl project * - Added new incomplete AndroidAccessoryHost Host LowLevel demo - * - Added RNDIS device mode to the Webserver project + * - Added new incomplete AudioInputHost Host LowLevel demo * * <b>Changed:</b> * - Core: - * - <i>None</i> + * - Added support for the Audio class GET STATUS request so that it is correctly ACKed when sent by the host * - Library Applications: * - <i>None</i> * diff --git a/LUFA/ManPages/FutureChanges.txt b/LUFA/ManPages/FutureChanges.txt index 4e16d3afa2..154f86243d 100644 --- a/LUFA/ManPages/FutureChanges.txt +++ b/LUFA/ManPages/FutureChanges.txt @@ -29,11 +29,10 @@ * - Demos/Projects * -# Device/Host USB bridge * -# Alternative (USB-IF endorsed) USB-CDC Ethernet Class - * -# Finish Test and Measurement Class demo - * -# Finish BluetoothHost demo - * -# Finish SideShow demo - * -# Finish StandaloneProgrammer project - * -# Arduino Uno compatible USB-MIDI, USB-HID + * -# Finish incomplete demos and projects + * -# Add class driver support for Audio Host class + * -# Add class driver support for Test and Measurement class + * -# Fix up Audio class support - add support for mixers, etc., add support for GET/SET commands * - Ports * -# Atmel ARM7 series microcontrollers * -# Other (commercial) C compilers |