![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Usb Device Interface, protocol, and programming homework #4 Audio Control device
Dependencies: C12832_lcd USBDevice mbed
Diff: USBAudioControl.cpp
- Revision:
- 1:948ffad3284f
- Parent:
- 0:69eb9d19fb91
--- a/USBAudioControl.cpp Tue Jul 30 22:35:10 2013 +0000 +++ b/USBAudioControl.cpp Wed Jul 31 22:20:00 2013 +0000 @@ -1,17 +1,20 @@ #include "stdint.h" #include "USBAudioControl.h" +//Override the USBDevice suspendStateChange function to provide callback hook void USBAudioControl::suspendStateChanged(unsigned int suspend){ if(callbackSuspendChange!=NULL) (*callbackSuspendChange)(suspend); } +//Provide a way to poll the configure state of USB device unsigned int USBAudioControl::getConnectState(){ if (device.state != CONFIGURED) return 0; return 1; } +//Define the report descriptor uint8_t * USBAudioControl::reportDesc() { static uint8_t reportDescriptor[] = { USAGE_PAGE(2), 0x0c,0x00, // Consumer