DM240415 Microchip Technology, DM240415 Datasheet - Page 20

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.1.4
#define
#define
#define
#define
#define
#define
#define
For more information about the usb_config.h file, please refer to the MCHPFSUSB stack help file.
The usb_config.c file is only required for those working with the source code implementation of the library. This file is not
used in the pre-compiled version of the library.
There are two main sections to the usb_config.c file. The first is the Targeted Peripheral List (TPL). The TPL is defied by the
USB OTG specification as the list of devices that are allowed to enumerate on the device. The TPL is just an array of
USB_TPL objects that specify the devices that can be attached. There are two ways that these devices are entered into the
table. They are either entered as Class/Subclass/Protocol pairs (CL/SC/P). The second method is by Vendor ID (VID) and
Product ID (PID) pairs. This will allow a specific device, not device type, to enumerate.
There are two entries that are needed for Android devices. Since each Android device may appear different to the host
controller, there isn't an easy way to add support for a given Class/Subclass/Protocol pair since each Android device might
expose different USB interface types. Likewise, since there isn't a list of all VID/PIDs for Android devices, and this
implementation isn't future-proof, you can use the normal VID/PID entry either. For cases like these Microchip has
implemented the VID/PID combination of 0xFFFF/0xFFFF to indicate that this driver should enumerate every device
regardless of its interfaces or its actual VID/PID pair.
The other entry in the table is the entry for the Android device once it has actually entered accessory mode. This can be
either entered using the CL/SC/P of the Accessory interface or the magic VID/PID combinations specified by Google Inc.
The magic VID/PID combination method is probably the preferred method (seen below):
// *****************************************************************************
// USB Embedded Host Targeted Peripheral List (TPL)
// *****************************************************************************
USB_TPL usbTPL[] =
{
};
All of the entries that correspond to the Android accessory device should point to the entry in the Client Driver table the
corresponds to the Android drivers. In the above example all three entries point to the client driver entry 0 (as noted by entry
[3] set to 0). The client driver table needs register the functions used by each driver. The functions that need to be registered
are the Initialization function, the event handler, the data event handler (if implemented), and the initialization flags value
(see example below).
// *****************************************************************************
{
}
{
}
---------------------------------------------------------------------
---------------------------------------------------------------------*/
{ INIT_VID_PID( 0x18D1ul, 0x2D00ul ), 0, 0, {0} },
{ INIT_VID_PID( 0x18D1ul, 0x2D01ul ), 0, 0, {0} },
{ INIT_VID_PID( 0xFFFFul, 0xFFFFul ), 0, 0, {0} },
/*[1] Device identification information
usb_config.c
USB_SUPPORT_BULK_TRANSFERS
USB_NUM_INTERRUPT_NAKS 3
USB_INITIAL_VBUS_CURRENT (100/2)
USB_INSERT_TIME (250+1)
USB_HOST_APP_EVENT_HANDLER USB_ApplicationEventHandler
USBTasks()
USBHostTasks();
AndroidTasks();
USBInitialize(x)
USBHostInit(x);
[2] Initial USB configuration to use
[3] Client driver table entry
[4] Flags (HNP supported, client driver entry, SetConfiguration() commands allowed
[1]
\
\
\
\
\
\
\
[2][3] [4]
// Android accessory
// Android accessory
// Enumerates everything
15
15
4

Related parts for DM240415