DM240415 Microchip Technology, DM240415 Datasheet - Page 23

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

Related parts for DM240415