diff options
author | Pete Johanson <peter@peterjohanson.com> | 2020-10-31 00:09:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-31 00:09:47 -0400 |
commit | 2d31e1d05f737ebf8df2c5261912fe79b56a63c3 (patch) | |
tree | 2f32805fffdb24b5806cdf37af762fee221e27c5 /app/include/zmk/usb.h | |
parent | 3c958e62079059c375b86e29f66137a74c3b36c8 (diff) | |
parent | 821f0540711158985eb38b360b1f1b422408ca31 (diff) |
Merge pull request #269 from joelspadin/endpoint-selection
feat: only send HID reports to one endpoint
Diffstat (limited to 'app/include/zmk/usb.h')
-rw-r--r-- | app/include/zmk/usb.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/include/zmk/usb.h b/app/include/zmk/usb.h index 452fd54..30461de 100644 --- a/app/include/zmk/usb.h +++ b/app/include/zmk/usb.h @@ -12,8 +12,18 @@ #include <zmk/keys.h> #include <zmk/hid.h> +enum zmk_usb_conn_state { + ZMK_USB_CONN_NONE, + ZMK_USB_CONN_POWERED, + ZMK_USB_CONN_HID, +}; + enum usb_dc_status_code zmk_usb_get_status(); +enum zmk_usb_conn_state zmk_usb_get_conn_state(); + +static inline bool zmk_usb_is_powered() { return zmk_usb_get_conn_state() != ZMK_USB_CONN_NONE; } +static inline bool zmk_usb_is_hid_ready() { return zmk_usb_get_conn_state() == ZMK_USB_CONN_HID; } #ifdef CONFIG_ZMK_USB -int zmk_usb_hid_send_report(u8_t *report, size_t len); +int zmk_usb_hid_send_report(const u8_t *report, size_t len); #endif /* CONFIG_ZMK_USB */
\ No newline at end of file |