Common User Interface for USB host Android Open Accessory Protocol.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include "uhc.h"
Macros | |
Commands from accessory to Android device | |
#define | MESSAGE_ATD_SIMPLE_SWITCH 0x01 |
#define | MESSAGE_ATD_SENSOR_TEMPERATURE 0x10 |
#define | MESSAGE_ATD_SENSOR_LIGHT 0x11 |
Commands from Android device to accessory | |
#define | MESSAGE_DTA_SIMPLE_LED 0x02 |
#define | MESSAGE_DTA_SIMPLE_DISPLAY_BACKLIGHT 0x03 |
#define | MESSAGE_DTA_STRING_BASIC 0x20 |
Functions | |
void | read_complete (usb_add_t add, usb_ep_t ep, uhd_trans_status_t, iram_size_t) |
Called when Bulk IN Transfer is finished. More... | |
void | ui_init (void) |
Initializes the user interface. More... | |
void | ui_uhi_aoa_change (uhc_device_t *dev, bool b_plug) |
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 process. More... | |
void | ui_usb_message_reception (void) |
Processing of a Message from the Android device. More... | |
void | ui_usb_mode_change (bool b_host_mode) |
Notify that the USB mode is switched automatically. This is only possible when the 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 is 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 woke up the USB line. More... | |
#define MESSAGE_ATD_SENSOR_LIGHT 0x11 |
#define MESSAGE_ATD_SENSOR_TEMPERATURE 0x10 |
#define MESSAGE_ATD_SIMPLE_SWITCH 0x01 |
#define MESSAGE_DTA_SIMPLE_DISPLAY_BACKLIGHT 0x03 |
#define MESSAGE_DTA_SIMPLE_LED 0x02 |
#define MESSAGE_DTA_STRING_BASIC 0x20 |
void read_complete | ( | usb_add_t | add, |
usb_ep_t | ep, | ||
uhd_trans_status_t | , | ||
iram_size_t | |||
) |
Called when Bulk IN Transfer is finished.
void ui_init | ( | void | ) |
Initializes the user interface.
void ui_uhi_aoa_change | ( | uhc_device_t * | dev, |
bool | b_plug | ||
) |
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 |
void ui_usb_enum_event | ( | uhc_device_t * | dev, |
uhc_enum_status_t | status | ||
) |
Notify the end of a USB device enumeration process.
dev | Pointer on USB device information |
status | Status of the USB enumeration |
void ui_usb_message_reception | ( | void | ) |
Processing of a Message from the Android device.
void ui_usb_mode_change | ( | bool | b_host_mode | ) |
Notify that the USB mode is switched automatically. This is only possible when the ID pin is available.
b_host_mode | true, if the host mode has been selected |
void ui_usb_sof_event | ( | void | ) |
Notify that a SOF has been sent (each 1 ms)
void ui_usb_vbus_change | ( | bool | b_vbus_present | ) |
Notify that a Vbus is changed Available only in USB hardware with Vbus monitoring.
b_vbus_present | true, if Vbus is high. |
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 woke up the USB line.