DM240415 Microchip Technology, DM240415 Datasheet - Page 18

Accessory Development Starter Kit For Android General Purpose

DM240415

Manufacturer Part Number
DM240415
Description
Accessory Development Starter Kit For Android General Purpose
Manufacturer
Microchip Technology
Series
-r
Datasheet

Specifications of DM240415

Processor To Be Evaluated
PIC24FJ256GB110-I/PT
Processor Series
PIC24F
Data Bus Width
16 bit
Interface Type
USB
Operating Supply Voltage
3.3 V
Design Resources
PIC24F ADK Schematic
Main Purpose
Reference Design, Tablet
Embedded
Yes, MCU, 16-Bit
Utilized Ic / Part
PIC24F
Primary Attributes
Android OS, Development Platform for Accessories, Arduino Compatible
Secondary Attributes
Royalty Free, No Fee Licensed Software Library
Lead Free Status / Rohs Status
 Details

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
DM240415
Manufacturer:
MICROCHIP
Quantity:
12 000
Microchip's Accessory Framework for Android(tm)
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 14) file (see the usb_config.h
(
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,
)
{
}
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 17) 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,
{
}
see page 14) section for more information). For more detailed information about these functions or the USB library,
return
switch( event )
{
}
return
case
case
case
case
case
case
case
case
case
case
// Android Specific events
case
default
FALSE;
FALSE;
// The data pointer points to a byte that represents the amount of power
// requested in mA, divided by two.
// we reject it.
if
{
}
else
{
}
break;
device_attached = FALSE;
return
break;
device_attached = TRUE;
device_handle = data;
return
break;
EVENT_VBUS_REQUEST_POWER:
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
EVENT_ANDROID_DETACH:
EVENT_ANDROID_ATTACH:
(((USB_VBUS_POWER_EVENT_DATA*)data)->current <= (MAX_ALLOWED_CURRENT / 2))
return
DEBUG_ERROR( "Device requires too much current\r\n" );
:
TRUE;
TRUE;
TRUE;
If the device wants too much power,
void
void
*data, DWORD size )
*data, DWORD size
13
13
4

Related parts for DM240415