Data Structures | Macros | Functions | Variables
Usblib_hcd

Data Structures

struct  tUSBHostDevice
 
struct  tUSBHostClassDriver
 
struct  tEventInfo
 

Macros

#define DECLARE_EVENT_DRIVER(VarName, pfnOpen, pfnClose, pfnEvent)
 

Functions

static void USBHCDClearFeature (uint32_t ulIndex, uint32_t ulDevAddress, uint32_t ulEndpoint, uint32_t ulFeature)
 
uint32_t USBHCDPipeAllocSize (uint32_t ulIndex, uint32_t ulEndpointType, uint32_t ulDevAddr, uint32_t ulSize, tHCDPipeCallback pfnCallback)
 
uint32_t USBHCDPipeAlloc (uint32_t ulIndex, uint32_t ulEndpointType, uint32_t ulDevAddr, tHCDPipeCallback pfnCallback)
 
uint32_t USBHCDPipeConfig (uint32_t devIndex, uint32_t ulPipe, uint32_t ulMaxPayload, uint32_t ulInterval, uint32_t ulTargetEndpoint)
 
uint32_t USBHCDPipeStatus (uint32_t ulPipe)
 
uint32_t USBHCDPipeWrite (uint32_t ulIndex, uint32_t ulPipe, unsigned char *pucData, uint32_t ulSize)
 
uint32_t USBHCDPipeSchedule (uint32_t ulIndex, uint32_t ulPipe, unsigned char *pucData, uint32_t ulSize)
 
uint32_t USBHCDPipeReadNonBlocking (uint32_t ulIndex, uint32_t ulPipe, unsigned char *pucData, uint32_t ulSize)
 
uint32_t USBHCDPipeRead (uint32_t ulIndex, uint32_t ulPipe, unsigned char *pucData, uint32_t ulSize)
 
void USBHCDPipeFree (uint32_t ulIndex, uint32_t ulPipe)
 
void USBHCDPowerConfigInit (uint32_t ulIndex, uint32_t ulPwrConfig)
 
uint32_t USBHCDPowerConfigGet (uint32_t ulIndex)
 
uint32_t USBHCDPowerConfigSet (uint32_t ulIndex, uint32_t ulConfig)
 
uint32_t USBHCDPowerAutomatic (uint32_t ulIndex)
 
void USBHCDInit (uint32_t ulIndex, void *pvPool, uint32_t ulPoolSize)
 
void USBHCDRegisterDrivers (uint32_t ulIndex, const tUSBHostClassDriver *const *ppHClassDrvs, uint32_t ulNumDrivers)
 
void USBHCDTerm (uint32_t ulIndex)
 
void USBHCDReset (uint32_t ulIndex)
 
void USBHCDSuspend (uint32_t ulIndex)
 
void USBHCDResume (uint32_t ulIndex)
 
static uint32_t USBHCDGetConfigDescriptor (uint32_t ulIndex, tUSBHostDevice *pDevice)
 
static uint32_t USBHCDGetDeviceDescriptor (uint32_t ulIndex, tUSBHostDevice *pDevice)
 
void USBHCDSetAddress (uint32_t ulIndex, uint32_t ulDevAddress)
 
void USBHCDSetConfig (uint32_t ulIndex, uint32_t ulDevice, uint32_t ulConfiguration)
 
void USBHCDSetInterface (uint32_t ulIndex, uint32_t ulDevice, uint32_t ulInterface, unsigned ulAltSetting)
 
static int USBHCDOpenDriver (uint32_t ulIndex, uint32_t ulDeviceNum)
 
uint32_t USBHCDMain (uint32_t ulIndex, uint32_t ulInstance)
 
uint32_t USBHCDControlTransfer (uint32_t ulIndex, tUSBRequest *pSetupPacket, uint32_t ulDevAddress, unsigned char *pData, uint32_t ulSize, uint32_t ulMaxPacketSize)
 
uint32_t USBHCDGetSpeed (uint32_t ulIndex)
 
void USBHCDConfigureEndpoints (uint32_t ulIndex, tUSBHostDevice *pDevice, uint32_t *inPipe, uint32_t *outPipe)
 

Variables

tUSBInstanceObject g_USBInstance []
 

Detailed Description

Copyright (c) Texas Instruments Incorporated 2015-2016

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright (c) Texas Instruments Incorporated 2015

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

#define DECLARE_EVENT_DRIVER (   VarName,
  pfnOpen,
  pfnClose,
  pfnEvent 
)
Value:
void IntFn(void *pvData); \
const tUSBHostClassDriver VarName = \
{ \
USB_CLASS_EVENTS, \
0, \
0, \
pfnEvent \
}
Definition: usbhost.h:232

This macro is used to declare an instance of an Event driver for the USB library.

Parameters
VarNameis the name of the variable.
pfnOpenis the callback for the Open call to this driver. This value is currently reserved and should be set to 0.
pfnCloseis the callback for the Close call to this driver. This value is currently reserved and should be set to 0.
pfnEventis the callback that will be called for various USB events.

The first parameter is the actual name of the variable that will be declared by this macro. The second and third parameter are reserved for future functionality and are unused and should be set to zero. The last parameter is the actual callback function and is specified as a function pointer of the type:

void (*pfnEvent)(void *pvData);

When the pfnEvent function is called the void pointer that is passed in as a parameter should be cast to a pointer to a structure of type tEventInfo. This will contain the event that caused the pfnEvent function to be called.

Function Documentation

static void USBHCDClearFeature ( uint32_t  devIndex,
uint32_t  ulDevAddress,
uint32_t  ulPipe,
uint32_t  ulFeature 
)
static

This function is used to send a Clear Feature request to a device.

Parameters
ulDevAddressis the USB bus address of the device that will receive this request.
ulPipeis the pipe that will be used to send the request.
ulFeatureis one of the USB_FEATURE_* definitions.

This function will issue a Clear Feature request to the device indicated by the ulDevAddress parameter. The ulPipe parameter is the USB pipe that should be used to send this request. The ulFeature parameter should be one of the following values:

  • USB_FEATURE_EP_HALT is used to end a HALT condition on a devices endpoint.
  • USB_FEATURE_REMOTE_WAKE is used to disable a device's remote wake feature.
  • USB_FEATURE_TEST_MODE is used take the USB device out of test mode.
Returns
None.
void USBHCDConfigureEndpoints ( uint32_t  ulIndex,
tUSBHostDevice pDevice,
uint32_t *  inPipe,
uint32_t *  outPipe 
)
Returns
none
uint32_t USBHCDControlTransfer ( uint32_t  ulIndex,
tUSBRequest *  pSetupPacket,
uint32_t  ulDevAddress,
unsigned char *  pData,
uint32_t  ulSize,
uint32_t  ulMaxPacketSize 
)

This function completes a control transaction to a device.

Parameters
ulIndexis the controller index to use for this transfer.
pSetupPacketis the setup request to be sent.
ulDevAddressis the address of the device for this request.
pDatais the data to send for OUT requests or the receive buffer for IN requests.
ulSizeis the size of the buffer in pData.
ulMaxPacketSizeis the maximum packet size for the device for this request.

This function handles the state changes necessary to send a control transaction to a device. This function should not be called from within an interrupt callback as it is a blocking function.

Returns
The number of bytes of data that were sent or received as a result of this request.
static uint32_t USBHCDGetConfigDescriptor ( uint32_t  ulIndex,
tUSBHostDevice pDevice 
)
static

This function issues a request for the current configuration descriptor from a device.

Parameters
ulIndexspecifies which USB controller to use.
pDeviceis a pointer to the device structure that holds the buffer to store the configuration descriptor.

This function will request the configuration descriptor from the device. The pDevice->ConfigDescriptor member variable is used to hold the data for this request. This buffer will be allocated from the pool provided by the HCDInit() function. pDevice->DeviceDescriptor.bMaxPacketSize0 should be valid prior to this call in order to correctly receive the configuration descriptor. If this variable is not valid then this call will not return accurate data.

Returns
The number of bytes returned due to the request. This value can be zero if the device did not respond.
static uint32_t USBHCDGetDeviceDescriptor ( uint32_t  ulIndex,
tUSBHostDevice pDevice 
)
static

This function issues a request for a device descriptor from a device.

Parameters
ulIndexspecifies which USB controller to use.
pDeviceis a pointer to the device structure that holds the buffer to store the device descriptor into.

This function will request the device descriptor from the device. The pDevice->DeviceDescriptor descriptor is used to hold the data for this request. pDevice->DeviceDescriptor.bMaxPacketSize0 should be initialized to zero or to the valid maximum packet size if it is known. If this variable is not set to zero, then this call will determine the maximum packet size for endpoint 0 and save it in the structure member bMaxPacketSize0.

Returns
The number of bytes returned due to the request. This value can be zero if the device did not respond.
uint32_t USBHCDGetSpeed ( uint32_t  ulIndex)

This function returns the speed of the device connected on the bus.

Parameters
ulIndexspecifies which USB controller to use.

This function calls the HCD lower layer function to return the speed of the connected device. High speed devices get detected as high speed only after the 2nd reset and chirp sequence. Till that time they report FS

Returns
device speed as uint32_teger.
void USBHCDInit ( uint32_t  ulIndex,
void *  pvPool,
uint32_t  ulPoolSize 
)

This function is used to initialize the HCD code.

Parameters
ulIndexspecifies which USB controller to use.
pvPoolis a pointer to the data to use as a memory pool for this controller.
ulPoolSizeis the size in bytes of the buffer passed in as pvPool.

This function will perform all the necessary operations to allow the USB host controller to begin enumeration and communication with devices. This function should typically be called once at the start of an application once all of the device and class drivers are ready for normal operation. This call will start up the USB host controller and any connected device will immediately start the enumeration sequence.

Returns
None.
uint32_t USBHCDMain ( uint32_t  ulIndex,
uint32_t  ulInstance 
)

This function is the main routine for the Host Controller Driver.

This function is the main routine for the host controller driver, and must be called periodically by the main application outside of a callback context. This allows for a simple cooperative system to access the the host controller driver interface without the need for an RTOS. All time critical operations are handled in interrupt context but all blocking operations are run from the this function to allow them to block and wait for completion without holding off other interrupts.

Returns
None.
static int USBHCDOpenDriver ( uint32_t  ulIndex,
uint32_t  ulDeviceNum 
)
static

This function opens the class driver.

Parameters
ulIndexspecifies which USB controller to use.
ulDeviceNumis the device number for the driver to load.

This function opens the driver needed based on the class value found in the device's interface descriptor.

Returns
This function returns -1 if no driver is found, or it returns the index of the driver found in the list of host class drivers.
uint32_t USBHCDPipeAlloc ( uint32_t  ulIndex,
uint32_t  ulEndpointType,
uint32_t  ulDevAddr,
tHCDPipeCallback  pfnCallback 
)

This function is used to allocate a USB HCD pipe.

Parameters
ulIndexspecifies which USB controller to use.
ulEndpointTypeis the type of endpoint that this pipe will be communicating with.
ulDevAddris the device address to use for this endpoint.
pfnCallbackis the function that will be called when events occur on this USB Pipe.

Since there are a limited number of USB HCD pipes that can be used in the host controller, this function is used to temporarily or permanently acquire one of the endpoints. It also provides a method to register a callback for status changes on this endpoint. If no callbacks are desired then the pfnCallback function should be set to 0. The callback should be used when using the USBHCDPipeSchedule() function so that the caller is notified when the action is complete.

Returns
This function returns a value indicating which pipe was reserved. If the value is 0 then there were no pipes currently available. This value should be passed to any USBHCDPipe APIs to indicate which pipe is being accessed.
uint32_t USBHCDPipeAllocSize ( uint32_t  ulIndex,
uint32_t  ulEndpointType,
uint32_t  ulDevAddr,
uint32_t  ulSize,
tHCDPipeCallback  pfnCallback 
)

This function is used to allocate a USB HCD pipe.

Parameters
ulIndexspecifies which USB controller to use.
ulEndpointTypeis the type of endpoint that this pipe will be communicating with.
ulDevAddris the device address to use for this endpoint.
ulSizeis the size of the FIFO in bytes.
pfnCallbackis the function that will be called when events occur on this USB Pipe.

Since there are a limited number of USB HCD pipes that can be used in the host controller, this function is used to temporarily or permanently acquire one of the endpoints. Unlike the USBHCDPipeAlloc() function this function allows the caller to specify the size of the FIFO allocated to this endpoint in the ulSize parameter. This function also provides a method to register a callback for status changes on this endpoint. If no callbacks are desired then the pfnCallback function should be set to 0. The callback should be used when using the USBHCDPipeSchedule() function so that the caller is notified when the action is complete.

Returns
This function returns a value indicating which pipe was reserved. If the value is 0 then there were no pipes currently available. This value should be passed to any USBHCDPipe APIs to indicate which pipe is being accessed.
uint32_t USBHCDPipeConfig ( uint32_t  devIndex,
uint32_t  ulPipe,
uint32_t  ulMaxPayload,
uint32_t  ulInterval,
uint32_t  ulTargetEndpoint 
)

This function is used to configure a USB HCD pipe.

This should be called after allocating a USB pipe with a call to USBHCDPipeAlloc(). It is used to set the configuration associated with an endpoint like the max payload and target endpoint. The ulMaxPayload parameter is typically read directly from the devices endpoint descriptor and is expressed in bytes.

Setting the ulInterval parameter depends on the type of endpoint being configured. For endpoints that do not need to use the ulInterval parameter ulInterval should be set to 0. For Bulk ulInterval is a value from 2-16 and will set the NAK timeout value as 2^(ulInterval-1) frames. For interrupt endpoints ulInterval is a value from 1-255 and is the count in frames between polling the endpoint. For isochronous endpoints ulInterval ranges from 1-16 and is the polling interval in frames represented as 2^(ulInterval-1) frames.

Parameters
ulPipeis the allocated endpoint to modify.
ulMaxPayloadis maximum data that can be handled per transaction.
ulIntervalis the polling interval for data transfers expressed in frames.
ulTargetEndpointis the target endpoint on the device to communicate with.
Returns
If the call was successful, this function returns zero any other value indicates an error.
void USBHCDPipeFree ( uint32_t  ulIndex,
uint32_t  ulPipe 
)

This function is used to release a USB pipe.

Parameters
ulPipeis the allocated USB pipe to release.

This function is used to release a USB pipe that was allocated by a call to USBHCDPipeAlloc() for use by some other device endpoint in the system. Freeing an unallocated or invalid pipe will not generate an error and will instead simply return.

Returns
None.
uint32_t USBHCDPipeRead ( uint32_t  ulIndex,
uint32_t  ulPipe,
unsigned char *  pucData,
uint32_t  ulSize 
)

This function is used to read data from a USB HCD pipe.

Parameters
ulPipeis the USB pipe to read data from.
pucDatais a pointer to store the data that is received.
ulSizeis the size in bytes of the buffer pointed to by pucData.

This function will block and will only return when it has read as much data as requested from the USB pipe. The caller should have registered a callback with the USBHCDPipeAlloc() call in order to be informed when the data has been received. The value returned by this function can be less than the ulSize requested if the USB pipe has less data available than was requested.

Returns
This function returns the number of bytes that were returned in the pucData buffer.
uint32_t USBHCDPipeReadNonBlocking ( uint32_t  ulIndex,
uint32_t  ulPipe,
unsigned char *  pucData,
uint32_t  ulSize 
)

This function is used to read data from a USB HCD pipe.

Parameters
ulPipeis the USB pipe to read data from.
pucDatais a pointer to store the data that is received.
ulSizeis the size in bytes of the buffer pointed to by pucData.

This function will not block and will only read as much data as requested or as much data is currently available from the USB pipe. The caller should have registered a callback with the USBHCDPipeAlloc() call in order to be informed when the data has been received. The value returned by this function can be less than the ulSize requested if the USB pipe has less data available than was requested.

Returns
This function returns the number of bytes that were returned in the pucData buffer.
uint32_t USBHCDPipeSchedule ( uint32_t  ulIndex,
uint32_t  ulPipe,
unsigned char *  pucData,
uint32_t  ulSize 
)

This function is used to schedule and IN transaction on a USB HCD pipe.

Parameters
ulPipeis the USB pipe to read data from.
pucDatais a pointer to store the data that is received.
ulSizeis the size in bytes of the buffer pointed to by pucData.

This function will not block depending on the type of pipe passed in will schedule either a send of data to the device or a read of data from the device. In either case the amount of data will be limited to what will fit in the FIFO for a given endpoint.

Returns
This function returns the number of bytes that sent in the case of a transfer of data or it will return 0 for a request on a USB IN pipe.
uint32_t USBHCDPipeStatus ( uint32_t  ulPipe)

This function is used to return the current status of a USB HCD pipe.

This function will return the current status for a given USB pipe. If there is no status to report this call will simply return USBHCD_PIPE_NO_CHANGE.

Parameters
ulPipeis the USB pipe for this status request.
Returns
This function returns the current status for the given endpoint. This will be one of the USBHCD_PIPE_* values.
uint32_t USBHCDPipeWrite ( uint32_t  ulIndex,
uint32_t  ulPipe,
unsigned char *  pucData,
uint32_t  ulSize 
)

This function is used to write data to a USB HCD pipe.

Parameters
ulPipeis the USB pipe to put data into.
pucDatais a pointer to the data to send.
ulSizeis the amount of data to send.

This function will block until it has sent as much data as was requested using the USB pipe's FIFO. The caller should have registered a callback with the USBHCDPipeAlloc() call in order to be informed when the data has been transmitted. The value returned by this function can be less than the ulSize requested if the USB pipe has less space available than this request is making.

Returns
This function returns the number of bytes that were scheduled to be sent on the given USB pipe.
uint32_t USBHCDPowerAutomatic ( uint32_t  ulIndex)

This function returns if the current power settings will automatically handle enabling and disabling VBUS power.

Parameters
ulIndexspecifies which USB controller to query.

This function returns if the current power control pin configuration will automatically apply power or whether it will be left to the application to turn on power when it is notified.

Returns
A non-zero value indicates that power is automatically applied and a value of zero indicates that the application must manually apply power.
uint32_t USBHCDPowerConfigGet ( uint32_t  ulIndex)

This function is used to get the power pin and power fault configuration.

Parameters
ulIndexspecifies which USB controller to use.

This function will return the current power control pin configuration as set by the USBHCDPowerConfigInit() function or the defaults if not yet set. See the USBHCDPowerConfigInit() documentation for the meaning of the bits that are returned by this function.

Returns
The configuration of the power control pins.
void USBHCDPowerConfigInit ( uint32_t  ulIndex,
uint32_t  ulPwrConfig 
)

This function is used to set the power pin and power fault configuration.

Parameters
ulIndexspecifies which USB controller to use.
ulPwrConfigis the power configuration to use for the application.

This function must be called before HCDInit() is called so that the power pin configuration can be set before power is enabled. The ulPwrConfig flags specify the power fault level sensitivity, the power fault action, and the power enable pin level and source.

One of the following can be selected as the power fault level sensitivity:

  • USBHCD_FAULT_LOW - An external power fault is indicated by the pin being driven low.
  • USBHCD_FAULT_HIGH - An external power fault is indicated by the pin being driven high.

One of the following can be selected as the power fault action:

  • USBHCD_FAULT_VBUS_NONE - No automatic action when power fault detected.
  • USBHCD_FAULT_VBUS_TRI - Automatically Tri-state the USBnEPEN pin on a power fault.
  • USBHCD_FAULT_VBUS_DIS - Automatically drive the USBnEPEN pin to it's inactive state on a power fault.

One of the following can be selected as the power enable level and source:

  • USBHCD_VBUS_MANUAL - Power control is completely managed by the application, the USB library will provide a power callback to request power state changes.
  • USBHCD_VBUS_AUTO_LOW - USBEPEN is driven low by the USB controller automatically if USBOTGSessionRequest() has enabled a session.
  • USBHCD_VBUS_AUTO_HIGH - USBEPEN is driven high by the USB controller automatically if USBOTGSessionRequest() has enabled a session.

If USBHCD_VBUS_MANUAL is used then the application must provide an event driver to receive the USB_EVENT_POWER_ENABLE and USB_EVENT_POWER_DISABLE events and enable and disable power to VBUS when requested by the USB library. The application should respond to a power control callback by enabling or disabling VBUS as soon as possible and before returning from the callback function.

Note
The following values should no longer be used with the USB library: USB_HOST_PWRFLT_LOW, USB_HOST_PWRFLT_HIGH, USB_HOST_PWRFLT_EP_NONE, USB_HOST_PWRFLT_EP_TRI, USB_HOST_PWRFLT_EP_LOW, USB_HOST_PWRFLT_EP_HIGH, USB_HOST_PWREN_LOW, USB_HOST_PWREN_HIGH, USB_HOST_PWREN_VBLOW, and USB_HOST_PWREN_VBHIGH.
Returns
None.
uint32_t USBHCDPowerConfigSet ( uint32_t  ulIndex,
uint32_t  ulConfig 
)

This function is used to set the power pin and power fault configuration.

Parameters
ulIndexspecifies which USB controller to use.
ulConfigspecifies which USB power configuration to use.

This function will set the current power control pin configuration as set by the USBHCDPowerConfigInit() function or the defaults if not yet set. See the USBHCDPowerConfigInit() documentation for the meaning of the bits that are set by this function.

Returns
Returns zero to indicate the power setting is now active.
void USBHCDRegisterDrivers ( uint32_t  ulIndex,
const tUSBHostClassDriver *const *  ppHClassDrvs,
uint32_t  ulNumDrivers 
)

This function is used to initialize the HCD class driver list.

Parameters
ulIndexspecifies which USB controller to use.
ppHClassDrvsis an array of host class drivers that are supported on this controller.
ulNumDriversis the number of entries in the pHostClassDrivers array.

This function will set the host classes supported by the host controller specified by the ulIndex parameter. This function should be called before enabling the host controller driver with the USBHCDInit() function.

Returns
None.
void USBHCDReset ( uint32_t  ulIndex)

This function generates reset signaling on the USB bus.

Parameters
ulIndexspecifies which USB controller to use.

This function handles sending out reset signaling on the USB bus. After returning from this function, any attached device on the USB bus should have returned to it's reset state.

Returns
None.
void USBHCDResume ( uint32_t  ulIndex)

This function will generate resume signaling on the USB bus.

Parameters
ulIndexspecifies which USB controller to use.

This function is used to generate resume signaling on the USB bus in order to cause USB devices to leave their suspended state. This call should not be made unless a preceding call to USBHCDSuspend() has been made.

Returns
None.
void USBHCDSetAddress ( uint32_t  ulIndex,
uint32_t  ulDevAddress 
)

This function is used to send the set address command to a device.

Parameters
ulDevAddressis the new device address to use for a device.

The USBHCDSetAddress() function is used to set the USB device address, once a device has been discovered on the bus. This is typically issued following a USB reset which is triggered by a call the USBHCDReset(). The address passed into this function via the ulDevAddress parameter should be used for all further communications with the device once this function returns.

Returns
None.
void USBHCDSetConfig ( uint32_t  ulIndex,
uint32_t  ulDevice,
uint32_t  ulConfiguration 
)

This function is used to set the current configuration for a device.

Parameters
ulIndexspecifies which USB controller to use.
ulDeviceis the USB device for this function.
ulConfigurationis one of the devices valid configurations.

This function is used to set the current device configuration for a USB device. The ulConfiguration value must be one of the configuration indexes that was returned in the configuration descriptor from the device, or a value of 0. If 0 is passed in, the device will return to it's addressed state and no longer be in a configured state. If the value is non-zero then the device will change to the requested configuration.

Returns
None.
void USBHCDSetInterface ( uint32_t  ulIndex,
uint32_t  ulDevice,
uint32_t  ulInterface,
unsigned  ulAltSetting 
)

This function is used to set the current interface and alternate setting for an interface on a device.

Parameters
ulIndexspecifies which USB controller to use.
ulDeviceis the USB device for this function.
ulInterfaceis one of the valid interface numbers for a device.
ulAltSettingis one of the valid alternate interfaces for the ulInterface number.

This function is used to change the alternate setting for one of the valid interfaces on a USB device. The ulDevice specifies the device instance that was returned when the device was connected. This call will set the USB device's interface based on the ulInterface and ulAltSetting.

Example: Set the USB device interface 2 to alternate setting 1.

//! USBHCDSetInterface(0, ulDevice, 2, 1);
//! 
\return None.  
void USBHCDSuspend ( uint32_t  ulIndex)

This function will generate suspend signaling on the USB bus.

Parameters
ulIndexspecifies which USB controller to use.

This function is used to generate suspend signaling on the USB bus. In order to leave the suspended state, the application should call USBHCDResume().

Returns
None.
void USBHCDTerm ( uint32_t  ulIndex)

This function is used to terminate the HCD code.

Parameters
ulIndexspecifies which USB controller to release.

This function will clean up the USB host controller and disable it in preparation for shutdown or a switch to USB device mode. Once this call is made, USBHCDInit() may be called to reinitialize the controller and prepare for host mode operation.

Returns
None.

Variable Documentation

tUSBInstanceObject g_USBInstance[]

============================================================================


Copyright 2016, Texas Instruments Incorporated