[H7][LIB][USB] Modify USB Library for composite device
[betaflight.git] / lib / main / STM32H7 / Middlewares / ST / STM32_USB_Device_Library / Class / HID / Inc / usbd_hid.h
blob6afb12107ad0b1d97567f442c24ac8c6f42a4575
1 /**
2 ******************************************************************************
3 * @file usbd_hid.h
4 * @author MCD Application Team
5 * @brief Header file for the usbd_hid_core.c file.
6 ******************************************************************************
7 * @attention
9 * <h2><center>&copy; Copyright (c) 2015 STMicroelectronics.
10 * All rights reserved.</center></h2>
12 * This software component is licensed by ST under Ultimate Liberty license
13 * SLA0044, the "License"; You may not use this file except in compliance with
14 * the License. You may obtain a copy of the License at:
15 * www.st.com/SLA0044
17 ******************************************************************************
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef __USB_HID_H
22 #define __USB_HID_H
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
28 /* Includes ------------------------------------------------------------------*/
29 #include "usbd_ioreq.h"
31 /** @addtogroup STM32_USB_DEVICE_LIBRARY
32 * @{
35 /** @defgroup USBD_HID
36 * @brief This file is the Header file for usbd_hid.c
37 * @{
41 /** @defgroup USBD_HID_Exported_Defines
42 * @{
44 #define HID_EPIN_ADDR 0x83U
45 #define HID_EPIN_SIZE 0x08U
47 #define USB_HID_CONFIG_DESC_SIZ 34U
48 #define USB_HID_DESC_SIZ 9U
49 #define HID_MOUSE_REPORT_DESC_SIZE 38U
51 #define HID_DESCRIPTOR_TYPE 0x21U
52 #define HID_REPORT_DESC 0x22U
54 #ifndef HID_HS_BINTERVAL
55 #define HID_HS_BINTERVAL 0x07U
56 #endif /* HID_HS_BINTERVAL */
58 #ifndef HID_FS_BINTERVAL
59 #define HID_FS_BINTERVAL 0x0AU
60 #endif /* HID_FS_BINTERVAL */
62 #define HID_REQ_SET_PROTOCOL 0x0BU
63 #define HID_REQ_GET_PROTOCOL 0x03U
65 #define HID_REQ_SET_IDLE 0x0AU
66 #define HID_REQ_GET_IDLE 0x02U
68 #define HID_REQ_SET_REPORT 0x09U
69 #define HID_REQ_GET_REPORT 0x01U
70 /**
71 * @}
75 /** @defgroup USBD_CORE_Exported_TypesDefinitions
76 * @{
78 typedef enum
80 HID_IDLE = 0,
81 HID_BUSY,
83 HID_StateTypeDef;
86 typedef struct
88 uint32_t Protocol;
89 uint32_t IdleState;
90 uint32_t AltSetting;
91 HID_StateTypeDef state;
93 USBD_HID_HandleTypeDef;
94 /**
95 * @}
100 /** @defgroup USBD_CORE_Exported_Macros
101 * @{
105 * @}
108 /** @defgroup USBD_CORE_Exported_Variables
109 * @{
112 extern USBD_ClassTypeDef USBD_HID;
113 #define USBD_HID_CLASS &USBD_HID
115 * @}
118 /** @defgroup USB_CORE_Exported_Functions
119 * @{
121 uint8_t USBD_HID_SendReport(USBD_HandleTypeDef *pdev,
122 uint8_t *report,
123 uint16_t len);
125 uint32_t USBD_HID_GetPollingInterval(USBD_HandleTypeDef *pdev);
128 * @}
131 #ifdef __cplusplus
133 #endif
135 #endif /* __USB_HID_H */
137 * @}
141 * @}
144 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/