Common User Interface for USB host HID mouse application.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include "uhc.h"
Functions | |
void | ui_init (void) |
Initializes the user interface. More... | |
void | ui_usb_connection_event (uhc_device_t *dev, bool b_present) |
Notify that a USB device has been connected or disconnected. More... | |
void | ui_usb_enum_event (uhc_device_t *dev, uhc_enum_status_t status) |
Notify the end of a USB device enumeration. More... | |
void | ui_usb_mode_change (bool b_host_mode) |
Notify that the USB mode are switched automatically. This is possible only when ID pin is available. More... | |
void | ui_usb_sof_event (void) |
Notify that a SOF has been sent (each 1 ms) More... | |
void | ui_usb_vbus_change (bool b_vbus_present) |
Notify that a Vbus are changed Available only in USB hardware with Vbus monitoring. More... | |
void | ui_usb_vbus_error (void) |
Notify that a Vbus error has occurred Available only in USB hardware with Vbus monitoring. More... | |
void | ui_usb_wakeup_event (void) |
Notify that a USB device or the host has wake up the USB line. More... | |
Callback to mange the HID mouse events | |
void | ui_uhi_hid_mouse_btn_left (bool b_state) |
void | ui_uhi_hid_mouse_btn_right (bool b_state) |
void | ui_uhi_hid_mouse_btn_middle (bool b_state) |
void | ui_uhi_hid_mouse_move (int8_t x, int8_t y, int8_t scroll) |
void ui_init | ( | void | ) |
void ui_uhi_hid_mouse_btn_left | ( | bool | b_state | ) |
References ui_uhi_hid_mouse_btn().
void ui_uhi_hid_mouse_btn_middle | ( | bool | b_state | ) |
References ui_uhi_hid_mouse_btn().
void ui_uhi_hid_mouse_btn_right | ( | bool | b_state | ) |
References ui_uhi_hid_mouse_btn().
void ui_usb_connection_event | ( | uhc_device_t * | dev, |
bool | b_present | ||
) |
Notify that a USB device has been connected or disconnected.
dev | Pointer on USB device information |
b_present | true, if the device has been connected |
References LED_0_PIN, LED_On, ui_enum_status, and UNUSED.
void ui_usb_enum_event | ( | uhc_device_t * | dev, |
uhc_enum_status_t | status | ||
) |
Notify the end of a USB device enumeration.
dev | Pointer on USB device information |
status | Status of the USB enumeration |
References UHD_SPEED_FULL, UHD_SPEED_HIGH, UHD_SPEED_LOW, ui_device_speed_blink, and ui_enum_status.
void ui_usb_mode_change | ( | bool | b_host_mode | ) |
void ui_usb_sof_event | ( | void | ) |
Notify that a SOF has been sent (each 1 ms)
References BUTTON_0_PIN, LED_0_PIN, LED_Off, LED_On, LED_Toggle, port_pin_get_input_level(), uhc_suspend(), ui_device_speed_blink, ui_enable_asynchronous_interrupt(), ui_enum_status, ui_move, and ui_nb_down.
void ui_usb_vbus_change | ( | bool | b_vbus_present | ) |
Notify that a Vbus are changed Available only in USB hardware with Vbus monitoring.
b_vbus_present | true, if Vbus is high. |
References UNUSED.
void ui_usb_vbus_error | ( | void | ) |
Notify that a Vbus error has occurred Available only in USB hardware with Vbus monitoring.
void ui_usb_wakeup_event | ( | void | ) |
Notify that a USB device or the host has wake up the USB line.
References ui_disable_asynchronous_interrupt().