![]() |
usbps
Vitis Drivers API Documentation
|
Data Structures | |
struct | XUsbPs_EpOut |
The following data structures are used internally by the L0/L1 driver. More... | |
struct | XUsbPs_EpIn |
The following data structure represents IN endpoint. More... | |
struct | XUsbPs_Endpoint |
The following data structure represents an endpoint used internally by the L0/L1 driver. More... | |
struct | XUsbPs_SetupData |
The following structure is used by the user to receive Setup Data from an endpoint. More... | |
struct | XUsbPs_EpSetup |
Data structures used to configure endpoints. More... | |
struct | XUsbPs_EpConfig |
Endpoint configuration structure. More... | |
struct | XUsbPs_DeviceConfig |
The XUsbPs_DeviceConfig structure contains the configuration information to configure the USB controller for DEVICE mode. More... | |
struct | XUsbPs_Config |
The XUsbPs_Config structure contains configuration information for the USB controller. More... | |
struct | XUsbPs |
The XUsbPs driver instance data. More... | |
Macros | |
#define | XUSBPS_MAX_PACKET_SIZE 1024 |
Maximum value can be put into the queue head. More... | |
#define | XUsbPs_GetFrameNum(InstancePtr) XUsbPs_ReadReg((InstancePtr)->Config.BaseAddress, XUSBPS_FRAME_OFFSET) |
This macro returns the current frame number. More... | |
#define | XUsbPs_Start(InstancePtr) XUsbPs_SetBits(InstancePtr, XUSBPS_CMD_OFFSET, XUSBPS_CMD_RS_MASK) |
This macro starts the USB engine. More... | |
#define | XUsbPs_Stop(InstancePtr) XUsbPs_ClrBits(InstancePtr, XUSBPS_CMD_OFFSET, XUSBPS_CMD_RS_MASK) |
This macro stops the USB engine. More... | |
#define | XUsbPs_ForceFS(InstancePtr) |
This macro forces the USB engine to be in Full Speed (FS) mode. More... | |
#define | XUsbPs_StartTimer0(InstancePtr, Interval) |
This macro starts the USB Timer 0, with repeat option for period of one second. More... | |
#define | XUsbPs_StopTimer0(InstancePtr) |
This macro stops Timer 0. More... | |
#define | XUsbPs_ReadTimer0(InstancePtr) |
This macro reads Timer 0. More... | |
#define | XUsbPs_RemoteWakeup(InstancePtr) |
This macro force remote wakeup on host. More... | |
#define | XUsbPs_EpEnable(InstancePtr, EpNum, Dir) |
This macro enables the given endpoint for the given direction. More... | |
#define | XUsbPs_EpDisable(InstancePtr, EpNum, Dir) |
This macro disables the given endpoint for the given direction. More... | |
#define | XUsbPs_EpStall(InstancePtr, EpNum, Dir) |
This macro stalls the given endpoint for the given direction, and flush the buffers. More... | |
#define | XUsbPs_EpUnStall(InstancePtr, EpNum, Dir) |
This macro unstalls the given endpoint for the given direction. More... | |
#define | XUsbPs_EpFlush(InstancePtr, EpNum, Dir) |
This macro flush an endpoint upon interface disable. More... | |
#define | XUsbPs_IntrEnable(InstancePtr, IntrMask) XUsbPs_SetBits(InstancePtr, XUSBPS_IER_OFFSET, IntrMask) |
This macro enables the interrupts defined by the bit mask. More... | |
#define | XUsbPs_IntrDisable(InstancePtr, IntrMask) XUsbPs_ClrBits(InstancePtr, XUSBPS_IER_OFFSET, IntrMask) |
This function disables the interrupts defined by the bit mask. More... | |
#define | XUsbPs_NakIntrEnable(InstancePtr, NakIntrMask) XUsbPs_SetBits(InstancePtr, XUSBPS_EPNAKIER_OFFSET, NakIntrMask) |
This macro enables the endpoint NAK interrupts defined by the bit mask. More... | |
#define | XUsbPs_NakIntrDisable(InstancePtr, NakIntrMask) XUsbPs_ClrBits(InstancePtr, XUSBPS_EPNAKIER_OFFSET, NakIntrMask) |
This macro disables the endpoint NAK interrupts defined by the bit mask. More... | |
#define | XUsbPs_NakIntrClear(InstancePtr, NakIntrMask) |
This function clears the endpoint NAK interrupts status defined by the bit mask. More... | |
#define | XUsbPs_SetIntrThreshold(InstancePtr, Threshold) |
This macro sets the Interrupt Threshold value in the control register. More... | |
#define | XUsbPs_SetSetupTripwire(InstancePtr) |
This macro sets the Tripwire bit in the USB command register. More... | |
#define | XUsbPs_ClrSetupTripwire(InstancePtr) |
This macro clears the Tripwire bit in the USB command register. More... | |
#define | XUsbPs_SetupTripwireIsSet(InstancePtr) |
This macro checks if the Tripwire bit in the USB command register is set. More... | |
#define | XUsbPs_SetBits(InstancePtr, RegOffset, Bits) |
This macro sets the given bit mask in the register. More... | |
#define | XUsbPs_ClrBits(InstancePtr, RegOffset, Bits) |
This macro clears the given bits in the register. More... | |
System hang prevention Timeout counter value. | |
This value is used throughout the code to initialize a Timeout counter that is used when hard polling a register. The ides is to initialize the Timeout counter to a value that is longer than any expected Timeout but short enough so the system will continue to work and report an error while the user is still paying attention. A reasonable Timeout time would be about 10 seconds. The XUSBPS_TIMEOUT_COUNTER value should be chosen so a polling loop would run about 10 seconds before a Timeout is detected. For example: int Timeout = XUSBPS_TIMEOUT_COUNTER; while ((XUsbPs_ReadReg(InstancePtr->Config.BaseAddress, XUSBPS_CMD_OFFSET) & XUSBPS_CMD_RST_MASK) && --Timeout) { ; } if (0 == Timeout) { return XST_FAILURE; | |
#define | XUSBPS_TIMEOUT_COUNTER 1000000 |
Endpoint Direction (bitmask) | |
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 controller is used for sending data while the OUT endpoint on the controller is used for receiving data. | |
#define | XUSBPS_EP_DIRECTION_IN 0x01 |
Endpoint direction IN. More... | |
#define | XUSBPS_EP_DIRECTION_OUT 0x02 |
Endpoint direction OUT. More... | |
Endpoint Type | |
Definitions to be used with Endpoint related functions that require a 'Type' parameter. | |
#define | XUSBPS_EP_TYPE_NONE 0 |
Endpoint is not used. More... | |
#define | XUSBPS_EP_TYPE_CONTROL 1 |
Endpoint for Control Transfers. More... | |
#define | XUSBPS_EP_TYPE_ISOCHRONOUS 2 |
Endpoint for isochronous data. More... | |
#define | XUSBPS_EP_TYPE_BULK 3 |
Endpoint for BULK Transfers. More... | |
#define | XUSBPS_EP_TYPE_INTERRUPT 4 |
Endpoint for interrupt Transfers. More... | |
#define | ENDPOINT_MAXP_LENGTH 0x400 |
Endpoint Max Packet Length in DeviceConfig is a coded value, ch9.6.6. More... | |
Field names for status retrieval | |
Definitions for the XUsbPs_GetStatus() function call 'StatusType' parameter. | |
#define | XUSBPS_EP_STS_ADDRESS 1 |
Address of controller. More... | |
#define | XUSBPS_EP_STS_CONTROLLER_STATE 2 |
Current controller state. More... | |
USB Default alternate setting | |
#define | XUSBPS_DEFAULT_ALT_SETTING 0 |
The default alternate setting is 0. More... | |
Endpoint event types | |
Definitions that are used to identify events that occur on endpoints. Passed to the endpoint event handler functions registered with XUsbPs_EpSetHandler(). | |
#define | XUSBPS_EP_EVENT_SETUP_DATA_RECEIVED 0x01 |
Setup data has been received on the endpoint. More... | |
#define | XUSBPS_EP_EVENT_DATA_RX 0x02 |
Data frame has been received on the endpoint. More... | |
#define | XUSBPS_EP_EVENT_DATA_TX 0x03 |
Data frame has been sent on the endpoint. More... | |
Functions | |
int | XUsbPs_CfgInitialize (XUsbPs *InstancePtr, const XUsbPs_Config *ConfigPtr, u32 BaseAddress) |
Setup / Initialize functions. More... | |
int | XUsbPs_ConfigureDevice (XUsbPs *InstancePtr, const XUsbPs_DeviceConfig *CfgPtr) |
This function configures the DEVICE side of the controller. More... | |
int | XUsbPs_Reset (XUsbPs *InstancePtr) |
Common functions used for DEVICE/HOST mode. More... | |
void | XUsbPs_DeviceReset (XUsbPs *InstancePtr) |
This function performs device reset, device is stopped at the end. More... | |
int | XUsbPs_BusReset (XUsbPs *InstancePtr) |
DEVICE mode specific functions. More... | |
int | XUsbPs_SetDeviceAddress (XUsbPs *InstancePtr, u8 Address) |
This functions sets the controller's DEVICE address. More... | |
int | XUsbPs_Suspend (const XUsbPs *InstancePtr) |
Handling Suspend and Resume. More... | |
int | XUsbPs_Resume (const XUsbPs *InstancePtr) |
USB Resume. More... | |
int | XUsbPs_RequestHostResume (const XUsbPs *InstancePtr) |
USB Assert Resume. More... | |
int | XUsbPs_EpBufferSend (XUsbPs *InstancePtr, u8 EpNum, const u8 *BufferPtr, u32 BufferLen) |
This function sends a given data buffer. More... | |
int | XUsbPs_EpBufferSendWithZLT (XUsbPs *InstancePtr, u8 EpNum, const u8 *BufferPtr, u32 BufferLen) |
This function sends a given data buffer and also zero length packet if the Bufferlen is in multiples of endpoint max packet size. More... | |
int | XUsbPs_EpBufferReceive (XUsbPs *InstancePtr, u8 EpNum, u8 **BufferPtr, u32 *BufferLenPtr, u32 *Handle) |
This function receives a data buffer from the endpoint of the given endpoint number. More... | |
void | XUsbPs_EpBufferRelease (u32 Handle) |
This function returns a previously received data buffer to the driver. More... | |
int | XUsbPs_EpSetHandler (XUsbPs *InstancePtr, u8 EpNum, u8 Direction, XUsbPs_EpHandlerFunc CallBackFunc, void *CallBackRef) |
This function sets the handler for endpoint events. More... | |
s32 | XUsbPs_EpSetIsoHandler (XUsbPs *InstancePtr, u8 EpNum, u8 Direction, XUsbPs_EpIsoHandlerFunc CallBackFunc) |
This function sets the handler for ISO endpoint events. More... | |
int | XUsbPs_EpGetSetupData (XUsbPs *InstancePtr, int EpNum, XUsbPs_SetupData *SetupDataPtr) |
This function extracts the Setup Data from a given endpoint. More... | |
int | XUsbPs_EpPrime (XUsbPs *InstancePtr, u8 EpNum, u8 Direction) |
This function primes an endpoint. More... | |
int | XUsbPs_ReconfigureEp (XUsbPs *InstancePtr, XUsbPs_DeviceConfig *CfgPtr, int EpNum, unsigned short NewDirection, int DirectionChanged) |
This function reconfigures one Ep corresponding to host's request of setting alternate interface. More... | |
void | XUsbPs_IntrHandler (void *InstancePtr) |
This function is the first-level interrupt handler for the USB core. More... | |
int | XUsbPs_IntrSetHandler (XUsbPs *InstancePtr, XUsbPs_IntrHandlerFunc CallBackFunc, void *CallBackRef, u32 Mask) |
This function registers the user callback handler for controller (non-endpoint) interrupts. More... | |
void | XUsbPs_EpGetData (XUsbPs *InstancePtr, u8 EpNum, u32 BufferLen) |
This function receives a data buffer from the endpoint of the given endpoint number and pass it to the application. More... | |
s32 | XUsbPs_EpDataBufferReceive (XUsbPs *InstancePtr, u8 EpNum, u8 *BufferPtr, u32 BufferLen) |
This function receives a data buffer from the endpoint of the given endpoint number. More... | |
XUsbPs_Config * | XUsbPs_LookupConfig (u16 DeviceId) |
Looks up the controller configuration based on the unique controller ID. More... | |
#define XUsbPs_ClrBits | ( | InstancePtr, | |
RegOffset, | |||
Bits | |||
) |
This macro clears the given bits in the register.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
RegOffset | is the register offset to be written. |
Bits | are the bits to be cleared in the register |
#define XUsbPs_ClrSetupTripwire | ( | InstancePtr | ) |
This macro clears the Tripwire bit in the USB command register.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
Referenced by XUsbPs_EpGetSetupData().
#define XUsbPs_EpDisable | ( | InstancePtr, | |
EpNum, | |||
Dir | |||
) |
This macro disables the given endpoint for the given direction.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
EpNum | is the number of the endpoint to disable. |
Dir | is the direction of the endpoint (bitfield):
|
Referenced by XUsbPs_SetConfigurationApp(), and XUsbPs_SetInterfaceHandler().
#define XUsbPs_EpEnable | ( | InstancePtr, | |
EpNum, | |||
Dir | |||
) |
This macro enables the given endpoint for the given direction.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
EpNum | is number of the endpoint to enable. |
Dir | is direction of the endpoint (bitfield):
|
Referenced by XUsbPs_SetConfiguration().
#define XUsbPs_EpFlush | ( | InstancePtr, | |
EpNum, | |||
Dir | |||
) |
This macro flush an endpoint upon interface disable.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
EpNum | is the number of the endpoint to flush. |
Dir | is the direction of the endpoint (bitfield):
|
#define XUsbPs_EpStall | ( | InstancePtr, | |
EpNum, | |||
Dir | |||
) |
This macro stalls the given endpoint for the given direction, and flush the buffers.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
EpNum | is number of the endpoint to stall. |
Dir | is the direction of the endpoint (bitfield):
|
Referenced by XUsbPs_Ch9HandleSetupPacket(), and XUsbPs_ClassReq().
#define XUsbPs_EpUnStall | ( | InstancePtr, | |
EpNum, | |||
Dir | |||
) |
This macro unstalls the given endpoint for the given direction.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
EpNum | is the Number of the endpoint to unstall. |
Dir | is the Direction of the endpoint (bitfield):
|
#define XUsbPs_ForceFS | ( | InstancePtr | ) |
This macro forces the USB engine to be in Full Speed (FS) mode.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
#define XUsbPs_GetFrameNum | ( | InstancePtr | ) | XUsbPs_ReadReg((InstancePtr)->Config.BaseAddress, XUSBPS_FRAME_OFFSET) |
This macro returns the current frame number.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
#define XUsbPs_IntrDisable | ( | InstancePtr, | |
IntrMask | |||
) | XUsbPs_ClrBits(InstancePtr, XUSBPS_IER_OFFSET, IntrMask) |
This function disables the interrupts defined by the bit mask.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
IntrMask | is a Bit mask of interrupts to be disabled. |
#define XUsbPs_IntrEnable | ( | InstancePtr, | |
IntrMask | |||
) | XUsbPs_SetBits(InstancePtr, XUSBPS_IER_OFFSET, IntrMask) |
This macro enables the interrupts defined by the bit mask.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
IntrMask | is the Bit mask of interrupts to be enabled. |
Referenced by main(), and XUsbPs_SetupInterruptSystem().
#define XUsbPs_NakIntrClear | ( | InstancePtr, | |
NakIntrMask | |||
) |
This function clears the endpoint NAK interrupts status defined by the bit mask.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
NakIntrMask | is the Bit mask of endpoint NAK interrupts to be cleared. |
#define XUsbPs_NakIntrDisable | ( | InstancePtr, | |
NakIntrMask | |||
) | XUsbPs_ClrBits(InstancePtr, XUSBPS_EPNAKIER_OFFSET, NakIntrMask) |
This macro disables the endpoint NAK interrupts defined by the bit mask.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
NakIntrMask | is a Bit mask of endpoint NAK interrupts to be disabled. |
#define XUsbPs_NakIntrEnable | ( | InstancePtr, | |
NakIntrMask | |||
) | XUsbPs_SetBits(InstancePtr, XUSBPS_EPNAKIER_OFFSET, NakIntrMask) |
This macro enables the endpoint NAK interrupts defined by the bit mask.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
NakIntrMask | is the Bit mask of endpoint NAK interrupts to be enabled. |
#define XUsbPs_ReadTimer0 | ( | InstancePtr | ) |
This macro reads Timer 0.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
#define XUsbPs_RemoteWakeup | ( | InstancePtr | ) |
This macro force remote wakeup on host.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
#define XUsbPs_SetBits | ( | InstancePtr, | |
RegOffset, | |||
Bits | |||
) |
This macro sets the given bit mask in the register.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
RegOffset | is the register offset to be written. |
Bits | is the Bits to be set in the register |
Referenced by XUsbPs_ConfigureDevice(), and XUsbPs_SetConfiguration().
#define XUsbPs_SetIntrThreshold | ( | InstancePtr, | |
Threshold | |||
) |
This macro sets the Interrupt Threshold value in the control register.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
Threshold | is the Interrupt threshold to be set. Allowed values:
|
#define XUsbPs_SetSetupTripwire | ( | InstancePtr | ) |
This macro sets the Tripwire bit in the USB command register.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
Referenced by XUsbPs_EpGetSetupData().
#define XUsbPs_SetupTripwireIsSet | ( | InstancePtr | ) |
This macro checks if the Tripwire bit in the USB command register is set.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
Referenced by XUsbPs_EpGetSetupData().
#define XUsbPs_Start | ( | InstancePtr | ) | XUsbPs_SetBits(InstancePtr, XUSBPS_CMD_OFFSET, XUSBPS_CMD_RS_MASK) |
This macro starts the USB engine.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
Referenced by main().
#define XUsbPs_StartTimer0 | ( | InstancePtr, | |
Interval | |||
) |
This macro starts the USB Timer 0, with repeat option for period of one second.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
Interval | is the interval for Timer0 to generate an interrupt |
#define XUsbPs_Stop | ( | InstancePtr | ) | XUsbPs_ClrBits(InstancePtr, XUSBPS_CMD_OFFSET, XUSBPS_CMD_RS_MASK) |
This macro stops the USB engine.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
Referenced by XUsbPs_DeviceReset().
#define XUsbPs_StopTimer0 | ( | InstancePtr | ) |
This macro stops Timer 0.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
int XUsbPs_BusReset | ( | XUsbPs * | InstancePtr | ) |
DEVICE mode specific functions.