Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
USB Host Interface (UHI) for Human Interface Device Mouse (HID Mouse)

USB Host Interface (UHI) for Human Interface Device Mouse (HID Mouse) provides an interface for the configuration and management of USB HID mouse host.

The outline of this documentation is as follows:

For more details for Atmel® Software Framework (ASF) USB Host Stack, refer to following application note:

API Overview

Interface with USB Host Core (UHC)

Define and functions required by UHC.

#define UHI_HID_MOUSE
 Global define which contains standard UHI API for UHC. 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...
 

UHI for Human Interface Device Mouse Class

Common APIs used by high level application to use this USB host class.

These APIs require only callback definitions in conf_usb_host.h file through following defines:

#define UHI_HID_MOUSE_CHANGE(dev, b_plug)
 
#define UHI_HID_MOUSE_EVENT_BTN_LEFT(b_state)
 
#define UHI_HID_MOUSE_EVENT_BTN_RIGHT(b_state)
 
#define UHI_HID_MOUSE_EVENT_BTN_MIDDLE(b_state)
 
#define UHI_HID_MOUSE_EVENT_MOUVE(x, y, scroll)
 

#define UHI_HID_MOUSE
Value:
{ \
.install = uhi_hid_mouse_install, \
.enable = uhi_hid_mouse_enable, \
.uninstall = uhi_hid_mouse_uninstall, \
.sof_notify = NULL, \
}
#define NULL
Definition: def.h:47
void uhi_hid_mouse_uninstall(uhc_device_t *dev)
Uninstall the interface (if installed).
Definition: uhi_hid_mouse.c:175
uhc_enum_status_t uhi_hid_mouse_install(uhc_device_t *dev)
Install interface Allocate interface endpoints if supported.
Definition: uhi_hid_mouse.c:104
void uhi_hid_mouse_enable(uhc_device_t *dev)
Enable the interface.
Definition: uhi_hid_mouse.c:163

Global define which contains standard UHI API for UHC.

It must be added in USB_HOST_UHI define from conf_usb_host.h file.

#define UHI_HID_MOUSE_CHANGE (   dev,
  b_plug 
)
#define UHI_HID_MOUSE_EVENT_BTN_LEFT (   b_state)
#define UHI_HID_MOUSE_EVENT_BTN_MIDDLE (   b_state)
#define UHI_HID_MOUSE_EVENT_BTN_RIGHT (   b_state)
#define UHI_HID_MOUSE_EVENT_MOUVE (   x,
  y,
  scroll 
)

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

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.