22 #include "USBDescriptor.h" 23 #include "USBDevice.h" 25 #include "USBHID_Types.h" 26 #include "OperationList.h" 66 USBHID(
bool connect_blocking =
true, 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);
86 USBHID(
USBPhy *phy, uint8_t output_report_length, uint8_t input_report_length, uint16_t vendor_id, uint16_t product_id, uint16_t product_release);
142 uint16_t reportLength;
143 uint8_t reportDescriptor[27];
150 virtual const uint8_t *report_desc();
157 virtual uint16_t report_desc_length();
164 virtual const uint8_t *string_iproduct_desc();
171 virtual const uint8_t *string_iinterface_desc();
178 virtual const uint8_t *configuration_desc(uint8_t index);
187 virtual void HID_callbackSetReport(
HID_REPORT *report) {};
218 virtual void callback_set_configuration(uint8_t configuration);
231 virtual void callback_set_interface(uint16_t interface, uint8_t alternate);
236 virtual void report_rx() {}
241 virtual void report_tx() {}
248 void _init(uint8_t output_report_length, uint8_t input_report_length);
262 uint8_t _configuration_descriptor[41];
265 uint8_t _output_length;
266 uint8_t _input_length;
virtual void callback_request_xfer_done(const setup_packet_t *setup, bool aborted)
Called by USBDevice on data stage completion.
bool send(const HID_REPORT *report)
Send a Report.
virtual void callback_state_change(DeviceState new_state)
Called when USB changes state.
bool read(HID_REPORT *report)
Read a report: blocking.
virtual ~USBHID()
Destroy this object.
void wait_ready()
Block until this HID device is in the configured state.
bool ready()
Check if this class is ready.
bool read_nb(HID_REPORT *report)
Read a report: non blocking.
Abstract interface to physical USB hardware.
USBHID(bool connect_blocking=true, 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)
Basic constructor.
virtual void callback_request(const setup_packet_t *setup)
Called by USBDevice on Endpoint0 request.
bool send_nb(const HID_REPORT *report)
Send a Report.