summaryrefslogtreecommitdiff
path: root/src/class/hid/hid_host.h
diff options
context:
space:
mode:
authorXudong Zheng <[email protected]>2023-08-27 15:21:15 -0400
committerhathach <[email protected]>2023-11-24 18:27:03 +0700
commit2fed722b0004e64667df526043f3bfcb131d3ee3 (patch)
tree015b7bdaf63a1596de459ef7e61cf7427730047f /src/class/hid/hid_host.h
parentf03f60eae2894993373b48e2104bf02116bef1fa (diff)
add tuh_hid_set_default_protocol() to set default USB host HID protocol
Diffstat (limited to 'src/class/hid/hid_host.h')
-rw-r--r--src/class/hid/hid_host.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/class/hid/hid_host.h b/src/class/hid/hid_host.h
index 08ad421d2..3c59e301d 100644
--- a/src/class/hid/hid_host.h
+++ b/src/class/hid/hid_host.h
@@ -97,6 +97,11 @@ uint8_t tuh_hid_parse_report_descriptor(tuh_hid_report_info_t* reports_info_arr,
// Application can use set_protocol() to switch back to Report protocol.
uint8_t tuh_hid_get_protocol(uint8_t dev_addr, uint8_t idx);
+// Device by default is initialized in Boot protocol for simplicity. Application
+// can use this to modify the default protocol before calling tuh_init(), or use
+// set_protocol() to change the protocol after initialization.
+void tuh_hid_set_default_protocol(uint8_t protocol);
+
// Set protocol to HID_PROTOCOL_BOOT (0) or HID_PROTOCOL_REPORT (1)
// This function is only supported by Boot interface (tuh_n_hid_interface_protocol() != NONE)
bool tuh_hid_set_protocol(uint8_t dev_addr, uint8_t idx, uint8_t protocol);