Usb Device Interface, protocol, and programming homework #4 Audio Control device
Dependencies: C12832_lcd USBDevice mbed
Diff: USBAudioControl.h
- Revision:
- 0:69eb9d19fb91
- Child:
- 1:948ffad3284f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBAudioControl.h Tue Jul 30 22:35:10 2013 +0000 @@ -0,0 +1,46 @@ +#ifndef USBaudiocontrol_H +#define USBaudiocontrol_H + +#include "USBHID.h" + + +/* Common usage */ + +/** + * + * @endcode + */ + +class USBAudioControl: public USBHID +{ + public: + + /** + * Constructor + * + * @param vendor_id Your vendor_id (default: 0x1234) + * @param product_id Your product_id (default: 0x0001) + * @param product_release Your preoduct_release (default: 0x0001) + * + */ + USBAudioControl( uint16_t vendor_id = 0x1234, uint16_t product_id = 0x0006, uint16_t product_release = 0x0001): + USBHID(1, 1, 1, vendor_id, product_id, product_release, false) + { + callbackSuspendChange=NULL; + }; + + + /* + * To define the report descriptor. Warning: this method has to store the length of the report descriptor in reportLength. + * + * @returns pointer to the report descriptor + */ + virtual uint8_t * reportDesc(); + + unsigned int getConnectState(); + void (*callbackSuspendChange)(unsigned int connected); + virtual void suspendStateChanged(unsigned int suspend); + +}; + +#endif