USBMOUSE
Dependents: ESD_Project_USBMouse
USBHID/USBHID.h@0:78a4faee5b0f, 2015-12-13 (annotated)
- Committer:
- priyankapashte
- Date:
- Sun Dec 13 10:04:36 2015 +0000
- Revision:
- 0:78a4faee5b0f
USBMouse File has been modified;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
priyankapashte | 0:78a4faee5b0f | 1 | |
priyankapashte | 0:78a4faee5b0f | 2 | |
priyankapashte | 0:78a4faee5b0f | 3 | #ifndef USB_HID_H |
priyankapashte | 0:78a4faee5b0f | 4 | #define USB_HID_H |
priyankapashte | 0:78a4faee5b0f | 5 | #include "USBEndpoints.h" |
priyankapashte | 0:78a4faee5b0f | 6 | #include "USBDescriptor.h" |
priyankapashte | 0:78a4faee5b0f | 7 | #include "USBDevice_Types.h" |
priyankapashte | 0:78a4faee5b0f | 8 | |
priyankapashte | 0:78a4faee5b0f | 9 | #include "USBHID_Types.h" |
priyankapashte | 0:78a4faee5b0f | 10 | #include "USBDevice.h" |
priyankapashte | 0:78a4faee5b0f | 11 | |
priyankapashte | 0:78a4faee5b0f | 12 | class USBHID: public USBDevice { |
priyankapashte | 0:78a4faee5b0f | 13 | public: |
priyankapashte | 0:78a4faee5b0f | 14 | |
priyankapashte | 0:78a4faee5b0f | 15 | USBHID(uint8_t output_report_length = 64, uint8_t input_report_length = 64, uint16_t vendor_id = 0x1234, uint16_t product_id = 0x0006, uint16_t product_release = 0x0001, bool connect = true); |
priyankapashte | 0:78a4faee5b0f | 16 | |
priyankapashte | 0:78a4faee5b0f | 17 | bool send(HID_REPORT *report); |
priyankapashte | 0:78a4faee5b0f | 18 | bool sendNB(HID_REPORT *report); |
priyankapashte | 0:78a4faee5b0f | 19 | bool read(HID_REPORT * report); |
priyankapashte | 0:78a4faee5b0f | 20 | bool readNB(HID_REPORT * report); |
priyankapashte | 0:78a4faee5b0f | 21 | |
priyankapashte | 0:78a4faee5b0f | 22 | protected: |
priyankapashte | 0:78a4faee5b0f | 23 | uint16_t reportLength; |
priyankapashte | 0:78a4faee5b0f | 24 | virtual uint8_t * reportDesc(); |
priyankapashte | 0:78a4faee5b0f | 25 | virtual uint16_t reportDescLength(); |
priyankapashte | 0:78a4faee5b0f | 26 | virtual uint8_t * stringIproductDesc(); |
priyankapashte | 0:78a4faee5b0f | 27 | virtual uint8_t * stringIinterfaceDesc(); |
priyankapashte | 0:78a4faee5b0f | 28 | virtual uint8_t * configurationDesc(); |
priyankapashte | 0:78a4faee5b0f | 29 | virtual void HID_callbackSetReport(HID_REPORT *report){}; |
priyankapashte | 0:78a4faee5b0f | 30 | virtual bool USBCallback_request(); |
priyankapashte | 0:78a4faee5b0f | 31 | virtual bool USBCallback_setConfiguration(uint8_t configuration); |
priyankapashte | 0:78a4faee5b0f | 32 | |
priyankapashte | 0:78a4faee5b0f | 33 | private: |
priyankapashte | 0:78a4faee5b0f | 34 | HID_REPORT outputReport; |
priyankapashte | 0:78a4faee5b0f | 35 | uint8_t output_length; |
priyankapashte | 0:78a4faee5b0f | 36 | uint8_t input_length; |
priyankapashte | 0:78a4faee5b0f | 37 | }; |
priyankapashte | 0:78a4faee5b0f | 38 | |
priyankapashte | 0:78a4faee5b0f | 39 | #endif |