You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
599 B
25 lines
599 B
/* |
|
* Copyright (c) 2020 The ZMK Contributors |
|
* |
|
* SPDX-License-Identifier: MIT |
|
*/ |
|
|
|
#pragma once |
|
|
|
#include <usb/usb_device.h> |
|
#include <usb/class/usb_hid.h> |
|
|
|
#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; }
|
|
|