EFM32 Gecko Software Documentation  efm32g-doc-5.1.2
hidkbd.h
Go to the documentation of this file.
1 /***************************************************************************/
15 #ifndef __SILICON_LABS_HIDKBD_H__
16 #define __SILICON_LABS_HIDKBD_H__
17 
18 /***************************************************************************/
23 /***************************************************************************/
28 #include <stdint.h>
29 
30 #include "em_usb.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
38 typedef struct
39 {
40  uint8_t modifier;
41  uint8_t reserved;
42  uint8_t key[ 6 ];
46 
47 /**************************************************************************/
58 typedef void (*HIDKBD_SetReportFunc_t)( uint8_t report );
59 
65 typedef struct
66 {
67  void *hidDescriptor;
70 
71 extern const char HIDKBD_ReportDescriptor[ 69 ];
72 
73 void HIDKBD_Init( HIDKBD_Init_t *init );
74 int HIDKBD_SetupCmd( const USB_Setup_TypeDef *setup );
75 void HIDKBD_StateChangeEvent( USBD_State_TypeDef oldState,
76  USBD_State_TypeDef newState );
77 void HIDKBD_KeyboardEvent( HIDKBD_KeyReport_t *report );
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
86 #endif /* __SILICON_LABS_HIDKBD_H__ */
#define SL_PACK_END()
Macro for handling packed structs. Use this macro after the struct definition. With GCC...
Definition: em_common.h:157
HIDKBD_SetReportFunc_t setReportFunc
Definition: hidkbd.h:68
void * hidDescriptor
Definition: hidkbd.h:67
void HIDKBD_StateChangeEvent(USBD_State_TypeDef oldState, USBD_State_TypeDef newState)
Handle USB state change events, this function must be called each time the USB device state is change...
Definition: hidkbd.c:344
#define SL_PACK_START(x)
Macro for handling packed structs. Use this macro before the struct definition. X denotes the max...
Definition: em_common.h:150
uint8_t reserved
Definition: hidkbd.h:41
int HIDKBD_SetupCmd(const USB_Setup_TypeDef *setup)
Handle USB setup commands. Implements HID class specific commands. This function must be called each ...
Definition: hidkbd.c:232
void HIDKBD_Init(HIDKBD_Init_t *init)
Initialize HID Keyboard driver.
Definition: hidkbd.c:187
void(* HIDKBD_SetReportFunc_t)(uint8_t report)
Callback function pointer for HID output reports. This function will be called by the driver each tim...
Definition: hidkbd.h:58
void HIDKBD_KeyboardEvent(HIDKBD_KeyReport_t *report)
Report a keyboard press/release event.
Definition: hidkbd.c:202
uint8_t modifier
Definition: hidkbd.h:40
#define SL_ATTRIBUTE_PACKED
GCC style macro for handling packed structs.
Definition: em_common.h:143