参数资料
型号: DM240415
厂商: Microchip Technology
文件页数: 23/63页
文件大小: 0K
描述: ACCESSORY DEVELOPMENT START KIT
设计资源: PIC24F ADK Schematic
特色产品: DM240415 Android? Accessory Starter Kit
标准包装: 1
主要目的: 参考设计,平板式
嵌入式: 是,MCU,16 位
已用 IC / 零件: PIC24F
主要属性: 机器人 OS,附件开发平台,兼容 Arduino
次要属性: 免版税,免软件库许可费
已供物品: 电路板,适配器,调试程序,电源,软件
Microchip's Accessory Framework for Android(tm)
18
4.2.3 Keeping the Stack Running
The Microchip USB host stack receives and logs events via an interrupt handler, but processes them as the USBTasks() (or
USBHostTasks()) function is called. This limits the amount of time spent in an interrupt context and helps limit context related
issues. This means that in order to keep the USB host stack running, the USBTasks() function needs to be called
periodically in order to keep processing these events.
int main( void )
{
//Initialize the USB stack
USBInitialize(0);
//Pass my accessory information to the Android client driver
AndroidAppStart(&myDeviceInfo);
while (1)
{
//Keep the USB stack running
USBTasks();
//Do my application specific stuff here
//...
}
}
The rate at which USBTasks() is called will contribute to determining the throughput that the stack is able to get, the
timeliness of the data reception, and the accuracy and latency of the events thrown from the stack.
4.2.4 Detecting a Connection/Disconnection to an Android
Device
The USB Host stack notifies users of attachment and detachment events through an event handler call back function. The
name of this function is configurable in source code projects. In pre-compiled projects, this function is named
USB_ApplicationEventHandler() .
The Android client driver uses this same event handler function to notify the user of the attachment or detachment of Android
devices.
The
Android
client
driver
adds
the
and
see page 33) events. These two events are key to interfacing to the attached Android
device. The data field of the attach event provides the handle to the Android device. This handle must be passed to all of
the read/write functions to it is important to save this information when it is received. Similarly the detach event specifies the
handle of the device that detached so that the application knows which device detached (if multiple devices are attached).
void * device_handle = NULL;
static BOOL device_attached = FALSE;
int main( void )
{
//Initialize the USB stack
USBInitialize(0);
//Send the accessory information to the Android client driver
AndroidAppStart(&myDeviceInfo);
while (1)
{
//Keep the USB stack running
USBTasks();
//If the device isn't attached yet,
18
4
相关PDF资料
PDF描述
DM300004-2 BOARD DEMO DSPICDEM.NET 2
DM300014 BOARD DEMO DSPICDEM 1.1 GEN PURP
DM300016 BOARD DEMO DSPICDEM STARTER
DM300017 BOARD DEMO DSPICDEM STARTER
DM300020 BOARD DEV DSPICDEM MC1 MOTORCTRL
相关代理商/技术参数
参数描述
DM2410-0AL1 制造商:未知厂家 制造商全称:未知厂家 功能描述:Optoelectronic
DM2410-0BL1 制造商:未知厂家 制造商全称:未知厂家 功能描述:Optoelectronic
DM2410-0CL1 制造商:未知厂家 制造商全称:未知厂家 功能描述:Optoelectronic
DM2410-0DL1 制造商:未知厂家 制造商全称:未知厂家 功能描述:Optoelectronic
DM2410-0GL1 制造商:未知厂家 制造商全称:未知厂家 功能描述:Optoelectronic