PDL for FM4  Version1.2
Peripheral Driverl Library for FM4
USB Device Middleware: HID Keyboard

Data Structures

struct  stc_usbdevice_keyboard
 

Macros

#define MODIFIERKEY_LEFT_CTRL   (1 << 0)
 
#define MODIFIERKEY_LEFT_SHIFT   (1 << 1)
 
#define MODIFIERKEY_LEFT_ALT   (1 << 2)
 
#define MODIFIERKEY_LEFT_GUI   (1 << 3)
 
#define MODIFIERKEY_RIGHT_CTRL   (1 << 4)
 
#define MODIFIERKEY_RIGHT_SHIFT   (1 << 5)
 
#define MODIFIERKEY_RIGHT_ALT   (1 << 6)
 
#define MODIFIERKEY_RIGHT_GUI   (1 << 7)
 

Typedefs

typedef struct
stc_usbdevice_keyboard 
stc_usbdevice_keyboard_t
 

Functions

void UsbDeviceHidKeyboard_Init (stc_usbn_t *pstcUsb)
 
void UsbDeviceHidKeyboard_SetModifierKey (uint8_t u8ModifierKey)
 
void UsbDeviceHidKeyboard_ClearModifierKey (uint8_t u8ModifierKey)
 
void UsbDeviceHidKeyboard_KeyPress (uint8_t u8Index, uint8_t u8KeyCode)
 
void UsbDeviceHidKeyboard_KeyDown (uint8_t u8Index, uint8_t u8KeyCode)
 
void UsbDeviceHidKeyboard_KeyUp (uint8_t u8Index, uint8_t u8KeyCode)
 
boolean_t UsbDeviceHidKeyboard_IsConnected (void)
 

Variables

const uint8_t u8AsciiToKeyCode []
 

Detailed Description

Provided functions of USB Device Keyboard module:

Used to enumerate a keyboard device

Macro Definition Documentation

#define MODIFIERKEY_LEFT_ALT   (1 << 2)

Definition at line 111 of file UsbDeviceHidKeyboard.h.

#define MODIFIERKEY_LEFT_CTRL   (1 << 0)

Definition at line 105 of file UsbDeviceHidKeyboard.h.

#define MODIFIERKEY_LEFT_GUI   (1 << 3)

Definition at line 114 of file UsbDeviceHidKeyboard.h.

#define MODIFIERKEY_LEFT_SHIFT   (1 << 1)

Definition at line 108 of file UsbDeviceHidKeyboard.h.

#define MODIFIERKEY_RIGHT_ALT   (1 << 6)

Definition at line 124 of file UsbDeviceHidKeyboard.h.

#define MODIFIERKEY_RIGHT_CTRL   (1 << 4)

Definition at line 118 of file UsbDeviceHidKeyboard.h.

#define MODIFIERKEY_RIGHT_GUI   (1 << 7)

Definition at line 127 of file UsbDeviceHidKeyboard.h.

#define MODIFIERKEY_RIGHT_SHIFT   (1 << 5)

Definition at line 121 of file UsbDeviceHidKeyboard.h.

Typedef Documentation

Function Documentation

void UsbDeviceHidKeyboard_ClearModifierKey ( uint8_t  u8ModifierKey)

Clear modifier keys

Parameters
u8ModifierKeyBitmask of modifier keys: MODIFIERKEY_LEFT_CTRL MODIFIERKEY_LEFT_SHIFT MODIFIERKEY_LEFT_ALT MODIFIERKEY_LEFT_GUI MODIFIERKEY_RIGHT_CTRL MODIFIERKEY_RIGHT_SHIFT MODIFIERKEY_RIGHT_ALT MODIFIERKEY_RIGHT_GUI
Returns
none

Definition at line 478 of file UsbDeviceHidKeyboard.c.

References pu8KeyboardData, SendData(), and UsbPOLL.

Here is the call graph for this function:

boolean_t UsbDeviceHidKeyboard_IsConnected ( void  )

Return connected state

Returns
TRUE if ready

Definition at line 539 of file UsbDeviceHidKeyboard.c.

References bReady.

void UsbDeviceHidKeyboard_KeyDown ( uint8_t  u8Index,
uint8_t  u8KeyCode 
)

Press key (Down)

Parameters
u8Index0..5 (parallel pressed keys)
u8KeyCodeKeycode
Returns
none

Definition at line 510 of file UsbDeviceHidKeyboard.c.

References pu8KeyboardData, SendData(), and UsbPOLL.

Here is the call graph for this function:

void UsbDeviceHidKeyboard_KeyPress ( uint8_t  u8Index,
uint8_t  u8KeyCode 
)

Press key (Down - Up)

Parameters
u8Index0..5 (parallel pressed keys)
u8KeyCodeKeycode
Returns
none

Definition at line 493 of file UsbDeviceHidKeyboard.c.

References pu8KeyboardData, SendData(), and UsbPOLL.

Here is the call graph for this function:

void UsbDeviceHidKeyboard_KeyUp ( uint8_t  u8Index,
uint8_t  u8KeyCode 
)

Press key (Up)

Parameters
u8Index0..5 (parallel pressed keys)
u8KeyCodeKeycode
Returns
none

Definition at line 525 of file UsbDeviceHidKeyboard.c.

References pu8KeyboardData, SendData(), and UsbPOLL.

Here is the call graph for this function:

void UsbDeviceHidKeyboard_SetModifierKey ( uint8_t  u8ModifierKey)

Set modifier keys

Parameters
u8ModifierKeyBitmask of modifier keys: MODIFIERKEY_LEFT_CTRL MODIFIERKEY_LEFT_SHIFT MODIFIERKEY_LEFT_ALT MODIFIERKEY_LEFT_GUI MODIFIERKEY_RIGHT_CTRL MODIFIERKEY_RIGHT_SHIFT MODIFIERKEY_RIGHT_ALT MODIFIERKEY_RIGHT_GUI
Returns
none

Definition at line 457 of file UsbDeviceHidKeyboard.c.

References pu8KeyboardData, SendData(), and UsbPOLL.

Here is the call graph for this function:

Variable Documentation

const uint8_t u8AsciiToKeyCode[]

Definition at line 79 of file UsbDeviceHidKeyboard.c.