Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

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().

static bool udi_hid_mouse_btn ( bool  b_state,
uint8_t  btn 
)
static

Changes a button state.

Parameters
b_stateNew button state
btnIndex of button to change (4=middle, 2=right, 1=left)
Returns
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().

bool udi_hid_mouse_btnleft ( bool  b_state)

Changes left button state.

Parameters
b_stateNew button state
Returns
1 if function was successfully done, otherwise 0.

References udi_hid_mouse_btn().

bool udi_hid_mouse_btnmiddle ( bool  b_state)

Changes middle button state.

Parameters
b_stateNew button state
Returns
1 if function was successfully done, otherwise 0.

References udi_hid_mouse_btn().

bool udi_hid_mouse_btnright ( bool  b_state)

Changes right button state.

Parameters
b_stateNew button state
Returns
1 if function was successfully done, otherwise 0.

References udi_hid_mouse_btn().

static bool udi_hid_mouse_move ( int8_t  pos,
uint8_t  index_report 
)
static

Moves an axe.

Parameters
posSigned value to move
index_reportIndex of report to move (3=scroll wheel, 2=axe Y, 1=axe X))
Returns
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.

Parameters
posSigned value to move
Returns
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.

Parameters
pos_xSigned value to move
Returns
1 if function was successfully done, otherwise 0.

References udi_hid_mouse_move().

Referenced by ui_process().

bool udi_hid_mouse_moveY ( int8_t  pos_y)

Move the mouse pointer on Y axe.

Parameters
pos_ySigned value to move
Returns
1 if function was successfully done, otherwise 0.

References udi_hid_mouse_move().

Referenced by ui_process().

static void udi_hid_mouse_report_sent ( udd_ep_status_t  status,
iram_size_t  nb_sent,
udd_ep_id_t  ep 
)
static

Callback called when the report is sent.

Parameters
statusUDD_EP_TRANSFER_OK, if transfer finish
statusUDD_EP_TRANSFER_ABORT, if transfer aborted
nb_sentnumber of data transfered
Returns
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 bool udi_hid_mouse_send_report ( void  )
static
static bool udi_hid_mouse_setreport ( void  )
static

Callback for set report setup request.

Returns
1 always, because it is not used on mouse interface

Referenced by udi_hid_mouse_setup().

bool udi_hid_mouse_b_report_valid
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().

COMPILER_WORD_ALIGNED uint8_t udi_hid_mouse_protocol
static

To store current protocol of HID mouse.

Referenced by udi_hid_mouse_enable(), and udi_hid_mouse_setup().

COMPILER_WORD_ALIGNED uint8_t udi_hid_mouse_rate
static

To store current rate of HID mouse.

Referenced by udi_hid_mouse_enable(), and udi_hid_mouse_setup().

uint8_t udi_hid_mouse_report[UDI_HID_MOUSE_REPORT_SIZE]
static
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().

COMPILER_WORD_ALIGNED uint8_t udi_hid_mouse_report_trans[UDI_HID_MOUSE_REPORT_SIZE]
static

Buffer used to send report.

Referenced by udi_hid_mouse_send_report().

bool udi_hid_mouse_report_trans_ongoing
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().