参数资料
型号: DM240415
厂商: Microchip Technology
文件页数: 19/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)
14
USB_ApplicationDataEventHandler() and USB_ApplicationEventHandler() for the pre-compiled example. For
the source example the function names are configurable through the usb_config.h ( see page 15) file (see the usb_config.h
see page 15) section for more information). For more detailed information about these functions or the USB library,
please refer to www.microchip.com/mal . This download includes the USB host library code as well as more detailed
documentation about that library.
The data events are consumed by the Android client driver. So the user application data event handler doesn't need to do
anything. It needs to be present for the library to link successfully but it can just return FALSE.
BOOL USB_ApplicationDataEventHandler( BYTE address, USB_EVENT event, void *data, DWORD size
)
{
return FALSE;
}
The regular event handler has a little more work that needs to be done. This handler notifies the user of device attach and
detach events. For Android devices this is covered in the Detecting a Connection/Disconnection to an Android Device ( see
page 18) section. This function also notifies the user about errors that might occur in the USB subsystem. These can be
useful for debugging development issues or logging issue once released in the field. The last important duty that this function
provides is determining if the power required by the attached device is available. This is done through the
EVENT_VBUS_REQUEST_POWER event. Remember in this event that the amount of power requested through the USB bus is
the power required/2, not the power required. Below is full implementation of the USB event handler that will work with a
single attached Android device.
BOOL USB_ApplicationEventHandler( BYTE address, USB_EVENT event, void *data, DWORD size )
{
switch ( event )
{
case EVENT_VBUS_REQUEST_POWER:
// The data pointer points to a byte that represents the amount of power
// requested in mA, divided by two. If the device wants too much power,
// we reject it.
if (((USB_VBUS_POWER_EVENT_DATA*)data)->current <= (MAX_ALLOWED_CURRENT / 2))
{
return TRUE;
}
else
{
DEBUG_ERROR( "Device requires too much current\r\n" );
}
break ;
case
case
case
case
case
case
case
case
EVENT_VBUS_RELEASE_POWER:
EVENT_HUB_ATTACH:
EVENT_UNSUPPORTED_DEVICE:
EVENT_CANNOT_ENUMERATE:
EVENT_CLIENT_INIT_ERROR:
EVENT_OUT_OF_MEMORY:
EVENT_UNSPECIFIED_ERROR:
EVENT_DETACH:
//Fall-through
case EVENT_ANDROID_DETACH:
device_attached = FALSE;
return TRUE;
}
break ;
// Android Specific events
case EVENT_ANDROID_ATTACH:
device_attached = TRUE;
device_handle = data;
return TRUE;
default :
break ;
}
return FALSE;
14
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