usb
Vitis Drivers API Documentation
xusb.h File Reference

Data Structures

struct  XUsb_EpConfig
 The XUsb_EpConfig structure is used to configure endpoints. More...
 
struct  XUsb_DeviceConfig
 The XUsb_DeviceConfig structure contains the configuration information to configure the USB controller for DEVICE mode. More...
 
struct  XUsb_Config
 The XUsb_Config structure contains configuration information for the USB controller. More...
 
struct  XUsb
 The XUsb driver instance data. More...
 

Macros

Endpoint Direction

Definitions to be used with Endpoint related function that require a 'Direction' parameter.

NOTE: The direction is always defined from the perspective of the HOST! This means that an IN endpoint on the device is used for sending data while the OUT endpoint on the device is used for receiving data.

#define XUSB_EP_DIRECTION_IN   1
 Endpoint direction IN. More...
 
#define XUSB_EP_DIRECTION_OUT   0
 Endpoint direction OUT. More...
 
Speed

Definitions to be used with speed.

#define XUSB_EP_HIGH_SPEED   1
 High Speed. More...
 
#define XUSB_EP_FULL_SPEED   0
 Full Speed. More...
 
USB device specific global configuration constants.
#define XUSB_MAX_ENDPOINTS   8
 Maximum End Points. More...
 
#define XUSB_EP_NUMBER_ZERO   0
 End point Zero. More...
 
#define XUSB_DEVICEADDR_MAX   127
 Max device address. More...
 
USB device disconnect state
#define XUSB_DISCONNECTED   0x1
 Disconnected state. More...
 
#define XUSB_RESET   0x0
 Reset State. More...
 
Test Modes (Set Feature)
#define TEST_J   1
 Chirp J Test. More...
 
#define TEST_K   2
 Chirp K Test. More...
 
#define TEST_SE0_NAK   3
 Chirp SE0 Test. More...
 
#define TEST_PKT   4
 Packet Test. More...
 

Typedefs

typedef void(* XUsb_EpHandlerFunc )(void *CallBackRef, u8 EpNum, u32 EventType)
 This data type defines the callback function to be used for Endpoint handlers. More...
 
typedef void(* XUsb_IntrHandlerFunc )(void *CallBackRef, u32 InterruptType)
 This data type defines the callback function to be used for the general interrupt handler. More...
 

Functions

int XUsb_CfgInitialize (XUsb *InstancePtr, XUsb_Config *ConfigPtr, UINTPTR EffectiveAddr)
 This function initializes a XUsb instance/driver. More...
 
int XUsb_ConfigureDevice (XUsb *InstancePtr, XUsb_DeviceConfig *CfgPtr)
 This function initializes USB End points. More...
 
void XUsb_Start (XUsb *InstancePtr)
 This function starts the USB Device. More...
 
void XUsb_Stop (XUsb *InstancePtr)
 This function stops the USB device. More...
 
u32 XUsb_GetFrameNum (const XUsb *InstancePtr)
 This function returns the current frame number. More...
 
int XUsb_SetDeviceAddress (XUsb *InstancePtr, u8 Address)
 This function sets the USB device address. More...
 
void XUsb_SetTestMode (XUsb *InstancePtr, u8 TestMode, u8 *BufPtr)
 This function sets the USB device into a given test mode. More...
 
void XUsb_DmaReset (XUsb *InstancePtr)
 This function resets the DMA module of the USB device. More...
 
void XUsb_DmaTransfer (XUsb *InstancePtr, UINTPTR *SrcAddr, UINTPTR *DstAddr, u16 Length)
 This function sets the DMA registers with the given values to initiate a DMA data transfer. More...
 
void XUsb_ReadErrorCounters (XUsb *InstancePtr, u8 *BitStuffErrors, u8 *PidErrors, u8 *CrcErrors)
 This function reads the USB error counter register and returns the error counters information. More...
 
u8 XUsb_UlpiPhyReadRegister (XUsb *InstancePtr, u8 RegAddr)
 This function initiates the USB ULPI PHY register read transaction. More...
 
int XUsb_UlpiPhyWriteRegister (XUsb *InstancePtr, u8 RegAddr, u8 UlpiPhyRegData)
 This function initiates the USB ULPI PHY register write transaction. More...
 
void XUsb_SieReset (XUsb *InstancePtr)
 This function resets the Serial Interface Engine. More...
 
void XUsb_EpEnable (const XUsb *InstancePtr, u8 EpNum)
 This function enables the specified endpoint for all operations. More...
 
void XUsb_EpDisable (const XUsb *InstancePtr, u8 EpNum)
 This function disables the specified endpoint for all operations. More...
 
void XUsb_EpConfigure (XUsb *InstancePtr, u8 EpNum, XUsb_EpConfig *EpCfgPtr)
 This function configures a specific end point with the given configuration data. More...
 
int XUsb_EpDataSend (XUsb *InstancePtr, u8 EpNum, u8 *BufferPtr, u32 BufferLen)
 This function copies the transmit data to the end point buffer and enables the buffer for transmission. More...
 
int XUsb_EpDataRecv (XUsb *InstancePtr, u8 EpNum, u8 *BufferPtr, u32 BufferLen)
 This function copies the received data from end point buffer to the buffer passed and then makes the device ready for receiving data again into the same end point buffer. More...
 
void XUsb_EpStall (const XUsb *InstancePtr, u8 EpNum)
 This function stalls operations for the specified endpoint. More...
 
void XUsb_EpUnstall (const XUsb *InstancePtr, u8 EpNum)
 This function unstalls operations for the specified endpoint. More...
 
void XUsb_EpIsoTransferConfigure (XUsb *InstancePtr, u8 EpNum, u8 NoOfTransfers)
 This function sets the number of isochronous transfers in a microframe for a given endpoint. More...
 
void XUsb_IntrEnable (XUsb *InstancePtr, u32 Mask)
 This function enables the specified interrupts. More...
 
void XUsb_IntrDisable (XUsb *InstancePtr, u32 Mask)
 This function disables the specified interrupts. More...
 
void XUsb_IntrHandler (void *InstancePtr)
 This function is the interrupt handler for the USB driver. More...
 
void XUsb_IntrSetHandler (XUsb *InstancePtr, void *CallBackFunc, void *CallBackRef)
 This function installs an asynchronous callback function for the general interrupt (interrupts other than the endpoint and error interrupts). More...
 
void XUsb_EpSetHandler (XUsb *InstancePtr, u8 EpNum, XUsb_EpHandlerFunc *CallBackFunc, void *CallBackRef)
 This function sets the handler for endpoint events. More...
 
void XUsb_ErrIntrSetHandler (XUsb *InstancePtr, void *CallBackFunc, void *CallBackRef)
 This function installs an asynchronous callback function for the error events. More...
 
void XUsb_DmaIntrSetHandler (XUsb *InstancePtr, void *CallBackFunc, void *CallBackRef)
 This function installs an asynchronous callback function for the DMA events. More...
 
void XUsb_UlpiIntrSetHandler (XUsb *InstancePtr, void *CallBackFunc, void *CallBackRef)
 This function installs an asynchronous callback function for the ULPI PHY events. More...
 
XUsb_ConfigXUsb_LookupConfig (u16 DeviceId)
 Looks up the device configuration based on the unique device ID. More...