summaryrefslogtreecommitdiff
path: root/src/class/hid/hid.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-05-18 12:32:20 +0700
committerhathach <[email protected]>2021-05-18 12:32:20 +0700
commite163f85ee024ff366253478cfd20e3fc35e96819 (patch)
treeb3fc43ef1a4ebbc52d26ac79df80f2091440bee7 /src/class/hid/hid.h
parent2d15e1183064a35cc646a46bddf2b82915114cc8 (diff)
clean up, rename some HID device symbol/API
- add tud_hid_n_interface_protocol() - rename tud_hid_n_boot_mode() to tud_hid_n_get_protocol() - rename tud_hid_boot_mode_cb() to tud_hid_set_protocol_cb() - add HID_PROTOCOL_BOOT/REPORT to avoid magic number 0,1 - rename HID_PROTOCOL_NONE/KEYBOARD/MOUSE to HID_ITF_PROTOCOL_ to avoid confusion
Diffstat (limited to 'src/class/hid/hid.h')
-rw-r--r--src/class/hid/hid.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/class/hid/hid.h b/src/class/hid/hid.h
index 351a4d600..6014e54a6 100644
--- a/src/class/hid/hid.h
+++ b/src/class/hid/hid.h
@@ -62,15 +62,15 @@ typedef enum
{
HID_SUBCLASS_NONE = 0, ///< No Subclass
HID_SUBCLASS_BOOT = 1 ///< Boot Interface Subclass
-}hid_subclass_type_t;
+}hid_subclass_enum_t;
-/// HID Protocol
+/// HID Interface Protocol
typedef enum
{
- HID_PROTOCOL_NONE = 0, ///< None
- HID_PROTOCOL_KEYBOARD = 1, ///< Keyboard
- HID_PROTOCOL_MOUSE = 2 ///< Mouse
-}hid_protocol_type_t;
+ HID_ITF_PROTOCOL_NONE = 0, ///< None
+ HID_ITF_PROTOCOL_KEYBOARD = 1, ///< Keyboard
+ HID_ITF_PROTOCOL_MOUSE = 2 ///< Mouse
+}hid_interface_protocol_enum_t;
/// HID Descriptor Type
typedef enum
@@ -78,7 +78,7 @@ typedef enum
HID_DESC_TYPE_HID = 0x21, ///< HID Descriptor
HID_DESC_TYPE_REPORT = 0x22, ///< Report Descriptor
HID_DESC_TYPE_PHYSICAL = 0x23 ///< Physical Descriptor
-}hid_descriptor_type_t;
+}hid_descriptor_enum_t;
/// HID Request Report Type
typedef enum
@@ -87,7 +87,7 @@ typedef enum
HID_REPORT_TYPE_INPUT, ///< Input
HID_REPORT_TYPE_OUTPUT, ///< Output
HID_REPORT_TYPE_FEATURE ///< Feature
-}hid_report_type_t;
+}hid_report_enum_t;
/// HID Class Specific Control Request
typedef enum
@@ -98,9 +98,9 @@ typedef enum
HID_REQ_CONTROL_SET_REPORT = 0x09, ///< Set Report
HID_REQ_CONTROL_SET_IDLE = 0x0a, ///< Set Idle
HID_REQ_CONTROL_SET_PROTOCOL = 0x0b ///< Set Protocol
-}hid_request_type_t;
+}hid_request_enum_t;
-/// HID Country Code
+/// HID Local Code
typedef enum
{
HID_LOCAL_NotSupported = 0 , ///< NotSupported
@@ -139,7 +139,14 @@ typedef enum
HID_LOCAL_US , ///< US
HID_LOCAL_Yugoslavia , ///< Yugoslavia
HID_LOCAL_Turkish_F ///< Turkish-F
-} hid_country_code_t;
+} hid_local_enum_t;
+
+// HID protocol value used by GetProtocol / SetProtocol
+enum
+{
+ HID_PROTOCOL_BOOT = 0,
+ HID_PROTOCOL_REPORT = 1
+};
/** @} */