aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/usbh/dev/hid.h
diff options
context:
space:
mode:
authorDiego Ismirlian <dismirlian (at) google's mail.com>2017-06-06 09:24:10 -0300
committerDiego Ismirlian <dismirlian (at) google's mail.com>2017-06-06 09:24:10 -0300
commit1bb8f56c3b0107b35ecfa4feab66fac99865f747 (patch)
treefd58c7c6dd03dcc200993ab19631a96b0e0c2e1d /os/hal/include/usbh/dev/hid.h
parent108ae2534cf5e487b569ea34bdae4e86b9c2d024 (diff)
downloadChibiOS-Contrib-1bb8f56c3b0107b35ecfa4feab66fac99865f747.tar.gz
ChibiOS-Contrib-1bb8f56c3b0107b35ecfa4feab66fac99865f747.tar.bz2
ChibiOS-Contrib-1bb8f56c3b0107b35ecfa4feab66fac99865f747.zip
HID class driver fixes
Diffstat (limited to 'os/hal/include/usbh/dev/hid.h')
-rw-r--r--os/hal/include/usbh/dev/hid.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/os/hal/include/usbh/dev/hid.h b/os/hal/include/usbh/dev/hid.h
index 62eda50..0d6b894 100644
--- a/os/hal/include/usbh/dev/hid.h
+++ b/os/hal/include/usbh/dev/hid.h
@@ -62,14 +62,21 @@ typedef enum {
USBHHID_REPORTTYPE_FEATURE = 3,
} usbhhid_reporttype_t;
+typedef enum {
+ USBHHID_PROTOCOL_BOOT = 0,
+ USBHHID_PROTOCOL_REPORT = 1,
+} usbhhid_protocol_t;
+
typedef struct USBHHIDDriver USBHHIDDriver;
typedef struct USBHHIDConfig USBHHIDConfig;
-typedef void (*usbhhid_report_callback)(USBHHIDDriver *hidp);
+typedef void (*usbhhid_report_callback)(USBHHIDDriver *hidp, uint16_t len);
struct USBHHIDConfig {
usbhhid_report_callback cb_report;
void *report_buffer;
+ uint16_t report_len;
+ usbhhid_protocol_t protocol;
};
struct USBHHIDDriver {
@@ -94,14 +101,13 @@ struct USBHHIDDriver {
/*===========================================================================*/
/* Driver macros. */
/*===========================================================================*/
-#define usbhhidGetState(hidp) ((hidp)->state)
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
-extern USBHHIDDriver USBHHID[HAL_USBHHID_MAX_INSTANCES];
+extern USBHHIDDriver USBHHIDD[HAL_USBHHID_MAX_INSTANCES];
#ifdef __cplusplus
extern "C" {
@@ -125,6 +131,12 @@ extern "C" {
return hidp->type;
}
+ static inline usbhhid_state_t usbhhidGetState(USBHHIDDriver *hidp) {
+ return hidp->state;
+ }
+
+ void usbhhidStart(USBHHIDDriver *hidp, const USBHHIDConfig *cfg);
+
/* global initializer */
void usbhhidInit(void);
#ifdef __cplusplus