diff options
| author | hathach <[email protected]> | 2023-04-06 11:16:28 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2023-04-06 11:16:28 +0700 |
| commit | 6db24e0dbae248c865ec3ed0e5febcf341b489d4 (patch) | |
| tree | 1cd601cf1ea662c30ed31f2301e21d4e59f12622 /src/class/hid/hid_host.h | |
| parent | 106084289dec0146c117fad69925696b388509be (diff) | |
implement tuh_hid_receive_ready() and tuh_hid_send_ready()
Diffstat (limited to 'src/class/hid/hid_host.h')
| -rw-r--r-- | src/class/hid/hid_host.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/class/hid/hid_host.h b/src/class/hid/hid_host.h index c0c727e6a..08ad421d2 100644 --- a/src/class/hid/hid_host.h +++ b/src/class/hid/hid_host.h @@ -62,7 +62,7 @@ typedef struct // Interface API //--------------------------------------------------------------------+ -// Get the number of mounted HID interfaces of a device +// Get the total number of mounted HID interfaces of a device uint8_t tuh_hid_itf_get_count(uint8_t dev_addr); // Get all mounted interfaces across devices @@ -109,14 +109,17 @@ bool tuh_hid_set_report(uint8_t dev_addr, uint8_t idx, uint8_t report_id, uint8_ // Interrupt Endpoint API //--------------------------------------------------------------------+ -// Check if the interface is ready to use -//bool tuh_n_hid_n_ready(uint8_t dev_addr, uint8_t idx); +// Check if HID interface is ready to receive report +bool tuh_hid_receive_ready(uint8_t dev_addr, uint8_t idx); // Try to receive next report on Interrupt Endpoint. Immediately return // - true If succeeded, tuh_hid_report_received_cb() callback will be invoked when report is available // - false if failed to queue the transfer e.g endpoint is busy bool tuh_hid_receive_report(uint8_t dev_addr, uint8_t idx); +// Check if HID interface is ready to send report +bool tuh_hid_send_ready(uint8_t dev_addr, uint8_t idx); + // Send report using interrupt endpoint // If report_id > 0 (composite), it will be sent as 1st byte, then report contents. Otherwise only report content is sent. bool tuh_hid_send_report(uint8_t dev_addr, uint8_t idx, uint8_t report_id, const void* report, uint16_t len); |
