USBLibAPIGuide  1.00.00.01
Data Structures | Macros | Functions | Variables
Composite_device_class_api

Data Structures

struct  tUSBDCompositeEntry
 
struct  tCompositeInstance
 
struct  tUSBDCompositeDevice
 

Macros

#define LOOKUP_INDEX_BYTE   0
 
#define LOOKUP_INTERFACE_BYTE   1
 
#define LOOKUP_IN_END_BYTE   2
 
#define LOOKUP_OUT_END_BYTE   3
 
#define INVALID_DEVICE_INDEX   0xFFFFFFFF
 

Functions

uint32_t BuildCompositeDescriptor (tUSBDCompositeDevice *psCompDevice)
 
void * USBDCompositeInit (uint32_t ui32Index, tUSBDCompositeDevice *psDevice, uint32_t ui32Size, uint8_t *pui8Data)
 
void USBDCompositeTerm (void *pvCompositeInstance)
 

Variables

tConfigHeaderg_ppCompConfigDescriptors [1]
 
const tCustomHandlers g_sCompHandlers
 

Detailed Description

Macro Definition Documentation

§ LOOKUP_INDEX_BYTE

#define LOOKUP_INDEX_BYTE   0

§ LOOKUP_INTERFACE_BYTE

#define LOOKUP_INTERFACE_BYTE   1

§ LOOKUP_IN_END_BYTE

#define LOOKUP_IN_END_BYTE   2

§ LOOKUP_OUT_END_BYTE

#define LOOKUP_OUT_END_BYTE   3

§ INVALID_DEVICE_INDEX

#define INVALID_DEVICE_INDEX   0xFFFFFFFF

Referenced by USBDCompositeInit().

Function Documentation

§ BuildCompositeDescriptor()

uint32_t BuildCompositeDescriptor ( tUSBDCompositeDevice psCompDevice)

§ USBDCompositeInit()

void * USBDCompositeInit ( uint32_t  ui32Index,
tUSBDCompositeDevice psDevice,
uint32_t  ui32Size,
uint8_t *  pui8Data 
)

This function should be called once for the composite class device to initialize basic operation and prepare for enumeration.

Parameters
ui32Indexis the index of the USB controller to initialize for composite device operation.
psDevicepoints to a structure containing parameters customizing the operation of the composite device.
ui32Sizeis the size in bytes of the data pointed to by the pui8Data parameter.
pui8Datais the data area that the composite class can use to build up descriptors.

In order for an application to initialize the USB composite device class, it must first call this function with the a valid composite device class structure in the psDevice parameter. This allows this function to initialize the USB controller and device code to be prepared to enumerate and function as a USB composite device. The ui32Size and pui8Data parameters should be large enough to hold all of the class instances passed in via the psDevice structure. This is typically the full size of the configuration descriptor for a device minus its configuration header(9 bytes).

This function returns a void pointer that must be passed in to all other APIs used by the composite class.

See the documentation on the tUSBDCompositeDevice structure for more information on how to properly fill the structure members.

Returns
This function returns 0 on failure or a non-zero void pointer on success.

References g_sCompHandlers, INVALID_DEVICE_INDEX, tUSBDCompositeDevice::ppui8StringDescriptors, tDeviceInfo::psCallbacks, tCompositeInstance::pui8Data, tDeviceInfo::pui8DeviceDescriptor, tCompositeInstance::sDevInfo, tUSBDCompositeDevice::sPrivateData, tCompositeInstance::ui32DataSize, tCompositeInstance::ui32EP0Owner, tCompositeInstance::ui32USBBase, and USBIndexToBase.

§ USBDCompositeTerm()

void USBDCompositeTerm ( void *  pvCompositeInstance)

Shuts down the composite device.

Parameters
pvCompositeInstanceis the pointer to the device instance structure as returned by USBDCompositeInit().

This function terminates composite device interface for the instance not me supplied. Following this call, the pvCompositeInstance instance should not be used in any other calls.

Returns
None.

Variable Documentation

§ g_ppCompConfigDescriptors

tConfigHeader* g_ppCompConfigDescriptors[1]

§ g_sCompHandlers

const tCustomHandlers g_sCompHandlers

Referenced by USBDCompositeInit().

© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale