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 |
Referenced by uhi_hid_mouse_report_reception().
#define UHI_HID_MOUSE_MOV_SCROLL 3 |
Referenced by uhi_hid_mouse_report_reception().
#define UHI_HID_MOUSE_MOV_X 1 |
Referenced by uhi_hid_mouse_report_reception().
#define UHI_HID_MOUSE_MOV_Y 2 |
Referenced by uhi_hid_mouse_report_reception().
void uhi_hid_mouse_enable | ( | uhc_device_t * | dev | ) |
Enable the interface.
Enable a USB interface corresponding to UHI.
[in] | uhc_device_t | Device 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().
uhc_enum_status_t uhi_hid_mouse_install | ( | uhc_device_t * | dev | ) |
Install interface Allocate interface endpoints if supported.
[in] | uhc_device_t | Device to request |
References uhc_device_t::address, Assert, usb_iface_desc_t::bDescriptorType, usb_iface_desc_t::bInterfaceClass, usb_iface_desc_t::bInterfaceProtocol, usb_iface_desc_t::bLength, uhc_device_t::conf_desc, uhi_hid_mouse_dev_t::dev, dev, uhi_hid_mouse_dev_t::ep_in, HID_CLASS, HID_PROTOCOL_MOUSE, le16_to_cpu, NULL, uhi_hid_mouse_dev_t::report, uhi_hid_mouse_dev_t::report_size, uhc_device_t::speed, UHC_ENUM_HARDWARE_LIMIT, UHC_ENUM_MEMORY_LIMIT, UHC_ENUM_SOFTWARE_LIMIT, UHC_ENUM_SUCCESS, UHC_ENUM_UNSUPPORTED, uhd_ep_alloc(), USB_DT_ENDPOINT, USB_DT_INTERFACE, USB_EP_DIR_IN, and usb_conf_desc_t::wTotalLength.
|
static |
Decodes the HID mouse report received.
add | USB address used by the transfer |
status | Transfer status |
nb_transfered | Number of data transfered |
References uhi_hid_mouse_dev_t::report, uhi_hid_mouse_dev_t::report_btn_prev, UHD_TRANS_NOERROR, UHD_TRANS_NOTRESPONDING, UHD_TRANS_TIMEOUT, UHI_HID_MOUSE_BTN, UHI_HID_MOUSE_EVENT_BTN_LEFT, UHI_HID_MOUSE_EVENT_BTN_MIDDLE, UHI_HID_MOUSE_EVENT_BTN_RIGHT, UHI_HID_MOUSE_EVENT_MOUVE, UHI_HID_MOUSE_MOV_SCROLL, UHI_HID_MOUSE_MOV_X, UHI_HID_MOUSE_MOV_Y, uhi_hid_mouse_start_trans_report(), and UNUSED.
Referenced by uhi_hid_mouse_start_trans_report().
|
static |
Starts the reception of the HID mouse report.
add | USB 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).
[in] | uhc_device_t | Device to request |
References Assert, uhi_hid_mouse_dev_t::dev, NULL, uhi_hid_mouse_dev_t::report, and UHI_HID_MOUSE_CHANGE.
|
static |