Class internal implementation.
Functions | |
void | udi_hid_kbd_disable (void) |
bool | udi_hid_kbd_enable (void) |
uint8_t | udi_hid_kbd_getsetting (void) |
bool | udi_hid_kbd_setup (void) |
bool | udi_hid_mkbd_modifier_down (uint16_t modifier_id) |
Send events media key modifier pressed. More... | |
bool | udi_hid_mkbd_modifier_up (uint16_t modifier_id) |
Send events media key modifier released. More... | |
Variables | |
UDC_DESC_STORAGE udi_hid_kbd_report_desc_t | udi_hid_kbd_report_desc |
UDC_DESC_STORAGE udi_hid_kbd_report_desc_t | udi_hid_kbd_report_desc |
HID report descriptor for standard HID keyboard. More... | |
Internal defines and variables to manage HID keyboard | |
static uint8_t | udi_hid_kbd_rate |
static uint8_t | udi_hid_kbd_protocol |
static uint8_t | udi_hid_kbd_report_set |
static bool | udi_hid_kbd_b_report_valid |
static uint8_t | udi_hid_kbd_report [UDI_HID_KBD_REPORT_SIZE] |
static uint8_t | report_size |
static bool | udi_hid_kbd_b_report_trans_ongoing |
static COMPILER_WORD_ALIGNED uint8_t | udi_hid_kbd_report_trans [UDI_HID_KBD_REPORT_SIZE] |
#define | UDI_HID_KBD_REPORT_SIZE 9 |
#define | UDI_HID_MKBD_REPORT_SIZE 3 |
Internal routines | |
static bool | udi_hid_kbd_setreport (void) |
Changes keyboard report states (like LEDs) More... | |
static bool | udi_hid_kbd_send_report (void) |
Send the report. More... | |
static void | udi_hid_kbd_report_sent (udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep) |
Callback called when the report is sent. More... | |
static void | udi_hid_kbd_setreport_valid (void) |
Callback called to update report from USB host udi_hid_kbd_report_set is updated before callback execution. More... | |
Internal defines and variables to manage HID keyboard | |
static COMPILER_WORD_ALIGNED uint8_t | udi_hid_kbd_rate |
To store current rate of HID keyboard. More... | |
static COMPILER_WORD_ALIGNED uint8_t | udi_hid_kbd_protocol |
To store current protocol of HID keyboard. More... | |
static COMPILER_WORD_ALIGNED uint8_t | udi_hid_kbd_report_set |
To store report feedback from USB host. More... | |
static bool | udi_hid_kbd_b_report_valid |
To signal if a valid report is ready to send. More... | |
static uint8_t | udi_hid_kbd_report [UDI_HID_KBD_REPORT_SIZE] |
Report ready to send. More... | |
static bool | udi_hid_kbd_b_report_trans_ongoing |
Signal if a report transfer is on going. More... | |
static COMPILER_WORD_ALIGNED uint8_t | udi_hid_kbd_report_trans [UDI_HID_KBD_REPORT_SIZE] |
Buffer used to send report. More... | |
#define | UDI_HID_KBD_REPORT_SIZE 8 |
Size of report for standard HID keyboard. More... | |
#define UDI_HID_KBD_REPORT_SIZE 9 |
Referenced by udi_hid_kbd_down(), udi_hid_kbd_enable(), udi_hid_kbd_modifier_down(), udi_hid_kbd_modifier_up(), and udi_hid_kbd_up().
#define UDI_HID_KBD_REPORT_SIZE 8 |
Size of report for standard HID keyboard.
Referenced by udi_hid_kbd_enable().
#define UDI_HID_MKBD_REPORT_SIZE 3 |
Referenced by udi_hid_mkbd_modifier_down(), and udi_hid_mkbd_modifier_up().
void udi_hid_kbd_disable | ( | void | ) |
References UDI_HID_KBD_DISABLE_EXT.
bool udi_hid_kbd_enable | ( | void | ) |
uint8_t udi_hid_kbd_getsetting | ( | void | ) |
|
static |
Callback called when the report is sent.
status | UDD_EP_TRANSFER_OK, if transfer is completed |
status | UDD_EP_TRANSFER_ABORT, if transfer is aborted |
nb_sent | number of data transfered |
1
if function was successfully done, otherwise 0
. References udi_hid_kbd_b_report_trans_ongoing, udi_hid_kbd_b_report_valid, udi_hid_kbd_send_report(), and UNUSED.
Referenced by udi_hid_kbd_send_report().
|
static |
Send the report.
1
if send on going, 0
if delay. References report_size, udi_hid_kbd_b_report_trans_ongoing, udi_hid_kbd_b_report_valid, UDI_HID_KBD_EP_IN, udi_hid_kbd_report, udi_hid_kbd_report_sent(), and udi_hid_kbd_report_trans.
Referenced by udi_hid_kbd_down(), udi_hid_kbd_modifier_down(), udi_hid_kbd_modifier_up(), udi_hid_kbd_report_sent(), udi_hid_kbd_up(), udi_hid_mkbd_modifier_down(), and udi_hid_mkbd_modifier_up().
|
static |
Changes keyboard report states (like LEDs)
rate | New rate value |
References udd_ctrl_request_t::callback, udd_ctrl_request_t::payload, udd_ctrl_request_t::payload_size, udd_ctrl_request_t::req, udd_g_ctrlreq, udi_hid_kbd_report_set, udi_hid_kbd_setreport_valid(), USB_HID_REPORT_TYPE_OUTPUT, usb_setup_req_t::wLength, and usb_setup_req_t::wValue.
Referenced by udi_hid_kbd_setup().
|
static |
Callback called to update report from USB host udi_hid_kbd_report_set is updated before callback execution.
References UDI_HID_KBD_CHANGE_LED, and udi_hid_kbd_report_set.
Referenced by udi_hid_kbd_setreport().
bool udi_hid_kbd_setup | ( | void | ) |
bool udi_hid_mkbd_modifier_down | ( | uint16_t | modifier_id | ) |
Send events media key modifier pressed.
modifier_id | ID of key modifier |
1
if function was successfully done, otherwise 0
. References cpu_irq_restore(), cpu_irq_save(), report_size, udi_hid_kbd_b_report_valid, udi_hid_kbd_report, udi_hid_kbd_send_report(), and UDI_HID_MKBD_REPORT_SIZE.
Referenced by zid_report_data_indication().
bool udi_hid_mkbd_modifier_up | ( | uint16_t | modifier_id | ) |
Send events media key modifier released.
modifier_id | ID of key modifier |
1
if function was successfully done, otherwise 0
. References cpu_irq_restore(), cpu_irq_save(), report_size, udi_hid_kbd_b_report_valid, udi_hid_kbd_report, udi_hid_kbd_send_report(), and UDI_HID_MKBD_REPORT_SIZE.
Referenced by zid_report_data_indication().
|
static |
|
static |
Referenced by udi_hid_kbd_enable(), udi_hid_kbd_report_sent(), and udi_hid_kbd_send_report().
|
static |
Signal if a report transfer is on going.
Referenced by udi_hid_kbd_enable(), udi_hid_kbd_report_sent(), and udi_hid_kbd_send_report().
|
static |
|
static |
To signal if a valid report is ready to send.
Referenced by udi_hid_kbd_enable(), udi_hid_kbd_report_sent(), and udi_hid_kbd_send_report().
|
static |
Referenced by udi_hid_kbd_enable(), and udi_hid_kbd_setup().
|
static |
To store current protocol of HID keyboard.
Referenced by udi_hid_kbd_enable(), and udi_hid_kbd_setup().
|
static |
Referenced by udi_hid_kbd_enable(), and udi_hid_kbd_setup().
|
static |
To store current rate of HID keyboard.
Referenced by udi_hid_kbd_enable(), and udi_hid_kbd_setup().
|
static |
|
static |
Report ready to send.
Referenced by udi_hid_kbd_enable(), and udi_hid_kbd_send_report().
UDC_DESC_STORAGE udi_hid_kbd_report_desc_t udi_hid_kbd_report_desc |
Referenced by udi_hid_kbd_setup().
UDC_DESC_STORAGE udi_hid_kbd_report_desc_t udi_hid_kbd_report_desc |
HID report descriptor for standard HID keyboard.
|
static |
Referenced by udi_hid_kbd_setreport(), and udi_hid_kbd_setreport_valid().
|
static |
To store report feedback from USB host.
Referenced by udi_hid_kbd_setreport(), and udi_hid_kbd_setreport_valid().
|
static |
Referenced by udi_hid_kbd_send_report().
|
static |
Buffer used to send report.
Referenced by udi_hid_kbd_send_report().