hidkbd.h

Go to the documentation of this file.
00001 /***************************************************************************/
00015 #ifndef __SILICON_LABS_HIDKBD_H__
00016 #define __SILICON_LABS_HIDKBD_H__
00017 
00018 /***************************************************************************/
00023 /***************************************************************************/
00028 #include <stdint.h>
00029 
00030 #include "em_usb.h"
00031 
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035 
00037 EFM32_PACK_START( 1 )
00038 typedef struct
00039 {
00040   uint8_t modifier; 
00041   uint8_t reserved; 
00042   uint8_t key[ 6 ]; 
00044 } __attribute__ ((packed)) HIDKBD_KeyReport_t;
00045 EFM32_PACK_END()
00046 
00047 /**************************************************************************/
00058 typedef void (*HIDKBD_SetReportFunc_t)( uint8_t report );
00059 
00065 typedef struct
00066 {
00067   void                    *hidDescriptor; 
00068   HIDKBD_SetReportFunc_t  setReportFunc;  
00069 } HIDKBD_Init_t;
00070 
00071 extern const char HIDKBD_ReportDescriptor[ 69 ];
00072 
00073 void HIDKBD_Init( HIDKBD_Init_t *init );
00074 int  HIDKBD_SetupCmd( const USB_Setup_TypeDef *setup );
00075 void HIDKBD_StateChangeEvent( USBD_State_TypeDef oldState,
00076                               USBD_State_TypeDef newState );
00077 void HIDKBD_KeyboardEvent( HIDKBD_KeyReport_t *report );
00078 
00079 #ifdef __cplusplus
00080 }
00081 #endif
00082 
00086 #endif /* __SILICON_LABS_HIDKBD_H__ */