Class internal implementation.
Functions | |
bool | udi_hid_mouse_btnleft (bool b_state) |
Changes left button state. More... | |
bool | udi_hid_mouse_btnmiddle (bool b_state) |
Changes middle button state. More... | |
bool | udi_hid_mouse_btnright (bool b_state) |
Changes right button state. More... | |
bool | udi_hid_mouse_moveScroll (int8_t pos) |
Move the scroll wheel. More... | |
bool | udi_hid_mouse_moveX (int8_t pos_x) |
Move the mouse pointer on X axe. More... | |
bool | udi_hid_mouse_moveY (int8_t pos_y) |
Move the mouse pointer on Y axe. More... | |
Variables | |
UDC_DESC_STORAGE udi_hid_mouse_report_desc_t | udi_hid_mouse_report_desc |
HID report descriptor for standard HID mouse. More... | |
Internal defines and variables to manage HID mouse | |
static COMPILER_WORD_ALIGNED uint8_t | udi_hid_mouse_rate |
To store current rate of HID mouse. More... | |
static COMPILER_WORD_ALIGNED uint8_t | udi_hid_mouse_protocol |
To store current protocol of HID mouse. More... | |
static bool | udi_hid_mouse_b_report_valid |
To signal if a valid report is ready to send. More... | |
static uint8_t | udi_hid_mouse_report [UDI_HID_MOUSE_REPORT_SIZE] |
Report ready to send. More... | |
static bool | udi_hid_mouse_report_trans_ongoing |
Signal if a report transfer is on going. More... | |
static COMPILER_WORD_ALIGNED uint8_t | udi_hid_mouse_report_trans [UDI_HID_MOUSE_REPORT_SIZE] |
Buffer used to send report. More... | |
static bool | udi_hid_mouse_setreport (void) |
Callback for set report setup request. More... | |
#define | UDI_HID_MOUSE_REPORT_SIZE 4 |
Size of report for standard HID mouse. More... | |
Internal routines | |
static bool | udi_hid_mouse_move (int8_t pos, uint8_t index_report) |
Moves an axe. More... | |
static bool | udi_hid_mouse_btn (bool b_state, uint8_t btn) |
Changes a button state. More... | |
static bool | udi_hid_mouse_send_report (void) |
Send the report. More... | |
static void | udi_hid_mouse_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... | |
#define UDI_HID_MOUSE_REPORT_SIZE 4 |
Size of report for standard HID mouse.
Referenced by udi_hid_mouse_enable(), and udi_hid_mouse_send_report().
Changes a button state.
b_state | New button state |
btn | Index of button to change (4=middle, 2=right, 1=left) |
1
if function was successfully done, otherwise 0
. References HID_MOUSE_BTN_DOWN, udi_hid_mouse_move(), and udi_hid_mouse_report.
Referenced by udi_hid_mouse_btnleft(), udi_hid_mouse_btnmiddle(), and udi_hid_mouse_btnright().
Changes left button state.
b_state | New button state |
1
if function was successfully done, otherwise 0
. References udi_hid_mouse_btn().
Changes middle button state.
b_state | New button state |
1
if function was successfully done, otherwise 0
. References udi_hid_mouse_btn().
Changes right button state.
b_state | New button state |
1
if function was successfully done, otherwise 0
. References udi_hid_mouse_btn().
|
static |
Moves an axe.
pos | Signed value to move |
index_report | Index of report to move (3=scroll wheel, 2=axe Y, 1=axe X)) |
1
if function was successfully done, otherwise 0
. References cpu_irq_restore(), cpu_irq_save(), udi_hid_mouse_b_report_valid, udi_hid_mouse_report, and udi_hid_mouse_send_report().
Referenced by udi_hid_mouse_btn(), udi_hid_mouse_moveScroll(), udi_hid_mouse_moveX(), and udi_hid_mouse_moveY().
bool udi_hid_mouse_moveScroll | ( | int8_t | pos | ) |
Move the scroll wheel.
pos | Signed value to move |
1
if function was successfully done, otherwise 0
. References udi_hid_mouse_move().
bool udi_hid_mouse_moveX | ( | int8_t | pos_x | ) |
Move the mouse pointer on X axe.
pos_x | Signed value to move |
1
if function was successfully done, otherwise 0
. References udi_hid_mouse_move().
Referenced by ui_device_sof_action().
bool udi_hid_mouse_moveY | ( | int8_t | pos_y | ) |
Move the mouse pointer on Y axe.
pos_y | Signed value to move |
1
if function was successfully done, otherwise 0
. References udi_hid_mouse_move().
Referenced by ui_device_sof_action().
|
static |
Callback called when the report is sent.
status | UDD_EP_TRANSFER_OK, if transfer finish |
status | UDD_EP_TRANSFER_ABORT, if transfer aborted |
nb_sent | number of data transfered |
1
if function was successfully done, otherwise 0
. References udi_hid_mouse_b_report_valid, udi_hid_mouse_report_trans_ongoing, udi_hid_mouse_send_report(), and UNUSED.
Referenced by udi_hid_mouse_send_report().
|
static |
Send the report.
1
if send on going, 0
if delay. References udd_ep_run(), udi_hid_mouse_b_report_valid, UDI_HID_MOUSE_EP_IN, udi_hid_mouse_report, udi_hid_mouse_report_sent(), UDI_HID_MOUSE_REPORT_SIZE, udi_hid_mouse_report_trans, and udi_hid_mouse_report_trans_ongoing.
Referenced by udi_hid_mouse_move(), and udi_hid_mouse_report_sent().
|
static |
Callback for set report setup request.
1
always, because it is not used on mouse interface Referenced by udi_hid_mouse_setup().
|
static |
To signal if a valid report is ready to send.
Referenced by udi_hid_mouse_enable(), udi_hid_mouse_move(), udi_hid_mouse_report_sent(), and udi_hid_mouse_send_report().
|
static |
To store current protocol of HID mouse.
Referenced by udi_hid_mouse_enable(), and udi_hid_mouse_setup().
|
static |
To store current rate of HID mouse.
Referenced by udi_hid_mouse_enable(), and udi_hid_mouse_setup().
|
static |
Report ready to send.
Referenced by udi_hid_mouse_btn(), udi_hid_mouse_enable(), udi_hid_mouse_move(), and udi_hid_mouse_send_report().
UDC_DESC_STORAGE udi_hid_mouse_report_desc_t udi_hid_mouse_report_desc |
HID report descriptor for standard HID mouse.
Referenced by udi_hid_mouse_setup().
|
static |
Buffer used to send report.
Referenced by udi_hid_mouse_send_report().
|
static |
Signal if a report transfer is on going.
Referenced by udi_hid_mouse_enable(), udi_hid_mouse_report_sent(), and udi_hid_mouse_send_report().