Common User Interface for application.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include "uhc.h"
Functions | |
Main user interface functions | |
void | ui_init (void) |
Initializes the user interface. 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... | |
Host mode user interface functions | |
void | ui_host_vbus_change (bool b_vbus_present) |
Notify that a Vbus are changed Available only in USB hardware with Vbus monitoring. More... | |
void | ui_host_vbus_error (void) |
Notify that a Vbus error has occurred Available only in USB hardware with Vbus monitoring. More... | |
void | ui_host_connection_event (uhc_device_t *dev, bool b_present) |
Notify that a USB device has been connected or disconnected. More... | |
void | ui_host_wakeup_event (void) |
Notify that a USB device or the host has wake up the USB line. More... | |
void | ui_host_sof_event (void) |
Notify that a SOF has been sent (each 1 ms) More... | |
void | ui_host_enum_event (uhc_device_t *dev, uhc_enum_status_t status) |
Notify the end of a USB device enumeration. More... | |
Callback to mange the HID mouse events | |
void | ui_host_hid_mouse_btn_left (bool b_state) |
void | ui_host_hid_mouse_btn_right (bool b_state) |
void | ui_host_hid_mouse_btn_middle (bool b_state) |
void | ui_host_hid_mouse_move (int8_t x, int8_t y, int8_t scroll) |
Device mode user interface functions | |
void | ui_device_suspend_action (void) |
Enters the user interface in low power mode Callback called when USB host sets USB line in suspend state. More... | |
void | ui_device_resume_action (void) |
Exits the user interface if the low power mode Callback called when USB host sets USB line in IDLE state. More... | |
void | ui_device_remotewakeup_enable (void) |
Enables the remotewakeup feature. More... | |
void | ui_device_remotewakeup_disable (void) |
Disables the remotewakeup feature. More... | |
bool | ui_device_mouse_enable (void) |
Enables the device mouse interface. More... | |
void | ui_device_mouse_disable (void) |
Disables the device mouse interface. More... | |
void | ui_device_sof_action (void) |
Scans the device mouse controls and shows the device status each USB SOF. More... | |
void ui_device_mouse_disable | ( | void | ) |
Disables the device mouse interface.
References ui_device_b_mouse_enable.
bool ui_device_mouse_enable | ( | void | ) |
Enables the device mouse interface.
References ui_device_b_mouse_enable.
void ui_device_remotewakeup_disable | ( | void | ) |
Disables the remotewakeup feature.
References ui_disable_asynchronous_interrupt().
void ui_device_remotewakeup_enable | ( | void | ) |
Enables the remotewakeup feature.
References ui_enable_asynchronous_interrupt().
void ui_device_resume_action | ( | void | ) |
void ui_device_sof_action | ( | void | ) |
Scans the device mouse controls and shows the device status each USB SOF.
References acc_update(), gpio_get_pin_value(), GPIO_PUSH_BUTTON_0, GPIO_PUSH_BUTTON_1, HID_MOUSE_BTN_DOWN, HID_MOUSE_BTN_UP, is_acc_abs_angle_x(), is_acc_abs_angle_y(), is_joystick_down(), is_joystick_pressed(), is_joystick_up(), LED2, LED_Off(), LED_On(), MOUSE_MOVE_RANGE, udd_get_frame_number(), udi_hid_mouse_btnleft(), udi_hid_mouse_btnmiddle(), udi_hid_mouse_btnright(), udi_hid_mouse_moveScroll(), udi_hid_mouse_moveX(), udi_hid_mouse_moveY(), and ui_device_b_mouse_enable.
void ui_device_suspend_action | ( | void | ) |
Enters the user interface in low power mode Callback called when USB host sets USB line in suspend state.
References ui_init().
void ui_host_connection_event | ( | uhc_device_t * | dev, |
bool | b_present | ||
) |
void ui_host_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 ui_host_enum_status, ui_host_scroll, ui_host_x, and ui_host_y.
void ui_host_hid_mouse_btn_left | ( | bool | b_state | ) |
References ui_host_hid_mouse_btn().
void ui_host_hid_mouse_btn_middle | ( | bool | b_state | ) |
References ui_host_hid_mouse_btn().
void ui_host_hid_mouse_btn_right | ( | bool | b_state | ) |
References ui_host_hid_mouse_btn().
void ui_host_hid_mouse_move | ( | int8_t | x, |
int8_t | y, | ||
int8_t | scroll | ||
) |
References ui_host_scroll, ui_host_x, and ui_host_y.
void ui_host_sof_event | ( | void | ) |
Notify that a SOF has been sent (each 1 ms)
References is_joystick_pressed(), LED1, LED2, LED3, LED_Off(), LED_On(), LED_Toggle(), uhc_suspend(), ui_enable_asynchronous_interrupt(), ui_host_enum_status, ui_host_scroll, ui_host_x, and ui_host_y.
void ui_host_vbus_change | ( | bool | b_vbus_present | ) |
void ui_host_vbus_error | ( | void | ) |
Notify that a Vbus error has occurred Available only in USB hardware with Vbus monitoring.
void ui_host_wakeup_event | ( | void | ) |
Notify that a USB device or the host has wake up the USB line.
References ui_disable_asynchronous_interrupt().
void ui_init | ( | void | ) |
Initializes the user interface.
References acc_init(), LED0, LED1, LED2, LED3, LED_Off(), SYSCLK_ADC, and sysclk_enable_pba_module().
Referenced by main(), and ui_device_suspend_action().