2017-09-05 00:07:16 -04:00
|
|
|
/*
|
|
|
|
* This file is part of the MicroPython project, http://micropython.org/
|
|
|
|
*/
|
2018-02-14 23:47:04 -05:00
|
|
|
#ifndef MICROPY_INCLUDED_STM32_USBD_HID_INTERFACE_H
|
|
|
|
#define MICROPY_INCLUDED_STM32_USBD_HID_INTERFACE_H
|
2017-09-05 00:07:16 -04:00
|
|
|
|
2019-07-25 03:42:17 -04:00
|
|
|
#include <stdint.h>
|
2017-09-05 00:07:16 -04:00
|
|
|
#include "usbd_cdc_msc_hid.h"
|
|
|
|
|
2019-07-25 03:42:17 -04:00
|
|
|
#define USBD_HID_REPORT_INVALID ((size_t)-1)
|
|
|
|
|
2017-09-05 00:07:16 -04:00
|
|
|
typedef struct _usbd_hid_itf_t {
|
2018-05-14 02:34:31 -04:00
|
|
|
usbd_hid_state_t base; // state for the base HID layer
|
2017-09-05 00:07:16 -04:00
|
|
|
|
2019-07-25 03:42:17 -04:00
|
|
|
volatile size_t report_in_len;
|
|
|
|
uint8_t report_in_buf[HID_DATA_FS_MAX_PACKET_SIZE];
|
2017-09-05 00:07:16 -04:00
|
|
|
} usbd_hid_itf_t;
|
|
|
|
|
2019-07-25 03:42:17 -04:00
|
|
|
static inline int usbd_hid_rx_num(usbd_hid_itf_t *hid) {
|
|
|
|
return hid->report_in_len != USBD_HID_REPORT_INVALID;
|
|
|
|
}
|
|
|
|
|
|
|
|
int usbd_hid_rx(usbd_hid_itf_t *hid, size_t len, uint8_t *buf, uint32_t timeout_ms);
|
2017-09-05 00:07:16 -04:00
|
|
|
|
2018-02-14 23:47:04 -05:00
|
|
|
#endif // MICROPY_INCLUDED_STM32_USBD_HID_INTERFACE_H
|