22#include "USBDescriptor.h"
25#include "USBHID_Types.h"
26#include "OperationList.h"
70 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);
90 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);
146 uint16_t reportLength;
147 uint8_t reportDescriptor[27];
154 virtual const uint8_t *report_desc();
161 virtual uint16_t report_desc_length();
168 virtual const uint8_t *string_iproduct_desc();
175 virtual const uint8_t *string_iinterface_desc();
182 virtual const uint8_t *configuration_desc(uint8_t index);
191 virtual void HID_callbackSetReport(
HID_REPORT *report) {};
222 virtual void callback_set_configuration(uint8_t configuration);
235 virtual void callback_set_interface(uint16_t interface, uint8_t alternate);
240 virtual void report_rx() {}
245 virtual void report_tx() {}
252 void _init(uint8_t output_report_length, uint8_t input_report_length);
266 uint8_t _configuration_descriptor[41];
269 uint8_t _output_length;
270 uint8_t _input_length;
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.
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_xfer_done(const setup_packet_t *setup, bool aborted)
Called by USBDevice on data stage completion.
virtual void callback_state_change(DeviceState new_state)
Called when USB changes state.
bool send(const HID_REPORT *report)
Send a Report.
virtual ~USBHID()
Destroy this object.
bool read_nb(HID_REPORT *report)
Read a report: non blocking.
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)
Fully featured constructor.
bool ready()
Check if this class is ready.
void wait_ready()
Block until this HID device is in the configured state.
bool read(HID_REPORT *report)
Read a report: blocking.
Abstract interface to physical USB hardware.