Modules | |
Related Project(s) | |
In this section you can find all the projects related to the UHI for Android Open Accessory. | |
Data Structures | |
struct | uhi_aoa_dev_t |
Stores relevant information about the USB connection. More... | |
Macros | |
#define | UHI_AOA |
Global structure which contains standard UHI API for UHC. More... | |
Variables | |
volatile uint8_t | uhi_aoa_enable_stage |
Stores the status of the process enabling the Accessory device. More... | |
volatile uint16_t | uhi_aoa_protocol |
Stores the "Android Open Accessory Protocol" version. More... | |
Stages of enabling the Android Device | |
#define | AOA_ENABLE_STAGE_PROCESSING 0 |
#define | AOA_ENABLE_STAGE_SUCCESSFUL 1 |
#define | AOA_ENABLE_STAGE_FAILED 2 |
Internal Defines and Variables to store information about the Accessory | |
static struct uhi_aoa_dev_t | uhi_aoa_dev |
void | uhi_aoa_mode_enable_step1 (uhc_device_t *) |
Function to enable the Accessory Mode on Android Devices. More... | |
void | uhi_aoa_mode_enable_step2 (usb_add_t, uhd_trans_status_t, uint16_t) |
Function to enable the Accessory Mode on Android Devices. More... | |
void | uhi_aoa_mode_enable_step3 (usb_add_t, uhd_trans_status_t, uint16_t) |
Function to enable the Accessory Mode on Android Devices. More... | |
void | uhi_aoa_mode_enable_complete (usb_add_t, uhd_trans_status_t, uint16_t) |
Function to enable the Accessory Mode on Android Devices. More... | |
static void | uhi_aoa_enable_success (void) |
Function to end AoA enabling success. More... | |
#define | uhi_aoa_dev_sel (&uhi_aoa_dev) |
Current USB device AOA selected by the UHI AOA. More... | |
#define | AOA_STRING_MANUFACTURER "Atmel" |
#define | AOA_STRING_MODEL "EVK1105" |
#define | AOA_STRING_DESCRIPTION "EVK1105 Application Board" |
#define | AOA_STRING_VERSION "1.0" |
#define | AOA_STRING_URL "http://www.microchip.com/design-centers/smartphone-accessory" |
#define | AOA_STRING_SERIAL "0000000012345678" |
Functions required by UHC | |
uhc_enum_status_t | uhi_aoa_install (uhc_device_t *dev) |
Functions required by UHC. More... | |
void | uhi_aoa_enable (uhc_device_t *dev) |
void | uhi_aoa_uninstall (uhc_device_t *dev) |
Routines to initialize the Android device | |
void | uhi_aoa_send_info_string (uint8_t, char *, uhd_callback_setup_end_t) |
Function to send Identifying Information to the Android Device. More... | |
bool | uhi_aoa_configure (uhc_device_t *) |
Tries to configure bulk Endpoints for the Android Accessory. More... | |
void | main_event_aoa (uhc_device_t *, bool) |
Takes care of Devices being attached/detached. More... | |
Routines to communicate with the Android device | |
bool | uhi_aoa_read (uint8_t *payload, uint16_t payload_size, uhd_callback_trans_t callback_end) |
Main Function to receive a message from an Android device. More... | |
bool | uhi_aoa_write (uint8_t *payload, uint16_t payload_size, uhd_callback_trans_t callback_end) |
Main Function to send a message to an Android device. More... | |
bool | uhi_aoa_register_hid (uint16_t id, uint8_t *hid_rpt_desc, uint16_t hid_rpt_desc_len) |
Register a HID device. More... | |
bool | uhi_aoa_unregister_hid (uint16_t id) |
Unregister a HID device. More... | |
bool | uhi_aoa_send_hid_event (uint16_t id, void *hid_rpt, uint16_t rpt_size) |
Send HID events. More... | |
#define AOA_ENABLE_STAGE_FAILED 2 |
Referenced by uhi_aoa_mode_enable_complete(), uhi_aoa_mode_enable_step2(), and uhi_aoa_mode_enable_step3().
#define AOA_ENABLE_STAGE_PROCESSING 0 |
Referenced by uhi_aoa_enable(), and uhi_aoa_install().
#define AOA_ENABLE_STAGE_SUCCESSFUL 1 |
Referenced by uhi_aoa_enable(), uhi_aoa_install(), uhi_aoa_mode_enable_complete(), and uhi_aoa_register_hid().
#define AOA_STRING_DESCRIPTION "EVK1105 Application Board" |
Referenced by uhi_aoa_mode_enable_step2().
#define AOA_STRING_MANUFACTURER "Atmel" |
Referenced by uhi_aoa_mode_enable_step2().
#define AOA_STRING_MODEL "EVK1105" |
Referenced by uhi_aoa_mode_enable_step2().
#define AOA_STRING_SERIAL "0000000012345678" |
Referenced by uhi_aoa_mode_enable_step2().
#define AOA_STRING_URL "http://www.microchip.com/design-centers/smartphone-accessory" |
Referenced by uhi_aoa_mode_enable_step2().
#define AOA_STRING_VERSION "1.0" |
Referenced by uhi_aoa_mode_enable_step2().
#define UHI_AOA |
Global structure which contains standard UHI API for UHC.
#define uhi_aoa_dev_sel (&uhi_aoa_dev) |
Current USB device AOA selected by the UHI AOA.
void main_event_aoa | ( | uhc_device_t * | , |
bool | |||
) |
Takes care of Devices being attached/detached.
bool uhi_aoa_configure | ( | uhc_device_t * | ) |
Tries to configure bulk Endpoints for the Android Accessory.
void uhi_aoa_enable | ( | uhc_device_t * | dev | ) |
|
static |
Function to end AoA enabling success.
References uhi_aoa_dev_t::dev, and uhi_aoa_protocol.
Referenced by uhi_aoa_enable(), and uhi_aoa_mode_enable_complete().
uhc_enum_status_t uhi_aoa_install | ( | uhc_device_t * | dev | ) |
Functions required by UHC.
References uhc_device_t::address, AOA_ACCESSORY_ADB_PID, AOA_ACCESSORY_AUDIO_ADB_PID, AOA_ACCESSORY_AUDIO_PID, AOA_ACCESSORY_PID, AOA_ENABLE_STAGE_PROCESSING, AOA_ENABLE_STAGE_SUCCESSFUL, AOA_V2_SUPPORT, Assert, usb_iface_desc_t::bDescriptorType, usb_ep_desc_t::bEndpointAddress, usb_iface_desc_t::bInterfaceClass, usb_iface_desc_t::bLength, CLASS_VENDOR_SPECIFIC, uhc_device_t::conf_desc, uhi_aoa_dev_t::dev, dev, uhc_device_t::dev_desc, uhi_aoa_dev_t::ep_in, uhi_aoa_dev_t::ep_out, GOOGLE_VID, usb_dev_desc_t::idProduct, usb_dev_desc_t::idVendor, le16_to_cpu, NULL, uhc_device_t::speed, UHC_ENUM_HARDWARE_LIMIT, UHC_ENUM_SOFTWARE_LIMIT, UHC_ENUM_SUCCESS, UHC_ENUM_UNSUPPORTED, uhd_ep_alloc(), uhd_ep_free(), uhi_aoa_enable_stage, USB_DT_ENDPOINT, USB_DT_INTERFACE, USB_EP_DIR_IN, and usb_conf_desc_t::wTotalLength.
void uhi_aoa_mode_enable_complete | ( | usb_add_t | add, |
uhd_trans_status_t | status, | ||
uint16_t | payload_trans | ||
) |
Function to enable the Accessory Mode on Android Devices.
References AOA_ENABLE_STAGE_FAILED, AOA_ENABLE_STAGE_SUCCESSFUL, UHD_TRANS_NOERROR, uhi_aoa_enable_stage, and uhi_aoa_enable_success().
Referenced by uhi_aoa_mode_enable_step3().
void uhi_aoa_mode_enable_step1 | ( | uhc_device_t * | dev | ) |
Function to enable the Accessory Mode on Android Devices.
References uhc_device_t::address, usb_setup_req_t::bmRequestType, usb_setup_req_t::bRequest, uhi_aoa_dev_t::dev, dev, NULL, uhd_setup_request(), uhi_aoa_mode_enable_step2(), uhi_aoa_protocol, USB_REQ_AOA_GET_PROTOCOL, USB_REQ_DIR_IN, USB_REQ_RECIP_DEVICE, USB_REQ_TYPE_VENDOR, usb_setup_req_t::wIndex, usb_setup_req_t::wLength, and usb_setup_req_t::wValue.
Referenced by uhi_aoa_enable().
void uhi_aoa_mode_enable_step2 | ( | usb_add_t | add, |
uhd_trans_status_t | status, | ||
uint16_t | payload_trans | ||
) |
Function to enable the Accessory Mode on Android Devices.
References AOA_ENABLE_STAGE_FAILED, AOA_STRING_DESCRIPTION, AOA_STRING_INDEX_DESCRIPTION, AOA_STRING_INDEX_MANUFACTURER, AOA_STRING_INDEX_MODEL, AOA_STRING_INDEX_SERIAL, AOA_STRING_INDEX_URL, AOA_STRING_INDEX_VERSION, AOA_STRING_MANUFACTURER, AOA_STRING_MODEL, AOA_STRING_SERIAL, AOA_STRING_URL, AOA_STRING_VERSION, le16_to_cpu, NULL, UHD_TRANS_NOERROR, uhi_aoa_enable_stage, uhi_aoa_mode_enable_step3(), uhi_aoa_protocol, and uhi_aoa_send_info_string().
Referenced by uhi_aoa_mode_enable_step1().
void uhi_aoa_mode_enable_step3 | ( | usb_add_t | add, |
uhd_trans_status_t | status, | ||
uint16_t | payload_trans | ||
) |
Function to enable the Accessory Mode on Android Devices.
References uhc_device_t::address, AOA_ENABLE_STAGE_FAILED, usb_setup_req_t::bmRequestType, usb_setup_req_t::bRequest, uhi_aoa_dev_t::dev, NULL, uhd_setup_request(), UHD_TRANS_NOERROR, uhi_aoa_enable_stage, uhi_aoa_mode_enable_complete(), USB_REQ_AOA_STARTUP, USB_REQ_DIR_OUT, USB_REQ_RECIP_DEVICE, USB_REQ_TYPE_VENDOR, usb_setup_req_t::wIndex, usb_setup_req_t::wLength, and usb_setup_req_t::wValue.
Referenced by uhi_aoa_mode_enable_step2().
bool uhi_aoa_read | ( | uint8_t * | payload, |
uint16_t | payload_size, | ||
uhd_callback_trans_t | callback_end | ||
) |
Main Function to receive a message from an Android device.
payload | Pointer on the data to transfer |
payload_size | Size of the data to transfer |
callback_end | Callback to call at the end of transfer |
References uhc_device_t::address, uhi_aoa_dev_t::dev, uhi_aoa_dev_t::ep_in, and uhd_ep_run().
bool uhi_aoa_register_hid | ( | uint16_t | id, |
uint8_t * | hid_rpt_desc, | ||
uint16_t | hid_rpt_desc_len | ||
) |
Register a HID device.
[in] | id | ID for the HID device |
[in] | hid_rpt_desc | Pointer to the HID report descriptor |
[in] | hid_rpt_desc_len | Total length of the HID report descriptor |
References uhc_device_t::address, AOA_ENABLE_STAGE_SUCCESSFUL, usb_dev_desc_t::bMaxPacketSize0, usb_setup_req_t::bmRequestType, usb_setup_req_t::bRequest, cpu_to_le16, uhi_aoa_dev_t::dev, uhc_device_t::dev_desc, NULL, off(), uhd_setup_request(), uhi_aoa_enable_stage, USB_REQ_AOA_REGISTER_HID, USB_REQ_AOA_SET_HID_RPT_DESC, USB_REQ_DIR_OUT, USB_REQ_RECIP_DEVICE, USB_REQ_TYPE_VENDOR, usb_setup_req_t::wIndex, usb_setup_req_t::wLength, and usb_setup_req_t::wValue.
bool uhi_aoa_send_hid_event | ( | uint16_t | id, |
void * | hid_rpt, | ||
uint16_t | rpt_size | ||
) |
Send HID events.
[in] | id | ID for the HID device |
[in] | hid_rpt | Pointer to the HID report for the event, the report format and data length should follow what is defined in HID report descriptor. |
[in] | rpt_size | The HID report size |
References uhc_device_t::address, usb_setup_req_t::bmRequestType, usb_setup_req_t::bRequest, cpu_to_le16, uhi_aoa_dev_t::dev, NULL, uhd_setup_request(), USB_REQ_AOA_SEND_HID_EVENT, USB_REQ_DIR_OUT, USB_REQ_RECIP_DEVICE, USB_REQ_TYPE_VENDOR, usb_setup_req_t::wIndex, usb_setup_req_t::wLength, and usb_setup_req_t::wValue.
void uhi_aoa_send_info_string | ( | uint8_t | , |
char * | , | ||
uhd_callback_setup_end_t | |||
) |
Function to send Identifying Information to the Android Device.
References uhc_device_t::address, usb_setup_req_t::bmRequestType, usb_setup_req_t::bRequest, uhi_aoa_dev_t::dev, NULL, uhd_setup_request(), USB_REQ_AOA_SEND_IDENT_STRING, USB_REQ_DIR_OUT, USB_REQ_RECIP_DEVICE, USB_REQ_TYPE_VENDOR, usb_setup_req_t::wIndex, usb_setup_req_t::wLength, and usb_setup_req_t::wValue.
Referenced by uhi_aoa_mode_enable_step2().
void uhi_aoa_uninstall | ( | uhc_device_t * | dev | ) |
References uhi_aoa_dev_t::dev, uhi_aoa_dev_t::ep_in, uhi_aoa_dev_t::ep_out, and NULL.
bool uhi_aoa_unregister_hid | ( | uint16_t | id | ) |
Unregister a HID device.
[in] | id | ID for HID device |
References uhc_device_t::address, usb_setup_req_t::bmRequestType, usb_setup_req_t::bRequest, cpu_to_le16, uhi_aoa_dev_t::dev, NULL, uhd_setup_request(), USB_REQ_AOA_UNREGISTER_HID, USB_REQ_DIR_OUT, USB_REQ_RECIP_DEVICE, USB_REQ_TYPE_VENDOR, usb_setup_req_t::wIndex, usb_setup_req_t::wLength, and usb_setup_req_t::wValue.
bool uhi_aoa_write | ( | uint8_t * | payload, |
uint16_t | payload_size, | ||
uhd_callback_trans_t | callback_end | ||
) |
Main Function to send a message to an Android device.
payload | Pointer on the data to transfer |
payload_size | Size of the data to transfer |
callback_end | Callback to call at the end of transfer |
References uhc_device_t::address, uhi_aoa_dev_t::dev, uhi_aoa_dev_t::ep_out, and uhd_ep_run().
|
static |
volatile uint8_t uhi_aoa_enable_stage |
Stores the status of the process enabling the Accessory device.
Referenced by uhi_aoa_enable(), uhi_aoa_install(), uhi_aoa_mode_enable_complete(), uhi_aoa_mode_enable_step2(), uhi_aoa_mode_enable_step3(), and uhi_aoa_register_hid().
volatile uint16_t uhi_aoa_protocol |
Stores the "Android Open Accessory Protocol" version.
Referenced by uhi_aoa_enable_success(), uhi_aoa_mode_enable_step1(), and uhi_aoa_mode_enable_step2().