1
1
/**
2
2
******************************************************************************
3
- * @file usbd_interface .c
4
- * @brief Provide the USB device interface
3
+ * @file usbd_hid_composite_if .c
4
+ * @brief Provide the USB HID composite interface
5
5
*
6
6
******************************************************************************
7
7
* @attention
33
33
******************************************************************************
34
34
*/
35
35
#ifdef USBCON
36
- #include "usbd_desc.h"
37
- #include "usbd_interface.h"
38
36
#ifdef USBD_USE_HID_COMPOSITE
37
+
38
+ #include "usbd_desc.h"
39
+ #include "usbd_hid_composite_if.h"
39
40
#include "usbd_hid_composite.h"
40
- #endif
41
- #ifdef USBD_USE_CDC
42
- #include "usbd_cdc_if.h"
43
- #endif
44
41
45
42
#ifdef __cplusplus
46
43
extern "C" {
47
44
#endif
48
45
49
- /* USB Device Core handle declaration */
50
- #ifdef USBD_USE_HID_COMPOSITE
46
+ /* USB Device Core HID composite handle declaration */
51
47
USBD_HandleTypeDef hUSBD_Device_HID ;
52
- #endif /* USBD_USE_HID_COMPOSITE*/
53
48
54
49
/**
55
- * @brief initialize USB devices
50
+ * @brief Initialize USB devices
56
51
* @param none
57
52
* @retval none
58
53
*/
59
- __attribute__((weak ))
60
- void usbd_interface_init (void )
54
+ void HID_Composite_Init (void )
61
55
{
62
- #ifdef USBD_USE_HID_COMPOSITE
63
56
/* Init Device Library */
64
57
USBD_Init (& hUSBD_Device_HID , & HID_Desc , 0 );
65
58
@@ -68,17 +61,29 @@ void usbd_interface_init(void)
68
61
69
62
/* Start Device Process */
70
63
USBD_Start (& hUSBD_Device_HID );
71
- #endif /* USBD_USE_HID_COMPOSITE */
72
64
}
73
65
74
- #ifdef USBD_USE_HID_COMPOSITE
66
+ /**
67
+ * @brief DeInitialize USB devices
68
+ * @param none
69
+ * @retval none
70
+ */
71
+ void HID_Composite_DeInit (void )
72
+ {
73
+ /* Stop Device Process */
74
+ USBD_Stop (& hUSBD_Device_HID );
75
+
76
+ /* DeInit Device Library */
77
+ USBD_DeInit (& hUSBD_Device_HID );
78
+ }
79
+
75
80
/**
76
81
* @brief Send HID mouse Report
77
82
* @param report pointer to report
78
83
* @param len report lenght
79
84
* @retval none
80
85
*/
81
- void usbd_interface_mouse_sendReport (uint8_t * report , uint16_t len )
86
+ void HID_Composite_mouse_sendReport (uint8_t * report , uint16_t len )
82
87
{
83
88
USBD_HID_MOUSE_SendReport (& hUSBD_Device_HID , report , len );
84
89
}
@@ -89,14 +94,14 @@ void usbd_interface_mouse_sendReport(uint8_t *report, uint16_t len)
89
94
* @param len report lenght
90
95
* @retval none
91
96
*/
92
- void usbd_interface_keyboard_sendReport (uint8_t * report , uint16_t len )
97
+ void HID_Composite_keyboard_sendReport (uint8_t * report , uint16_t len )
93
98
{
94
99
USBD_HID_KEYBOARD_SendReport (& hUSBD_Device_HID , report , len );
95
100
}
96
- #endif /* USBD_USE_HID_COMPOSITE */
97
101
98
102
#ifdef __cplusplus
99
103
}
100
104
#endif
105
+ #endif /* USBD_USE_HID_COMPOSITE */
101
106
#endif /* USBCON */
102
107
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
0 commit comments