|
uint8_t const | hid_keycode_to_ascii_tbl [2][128] |
|
The interface API includes status checking function, data transferring function and callback functions
tusb_error_t tusbh_hid_keyboard_get_report |
( |
uint8_t |
dev_addr, |
|
|
void * |
p_report |
|
) |
| |
Perform a get report from Keyboard interface.
- Parameters
-
[in] | dev_addr | device address |
[in,out] | p_report | address that is used to store data from device. Must be accessible by usb controller (see TUSB_CFG_ATTR_USBRAM) |
- Returns
- tusb_error_t type to indicate success or error condition.
- Return values
-
TUSB_ERROR_NONE | on success |
TUSB_ERROR_INTERFACE_IS_BUSY | if the interface is already transferring data with device |
TUSB_ERROR_DEVICE_NOT_READY | if device is not yet configured (by SET CONFIGURED request) |
TUSB_ERROR_INVALID_PARA | if input parameters are not correct |
- Note
- This function is non-blocking and returns immediately. The result of usb transfer will be reported by the interface's callback function
bool tusbh_hid_keyboard_is_busy |
( |
uint8_t |
dev_addr | ) |
|
Check if the interface is currently busy or not.
- Parameters
-
[in] | dev_addr | device address |
- Return values
-
true | if the interface is busy meaning the stack is still transferring/waiting data from/to device |
false | if the interface is not busy meaning the stack successfully transferred data from/to device |
- Note
- This function is primarily used for polling/waiting result after tusbh_hid_keyboard_get_report. Alternatively, asynchronous event API can be used
bool tusbh_hid_keyboard_is_mounted |
( |
uint8_t |
dev_addr | ) |
|
Check if device supports Keyboard interface or not.
- Parameters
-
[in] | dev_addr | device address |
- Return values
-
true | if device supports Keyboard interface |
false | if device does not support Keyboard interface or is not mounted |
void tusbh_hid_keyboard_isr |
( |
uint8_t |
dev_addr, |
|
|
tusb_event_t |
event |
|
) |
| |
Callback function that is invoked when an transferring event occurred.
- Parameters
-
[in] | dev_addr | Address of device |
[in] | event | an value from tusb_event_t |
- Note
- event can be one of following
- TUSB_EVENT_XFER_COMPLETE : previously scheduled transfer completes successfully.
- TUSB_EVENT_XFER_ERROR : previously scheduled transfer encountered a transaction error.
- TUSB_EVENT_XFER_STALLED : previously scheduled transfer is stalled by device.
-
Application should schedule the next report by calling tusbh_hid_keyboard_get_report within this callback
void tusbh_hid_keyboard_mounted_cb |
( |
uint8_t |
dev_addr | ) |
|
Callback function that will be invoked when a device with Keyboard interface is mounted.
- Parameters
-
[in] | dev_addr | Address of newly mounted device |
- Note
- This callback should be used by Application to set-up interface-related data
void tusbh_hid_keyboard_unmounted_cb |
( |
uint8_t |
dev_addr | ) |
|
Callback function that will be invoked when a device with Keyboard interface is unmounted.
- Parameters
-
[in] | dev_addr | Address of newly unmounted device |
- Note
- This callback should be used by Application to tear-down interface-related data