11/**
22 ******************************************************************************
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
55 *
66 ******************************************************************************
77 * @attention
3333 ******************************************************************************
3434 */
3535#ifdef USBCON
36- #include "usbd_desc.h"
37- #include "usbd_interface.h"
3836#ifdef USBD_USE_HID_COMPOSITE
37+
38+ #include "usbd_desc.h"
39+ #include "usbd_hid_composite_if.h"
3940#include "usbd_hid_composite.h"
40- #endif
41- #ifdef USBD_USE_CDC
42- #include "usbd_cdc_if.h"
43- #endif
4441
4542#ifdef __cplusplus
4643 extern "C" {
4744#endif
4845
49- /* USB Device Core handle declaration */
50- #ifdef USBD_USE_HID_COMPOSITE
46+ /* USB Device Core HID composite handle declaration */
5147USBD_HandleTypeDef hUSBD_Device_HID ;
52- #endif /* USBD_USE_HID_COMPOSITE*/
5348
5449/**
55- * @brief initialize USB devices
50+ * @brief Initialize USB devices
5651 * @param none
5752 * @retval none
5853 */
59- __attribute__((weak ))
60- void usbd_interface_init (void )
54+ void HID_Composite_Init (void )
6155{
62- #ifdef USBD_USE_HID_COMPOSITE
6356 /* Init Device Library */
6457 USBD_Init (& hUSBD_Device_HID , & HID_Desc , 0 );
6558
@@ -68,17 +61,29 @@ void usbd_interface_init(void)
6861
6962 /* Start Device Process */
7063 USBD_Start (& hUSBD_Device_HID );
71- #endif /* USBD_USE_HID_COMPOSITE */
7264}
7365
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+
7580/**
7681 * @brief Send HID mouse Report
7782 * @param report pointer to report
7883 * @param len report lenght
7984 * @retval none
8085 */
81- void usbd_interface_mouse_sendReport (uint8_t * report , uint16_t len )
86+ void HID_Composite_mouse_sendReport (uint8_t * report , uint16_t len )
8287{
8388 USBD_HID_MOUSE_SendReport (& hUSBD_Device_HID , report , len );
8489}
@@ -89,14 +94,14 @@ void usbd_interface_mouse_sendReport(uint8_t *report, uint16_t len)
8994 * @param len report lenght
9095 * @retval none
9196 */
92- void usbd_interface_keyboard_sendReport (uint8_t * report , uint16_t len )
97+ void HID_Composite_keyboard_sendReport (uint8_t * report , uint16_t len )
9398{
9499 USBD_HID_KEYBOARD_SendReport (& hUSBD_Device_HID , report , len );
95100}
96- #endif /* USBD_USE_HID_COMPOSITE */
97101
98102#ifdef __cplusplus
99103}
100104#endif
105+ #endif /* USBD_USE_HID_COMPOSITE */
101106#endif /* USBCON */
102107/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
0 commit comments