USBLibAPIGuide
1.00.00.01
|
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 | |
tConfigHeader * | g_ppCompConfigDescriptors [1] |
const tCustomHandlers | g_sCompHandlers |
#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 |
Referenced by USBDCompositeInit().
uint32_t BuildCompositeDescriptor | ( | tUSBDCompositeDevice * | psCompDevice | ) |
References tCompositeInstance::ppsCompSections, tDeviceInfo::ppsConfigDescriptors, tCompositeInstance::psCompSections, tUSBDCompositeDevice::psDevices, tCompositeEntry::psDevInfo, tConfigHeader::psSections, tCompositeInstance::pui8Data, tConfigSection::pui8Data, tCompositeInstance::sConfigDescriptor, tUSBDCompositeDevice::sPrivateData, tConfigSection::ui16Size, tCompositeInstance::ui32DataSize, tConfigHeader::ui8NumSections, and USB_DTYPE_INTERFACE.
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.
ui32Index | is the index of the USB controller to initialize for composite device operation. |
psDevice | points to a structure containing parameters customizing the operation of the composite device. |
ui32Size | is the size in bytes of the data pointed to by the pui8Data parameter. |
pui8Data | is 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.
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.
void USBDCompositeTerm | ( | void * | pvCompositeInstance | ) |
Shuts down the composite device.
pvCompositeInstance | is 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.
tConfigHeader* g_ppCompConfigDescriptors[1] |
const tCustomHandlers g_sCompHandlers |
Referenced by USBDCompositeInit().