Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Implementation of UHI HID Mouse

Class internal implementation.

Data Structures

struct  uhi_hid_mouse_dev_t
 

Index in HID report for usual HID mouse events

#define UHI_HID_MOUSE_BTN   0
 
#define UHI_HID_MOUSE_MOV_X   1
 
#define UHI_HID_MOUSE_MOV_Y   2
 
#define UHI_HID_MOUSE_MOV_SCROLL   3
 

Structure to store information about USB Device HID mouse

static uhi_hid_mouse_dev_t uhi_hid_mouse_dev
 

Internal routines

static void uhi_hid_mouse_start_trans_report (usb_add_t add)
 Starts the reception of the HID mouse report. More...
 
static void uhi_hid_mouse_report_reception (usb_add_t add, usb_ep_t ep, uhd_trans_status_t status, iram_size_t nb_transfered)
 Decodes the HID mouse report received. More...
 

Functions required by UHC

uhc_enum_status_t uhi_hid_mouse_install (uhc_device_t *dev)
 Install interface Allocate interface endpoints if supported. More...
 
void uhi_hid_mouse_enable (uhc_device_t *dev)
 Enable the interface. More...
 
void uhi_hid_mouse_uninstall (uhc_device_t *dev)
 Uninstall the interface (if installed). More...
 

#define UHI_HID_MOUSE_BTN   0
#define UHI_HID_MOUSE_MOV_SCROLL   3
#define UHI_HID_MOUSE_MOV_X   1
#define UHI_HID_MOUSE_MOV_Y   2

void uhi_hid_mouse_enable ( uhc_device_t dev)

Enable the interface.

Enable a USB interface corresponding to UHI.

Parameters
[in]uhc_device_tDevice to request

References uhc_device_t::address, uhi_hid_mouse_dev_t::dev, uhi_hid_mouse_dev_t::report_btn_prev, UHI_HID_MOUSE_CHANGE, and uhi_hid_mouse_start_trans_report().

static void uhi_hid_mouse_report_reception ( usb_add_t  add,
usb_ep_t  ep,
uhd_trans_status_t  status,
iram_size_t  nb_transfered 
)
static
static void uhi_hid_mouse_start_trans_report ( usb_add_t  add)
static

Starts the reception of the HID mouse report.

Parameters
addUSB address to use

References uhi_hid_mouse_dev_t::ep_in, uhi_hid_mouse_dev_t::report, uhi_hid_mouse_dev_t::report_size, uhd_ep_run(), and uhi_hid_mouse_report_reception().

Referenced by uhi_hid_mouse_enable(), and uhi_hid_mouse_report_reception().

void uhi_hid_mouse_uninstall ( uhc_device_t dev)

Uninstall the interface (if installed).

Parameters
[in]uhc_device_tDevice to request

References Assert, uhi_hid_mouse_dev_t::dev, NULL, uhi_hid_mouse_dev_t::report, and UHI_HID_MOUSE_CHANGE.

uhi_hid_mouse_dev_t uhi_hid_mouse_dev
static
Initial value:
= {
.dev = NULL,
.report = NULL,
}
#define NULL
Definition: def.h:47