USBMOUSE
Dependents: ESD_Project_USBMouse
USBHID.h
00001 00002 00003 #ifndef USB_HID_H 00004 #define USB_HID_H 00005 #include "USBEndpoints.h" 00006 #include "USBDescriptor.h" 00007 #include "USBDevice_Types.h" 00008 00009 #include "USBHID_Types.h" 00010 #include "USBDevice.h" 00011 00012 class USBHID: public USBDevice { 00013 public: 00014 00015 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); 00016 00017 bool send(HID_REPORT *report); 00018 bool sendNB(HID_REPORT *report); 00019 bool read(HID_REPORT * report); 00020 bool readNB(HID_REPORT * report); 00021 00022 protected: 00023 uint16_t reportLength; 00024 virtual uint8_t * reportDesc(); 00025 virtual uint16_t reportDescLength(); 00026 virtual uint8_t * stringIproductDesc(); 00027 virtual uint8_t * stringIinterfaceDesc(); 00028 virtual uint8_t * configurationDesc(); 00029 virtual void HID_callbackSetReport(HID_REPORT *report){}; 00030 virtual bool USBCallback_request(); 00031 virtual bool USBCallback_setConfiguration(uint8_t configuration); 00032 00033 private: 00034 HID_REPORT outputReport; 00035 uint8_t output_length; 00036 uint8_t input_length; 00037 }; 00038 00039 #endif
Generated on Sat Jul 16 2022 01:37:14 by
1.7.2