参数资料
型号: DM240415
厂商: Microchip Technology
文件页数: 24/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)
if (device_attached == FALSE)
{
//Continue to the top of the while loop to start the check over again.
continue ;
}
//If the accessory is ready, then this is where we run all of the demo code
if (readInProgress == FALSE)
{
//This example shows how the handle is required for the transfer functions
errorCode = AndroidAppRead(device_handle,
(BYTE*)&command_packet,
(DWORD) sizeof (ACCESSORY_APP_PACKET));
//If the device is attached, then lets wait for a command from the application
if ( errorCode != USB_SUCCESS)
{
//Error
DEBUG_ERROR("Error trying to start read");
}
else
{
readInProgress = TRUE;
}
}
}
}
BOOL USB_ApplicationEventHandler( BYTE address, USB_EVENT event, void *data, DWORD size )
{
switch ( event )
{
//Android device has been removed.
case EVENT_ANDROID_DETACH:
device_attached = FALSE;
device_handle = NULL;
return TRUE;
break ;
19
//Android device has been added.
Must record the device handle
case EVENT_ANDROID_ATTACH:
device_attached = TRUE;
device_handle = data;
return TRUE;
//Handle other events here that are required...
//...
4.2.5 Sending Data
There
are
two
functions
that
are
associated
with
sending
data
from
the
Accessory
to
the
device:
23)() and AndroidAppWrite
26)() . The
see page 26)() function is used to send data from the Accessory to the Android device. The
AndroidAppIsWriteComplete ( see page 23)() function is used to determine if a previous transfer has completed.
Remember from the Keeping the Stack Running ( see page 18) section that the USBTasks() function needs to be called
4
in order to keep the stack running. This means that you shouldn't loop on the AndroidAppIsWriteComplete (
page 23)() function. Instead use either a state machine or booleans to indicate what you need to do.
while (1)
{
USBTasks();
//Do some extra stuff here to see if the buttons have updated
if ( writeInProgress == TRUE )
{
19
相关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