Microchip® Advanced Software Framework

uhi_aoa.c File Reference

Android Open Accessory.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include "conf_usb_host.h"
#include "usb_protocol_aoa.h"
#include "uhd.h"
#include "uhc.h"
#include "uhi_aoa.h"
#include <string.h>

Data Structures

struct  uhi_aoa_dev_t
 Stores relevant information about the USB connection. More...
 

Macros

#define AOA_V2_SUPPORT   0
 
Stages of enabling the Android Device
#define AOA_ENABLE_STAGE_PROCESSING   0
 
#define AOA_ENABLE_STAGE_SUCCESSFUL   1
 
#define AOA_ENABLE_STAGE_FAILED   2
 

Functions

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

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

Internal Defines and Variables to store information about the Accessory

#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"
 
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 AOA_V2_SUPPORT   0

Referenced by uhi_aoa_install().