usbd_hid_interface.h 783 B

123456789101112131415161718192021
  1. /*
  2. * This file is part of the MicroPython project, http://micropython.org/
  3. */
  4. #ifndef MICROPY_INCLUDED_STM32_USBD_HID_INTERFACE_H
  5. #define MICROPY_INCLUDED_STM32_USBD_HID_INTERFACE_H
  6. #include "usbd_cdc_msc_hid.h"
  7. typedef struct _usbd_hid_itf_t {
  8. usbd_hid_state_t base; // state for the base HID layer
  9. uint8_t buffer[2][HID_DATA_FS_MAX_PACKET_SIZE]; // pair of buffers to read individual packets into
  10. int8_t current_read_buffer; // which buffer to read from
  11. uint32_t last_read_len; // length of last read
  12. int8_t current_write_buffer; // which buffer to write to
  13. } usbd_hid_itf_t;
  14. int usbd_hid_rx_num(usbd_hid_itf_t *hid);
  15. int usbd_hid_rx(usbd_hid_itf_t *hid, size_t len, uint8_t *buf, uint32_t timeout);
  16. #endif // MICROPY_INCLUDED_STM32_USBD_HID_INTERFACE_H