Class internal implementation.
Functions | |
bool | udi_hid_gpd_buttons (bool b_state, uint8_t key_id) |
Send events key pressed or released. More... | |
bool | udi_hid_gpd_moveX (int8_t pos) |
Move the x axe. More... | |
bool | udi_hid_gpd_moveY (int8_t pos) |
Move the y axe. More... | |
bool | udi_hid_gpd_throttle_move (int8_t pos) |
Move the throttle. More... | |
Variables | |
UDC_DESC_STORAGE udi_hid_gpd_report_desc_t | udi_hid_gpd_report_desc |
Internal defines and variables to manage HID gamepad | |
static uint8_t | udi_hid_gpd_rate |
static uint8_t | udi_hid_gpd_protocol |
static uint8_t | udi_hid_gpd_report_set |
static bool | udi_hid_gpd_b_report_valid |
static uint8_t | udi_hid_gpd_report [UDI_HID_GPD_REPORT_SIZE] |
static bool | udi_hid_gpd_b_report_trans_ongoing |
static COMPILER_WORD_ALIGNED uint8_t | udi_hid_gpd_report_trans [UDI_HID_GPD_REPORT_SIZE] |
#define | UDI_HID_GPD_REPORT_SIZE 4 |
Internal routines | |
static bool | udi_hid_gpd_setreport (void) |
Changes gamepad report states (like LEDs) More... | |
static bool | udi_hid_gpd_send_report (void) |
Send the report. More... | |
static void | udi_hid_gpd_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_gpd_setreport_valid (void) |
Callback called to update report from USB host udi_hid_gpd_report_set is updated before callback execution. More... | |
#define UDI_HID_GPD_REPORT_SIZE 4 |
Referenced by udi_hid_gpd_enable(), and udi_hid_gpd_send_report().
Send events key pressed or released.
key_id | ID of key |
b_state | Key Pressed or released |
1
if function was successfully done, otherwise 0
. References cpu_irq_restore(), cpu_irq_save(), udi_hid_gpd_b_report_valid, udi_hid_gpd_report, and udi_hid_gpd_send_report().
Referenced by zid_report_data_indication().
bool udi_hid_gpd_moveX | ( | int8_t | pos | ) |
Move the x axe.
pos | Signed value to move |
1
if function was successfully done, otherwise 0
. References cpu_irq_restore(), cpu_irq_save(), pos, udi_hid_gpd_b_report_valid, udi_hid_gpd_report, and udi_hid_gpd_send_report().
Referenced by zid_report_data_indication().
bool udi_hid_gpd_moveY | ( | int8_t | pos | ) |
Move the y axe.
pos | Signed value to move |
1
if function was successfully done, otherwise 0
. References cpu_irq_restore(), cpu_irq_save(), pos, udi_hid_gpd_b_report_valid, udi_hid_gpd_report, and udi_hid_gpd_send_report().
Referenced by zid_report_data_indication().
|
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_gpd_b_report_trans_ongoing, udi_hid_gpd_b_report_valid, udi_hid_gpd_send_report(), and UNUSED.
Referenced by udi_hid_gpd_send_report().
|
static |
Send the report.
1
if send on going, 0
if delay. References udi_hid_gpd_b_report_trans_ongoing, udi_hid_gpd_b_report_valid, udi_hid_gpd_report, udi_hid_gpd_report_sent(), UDI_HID_GPD_REPORT_SIZE, and udi_hid_gpd_report_trans.
Referenced by udi_hid_gpd_buttons(), udi_hid_gpd_moveX(), udi_hid_gpd_moveY(), udi_hid_gpd_report_sent(), and udi_hid_gpd_throttle_move().
|
static |
Changes gamepad 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_gpd_report_set, udi_hid_gpd_setreport_valid(), USB_HID_REPORT_TYPE_OUTPUT, usb_setup_req_t::wLength, and usb_setup_req_t::wValue.
Referenced by udi_hid_gpd_setup().
|
static |
Callback called to update report from USB host udi_hid_gpd_report_set is updated before callback execution.
References udi_hid_gpd_report_set.
Referenced by udi_hid_gpd_setreport().
bool udi_hid_gpd_throttle_move | ( | int8_t | pos | ) |
Move the throttle.
pos | Signed value to move |
1
if function was successfully done, otherwise 0
. References cpu_irq_restore(), cpu_irq_save(), pos, udi_hid_gpd_b_report_valid, udi_hid_gpd_report, and udi_hid_gpd_send_report().
Referenced by zid_report_data_indication().
|
static |
Referenced by udi_hid_gpd_enable(), udi_hid_gpd_report_sent(), and udi_hid_gpd_send_report().
|
static |
|
static |
Referenced by udi_hid_gpd_enable(), and udi_hid_gpd_setup().
|
static |
Referenced by udi_hid_gpd_enable(), and udi_hid_gpd_setup().
|
static |
UDC_DESC_STORAGE udi_hid_gpd_report_desc_t udi_hid_gpd_report_desc |
Referenced by udi_hid_gpd_setup().
|
static |
Referenced by udi_hid_gpd_setreport(), and udi_hid_gpd_setreport_valid().
|
static |
Referenced by udi_hid_gpd_send_report().