diff options
| author | Philip Potter | 2016-08-29 22:42:38 +0100 |
|---|---|---|
| committer | Damien George | 2016-10-04 15:38:01 +1100 |
| commit | eb239b839855de4f7fbf241635b702773f421b60 (patch) | |
| tree | 0f25ae9631705bf49279e2babac52638ff076344 /stmhal/usbdev/class/inc | |
| parent | 03de5a13cf7349bc43b9c50a43df9aa1113492fa (diff) | |
stmhal/usb: Add support to receive USB HID messages from host.
Diffstat (limited to 'stmhal/usbdev/class/inc')
| -rw-r--r-- | stmhal/usbdev/class/inc/usbd_cdc_msc_hid.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/stmhal/usbdev/class/inc/usbd_cdc_msc_hid.h b/stmhal/usbdev/class/inc/usbd_cdc_msc_hid.h index 248ce17f3..76a767892 100644 --- a/stmhal/usbdev/class/inc/usbd_cdc_msc_hid.h +++ b/stmhal/usbdev/class/inc/usbd_cdc_msc_hid.h @@ -6,9 +6,10 @@ #include "usbd_msc_scsi.h" #include "usbd_ioreq.h" -// CDC and MSC packet sizes +// CDC, MSC and HID packet sizes #define CDC_DATA_FS_MAX_PACKET_SIZE (64) // endpoint IN & OUT packet size #define MSC_MEDIA_PACKET (2048) // was 8192; how low can it go whilst still working? +#define HID_DATA_FS_MAX_PACKET_SIZE (64) // endpoint IN & OUT packet size // Need to define here for BOT and SCSI layers #define MSC_IN_EP (0x81) @@ -46,6 +47,10 @@ typedef struct { __IO uint32_t RxState; } USBD_CDC_HandleTypeDef; +typedef struct _USBD_HID_Itf { + int8_t (* Receive)(uint8_t *, uint32_t); +} USBD_HID_ItfTypeDef; + typedef struct _USBD_STORAGE { int8_t (* Init) (uint8_t lun); int8_t (* GetCapacity) (uint8_t lun, uint32_t *block_num, uint16_t *block_size); @@ -105,6 +110,9 @@ uint8_t USBD_CDC_TransmitPacket (USBD_HandleTypeDef *pdev); uint8_t USBD_MSC_RegisterStorage(USBD_HandleTypeDef *pdev, USBD_StorageTypeDef *fops); +uint8_t USBD_HID_RegisterInterface(USBD_HandleTypeDef *pdev, USBD_HID_ItfTypeDef *fops); +uint8_t USBD_HID_SetRxBuffer(USBD_HandleTypeDef *pdev, uint8_t *pbuff); +uint8_t USBD_HID_ReceivePacket(USBD_HandleTypeDef *pdev); int USBD_HID_CanSendReport(USBD_HandleTypeDef *pdev); uint8_t USBD_HID_SendReport(USBD_HandleTypeDef *pdev, uint8_t *report, uint16_t len); |
