Data Structures |
struct | KBDInputReport |
struct | KBDOutputReport |
struct | HIDDKeyboard |
struct | _HIDDKeyboardOutputReport |
struct | _HIDDKeyboardInputReport |
struct | _HIDDKeyboardDriverConfigurationDescriptors |
Modules |
| HID Device Descriptor IDs |
| HIDD Keyboard Driver Definitions |
Functions |
void | HIDDKeyboard_Initialize (USBDDriver *pUsbd, uint8_t bInterfaceNb) |
void | HIDDKeyboard_ConfigureFunction (USBGenericDescriptor *pDescriptors, uint16_t wLength) |
uint32_t | HIDDKeyboard_RequestHandler (const USBGenericRequest *request) |
uint32_t | HIDDKeyboard_ChangeKeys (uint8_t *pressedKeys, uint8_t pressedKeysSize, uint8_t *releasedKeys, uint8_t releasedKeysSize) |
void | HIDDKeyboard_RemoteWakeUp (void) |
WEAK void | HIDDKeyboardCallbacks_LedsChanged (uint8_t numLockStatus, uint8_t capsLockStatus, uint8_t scrollLockStatus) |
void | HIDDKeyboardDriver_Initialize (const USBDDriverDescriptors *pDescriptors) |
void | HIDDKeyboardDriver_ConfigurationChangedHandler (uint8_t cfgnum) |
void | HIDDKeyboardDriver_RequestHandler (const USBGenericRequest *request) |
void | HIDDKeyboardInputReport_Initialize (HIDDKeyboardInputReport *report) |
void | HIDDKeyboardInputReport_PressStandardKey (HIDDKeyboardInputReport *report, uint8_t key) |
void | HIDDKeyboardInputReport_ReleaseStandardKey (HIDDKeyboardInputReport *report, uint8_t key) |
void | HIDDKeyboardInputReport_PressModifierKey (HIDDKeyboardInputReport *report, uint8_t key) |
void | HIDDKeyboardInputReport_ReleaseModifierKey (HIDDKeyboardInputReport *report, uint8_t key) |
void | HIDDKeyboardOutputReport_Initialize (HIDDKeyboardOutputReport *report) |
unsigned char | HIDDKeyboardOutputReport_GetNumLockStatus (const HIDDKeyboardOutputReport *report) |
unsigned char | HIDDKeyboardOutputReport_GetCapsLockStatus (const HIDDKeyboardOutputReport *report) |
unsigned char | HIDDKeyboardOutputReport_GetScrollLockStatus (const HIDDKeyboardOutputReport *report) |
struct _HIDDKeyboardOutputReport | __attribute__ ((__packed__)) HIDDKeyboardOutputReport |
Variables |
USBDDriverDescriptors | hiddKeyboardDriverDescriptors |
const uint8_t | hiddKeyboardReportDescriptor [] |
Detailed Description
Implement HID Keyboard Function For USB Device.
Implement a USB device that only have HID Keyboard Function.
Function Documentation
uint32_t HIDDKeyboard_ChangeKeys |
( |
uint8_t * |
pressedKeys, |
|
|
uint8_t |
pressedKeysSize, |
|
|
uint8_t * |
releasedKeys, |
|
|
uint8_t |
releasedKeysSize | |
|
) |
| | |
Reports a change in which keys are currently pressed or release to the host.
- Parameters:
-
| pressedKeys | Pointer to an array of key codes indicating keys that have been pressed since the last call to HIDDKeyboardDriver_ChangeKeys(). |
| pressedKeysSize | Number of key codes in the pressedKeys array. |
| releasedKeys | Pointer to an array of key codes indicates keys that have been released since the last call to HIDDKeyboardDriver_ChangeKeys(). |
| releasedKeysSize | Number of key codes in the releasedKeys array. |
- Returns:
- USBD_STATUS_SUCCESS if the report has been sent to the host; otherwise an error code.
void HIDDKeyboard_ConfigureFunction |
( |
USBGenericDescriptor * |
pDescriptors, |
|
|
uint16_t |
wLength | |
|
) |
| | |
Configure function with expected descriptors and start functionality. Usually invoked when device is configured. Pointer to the descriptors for function configure. Length of descriptors in number of bytes.
void HIDDKeyboard_Initialize |
( |
USBDDriver * |
pUsbd, |
|
|
uint8_t |
bInterfaceNb | |
|
) |
| | |
Initializes the HID keyboard device driver SW. (Init USBDDriver .., Init function driver .., Init USBD ...)
- Parameters:
-
| pUsbd | Pointer to USBDDriver instance. |
| bInterfaceNb | Interface number for the function. |
void HIDDKeyboard_RemoteWakeUp |
( |
void |
|
) |
|
Starts a remote wake-up sequence if the host has explicitely enabled it by sending the appropriate SET_FEATURE request.
Handles HID-specific SETUP request sent by the host.
- Parameters:
-
- Returns:
- USBRC_SUCCESS if request is handled.
WEAK void HIDDKeyboardCallbacks_LedsChanged |
( |
uint8_t |
numLockStatus, |
|
|
uint8_t |
capsLockStatus, |
|
|
uint8_t |
scrollLockStatus | |
|
) |
| | |
For HID Keyboard Function. Indicates that the status of one or more LEDs has been changed by the host.
- Parameters:
-
| numLockStatus | Indicates the current status of the num. lock key. |
| capsLockStatus | Indicates the current status of the caps lock key. |
| scrollLockStatus | Indicates the current status of the scroll lock key. |
void HIDDKeyboardDriver_ConfigurationChangedHandler |
( |
uint8_t |
cfgnum |
) |
|
Handles configureation changed event.
- Parameters:
-
| cfgnum | New configuration number |
Initializes the HID keyboard device driver.
Handles HID-specific SETUP request sent by the host.
- Parameters:
-
void HIDDKeyboardInputReport_Initialize |
( |
HIDDKeyboardInputReport * |
report |
) |
|
Initializes a keyboard input report instance.
- Parameters:
-
| report | Pointer to a HIDDKeyboardInputReport instance. |
void HIDDKeyboardInputReport_PressModifierKey |
( |
HIDDKeyboardInputReport * |
report, |
|
|
uint8_t |
key | |
|
) |
| | |
Reports a modifier key as being currently pressed.
- Parameters:
-
| report | Pointer to a HIDDKeyboardInputReport instance. |
| key | Key code of the modifier key. |
void HIDDKeyboardInputReport_PressStandardKey |
( |
HIDDKeyboardInputReport * |
report, |
|
|
uint8_t |
key | |
|
) |
| | |
Reports a standard key as being pressed.
- Parameters:
-
| report | Pointer to a HIDDKeyboardInputReport instance. |
| key | Key code of the standard key. |
void HIDDKeyboardInputReport_ReleaseModifierKey |
( |
HIDDKeyboardInputReport * |
report, |
|
|
uint8_t |
key | |
|
) |
| | |
Reports a modifier key as not being pressed anymore.
- Parameters:
-
| report | Pointer to a HIDDKeyboardInputReport instance. |
| key | Key code of the modifier key. |
void HIDDKeyboardInputReport_ReleaseStandardKey |
( |
HIDDKeyboardInputReport * |
report, |
|
|
uint8_t |
key | |
|
) |
| | |
Reports a standard key as not being pressed anymore.
- Parameters:
-
| report | Pointer to a HIDDKeyboardInputReport instance. |
| key | Key code of the standard key |
uint8_t HIDDKeyboardOutputReport_GetCapsLockStatus |
( |
const HIDDKeyboardOutputReport * |
report |
) |
|
Indicates the current status of the caps lock LED according to the given report.
- Parameters:
-
| report | Pointer to a HIDDKeyboardOutputReport instance. |
- Returns:
- 1 if the caps lock LED is light on; otherwise 0.
uint8_t HIDDKeyboardOutputReport_GetNumLockStatus |
( |
const HIDDKeyboardOutputReport * |
report |
) |
|
Indicates the current status of the num. lock LED according to the given report.
- Parameters:
-
| report | Pointer to a HIDDKeyboardOutputReport instance. |
- Returns:
- 1 if the num. lock LED is light on; otherwise 0.
uint8_t HIDDKeyboardOutputReport_GetScrollLockStatus |
( |
const HIDDKeyboardOutputReport * |
report |
) |
|
Indicates the current status of the scroll lock LED according to the given report.
- Parameters:
-
| report | Pointer to a HIDDKeyboardOutputReport instance. |
- Returns:
- 1 if the scroll lock LED is light on; otherwise 0.
void HIDDKeyboardOutputReport_Initialize |
( |
HIDDKeyboardOutputReport * |
report |
) |
|
Initializes a keyboard output report.
- Parameters:
-
| report | Pointer to a HIDDKeyboardOutputReport instance. |
Variable Documentation