| usbpsu Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
USBPSU APIs

## Data Structures
struct | XUsbPsu_EvtBuffer
| struct XUsbPsu_EvtBuffer - Software Event buffer representation Software Event buffer representation More...
struct | XUsbPsu_Trb
| struct XUsbPsu_Trb - Transfer Request Block - Hardware format More...
struct | XUsbPsu_EpParams
| struct XUsbPsu_EpParams - Endpoint Parameters More...
struct | __attribute__
| struct SetupPacket - USB Standard Control Request More...
struct | XUsbPsu_Ep
| struct XUsbPsu_Ep - Endpoint representation Endpoint representation More...
struct | XUsbPsu_Config
| struct XUsbPsu_Config - Configuration information for the USB More...
struct | Usb_DevData
| struct Usb_DevData - Application device data Application Data More...
struct | XUsbPsu
| USB Device Controller representation USB Device Controller representation. More...
struct | XUsbPsu_Event_Type
| struct XUsbPsu_Event_Type - Device Endpoint Events type More...
struct | XUsbPsu_Event_Epevt
| struct XUsbPsu_event_depvt - Device Endpoint Events More...
struct | XUsbPsu_Event_Devt
| struct XUsbPsu_event_devt - Device Events More...
struct | XUsbPsu_Event_Gevt
| struct XUsbPsu_event_gevt - Other Core Events More...
union | XUsbPsu_Event
| union XUsbPsu_event - representation of Event Buffer contents More...

## Macros
#define | XUSBPSU_H
| by using protection macros More...
#define | XUSBPSU_EP_DIR_IN 1U
| Direction IN. More...
#define | XUSBPSU_EP_DIR_OUT 0U
| Direction OUT. More...
#define | XUSBPSU_USB_DIR_OUT 0U
| Direction to device. More...
#define | XUSBPSU_USB_DIR_IN 0x80U
| Direction to host. More...
#define | XUSBPSU_ENDPOINT_XFERTYPE_MASK 0x03
| Transfer type mask. More...
#define | XUSBPSU_ENDPOINT_XFER_CONTROL 0U
| Control EP. More...
#define | XUSBPSU_ENDPOINT_XFER_ISOC 1U
| ISO EP. More...
#define | XUSBPSU_ENDPOINT_XFER_BULK 2U
| Bulk EP. More...
#define | XUSBPSU_ENDPOINT_XFER_INT 3U
| Interrupt EP. More...
#define | XUSBPSU_ENDPOINT_MAX_ADJUSTABLE 0x80
| Max EP. More...
#define | XUSBPSU_TEST_J 1U
| Test Mode J. More...
#define | XUSBPSU_TEST_K 2U
| Test Mode K. More...
#define | XUSBPSU_TEST_SE0_NAK 3U
| Test Mode SE0_NAK. More...
#define | XUSBPSU_TEST_PACKET 4U
| Test Mode TEST PACKET. More...
#define | XUSBPSU_TEST_FORCE_ENABLE 5U
| Test Mode FORCE ENABLE. More...
#define | XUSBPSU_STATE_ATTACHED 0U
| Device State Attach. More...
#define | XUSBPSU_STATE_POWERED 1U
| Device State Power. More...
#define | XUSBPSU_STATE_DEFAULT 2U
| Device State Default. More...
#define | XUSBPSU_STATE_ADDRESS 3U
| Device State Address. More...
#define | XUSBPSU_STATE_CONFIGURED 4U
| Device State Configure. More...
#define | XUSBPSU_STATE_SUSPENDED 5U
| Device State Suspend. More...
#define | XUSBPSU_SPEED_UNKNOWN 0U
| Device Speed Unknown. More...
#define | XUSBPSU_SPEED_LOW 1U
| Device Speed Low. More...
#define | XUSBPSU_SPEED_FULL 2U
| Device Speed Full. More...
#define | XUSBPSU_SPEED_HIGH 3U
| Device Speed High. More...
#define | XUSBPSU_SPEED_SUPER 4U
| Device Speed Speed. More...
#define | XUSBPSU_DEVTEN_VNDRDEVTSTRCVEDEN ((u32)0x00000001U << 12U)
| Vendor Device Test LMP Received Event. More...
#define | XUSBPSU_DEVTEN_EVNTOVERFLOWEN ((u32)0x00000001U << 11U)
| Reserved. More...
#define | XUSBPSU_DEVTEN_CMDCMPLTEN ((u32)0x00000001U << 10U)
| Reserved. More...
#define | XUSBPSU_DEVTEN_ERRTICERREN ((u32)0x00000001U << 9U)
| Erratic Error Event Enable. More...
#define | XUSBPSU_DEVTEN_SOFEN ((u32)0x00000001U << 7U)
| Start of (u)frame. More...
#define | XUSBPSU_DEVTEN_EOPFEN ((u32)0x00000001U << 6U)
| U3/L2-L1 Suspend Event Enable. More...
#define | XUSBPSU_DEVTEN_HIBERNATIONREQEVTEN ((u32)0x00000001U << 5U)
| Hibernation Request Event. More...
#define | XUSBPSU_DEVTEN_WKUPEVTEN ((u32)0x00000001U << 4U)
| Resume/Remote Wakeup Detected Event Enable. More...
#define | XUSBPSU_DEVTEN_ULSTCNGEN ((u32)0x00000001U << 3U)
| Link State Change Event Enable. More...
#define | XUSBPSU_DEVTEN_CONNECTDONEEN ((u32)0x00000001U << 2U)
| Connection Done Enable. More...
#define | XUSBPSU_DEVTEN_USBRSTEN ((u32)0x00000001U << 1U)
| USB Reset Enable. More...
#define | XUSBPSU_DEVTEN_DISCONNEVTEN ((u32)0x00000001U << 0U)
| Disconnect Detected Event Enable. More...

## Typedefs
typedef XUsbPsu_Config | Usb_Config
| typedef configuration structure More...

## Enumerations
enum | XusbPsuLinkState { XUSBPSU_LINK_STATE_U0 = 0x00U, XUSBPSU_LINK_STATE_U1 = 0x01U, XUSBPSU_LINK_STATE_U2 = 0x02U, XUSBPSU_LINK_STATE_U3 = 0x03U, XUSBPSU_LINK_STATE_SS_DIS = 0x04U, XUSBPSU_LINK_STATE_RX_DET = 0x05U, XUSBPSU_LINK_STATE_SS_INACT = 0x06U, XUSBPSU_LINK_STATE_POLL = 0x07U, XUSBPSU_LINK_STATE_RECOV = 0x08U, XUSBPSU_LINK_STATE_HRESET = 0x09U, XUSBPSU_LINK_STATE_CMPLY = 0x0AU, XUSBPSU_LINK_STATE_LPBK = 0x0BU, XUSBPSU_LINK_STATE_RESET = 0x0EU, XUSBPSU_LINK_STATE_RESUME = 0x0FU }
enum | XusbPsuLinkStateChange { XUSBPSU_LINK_STATE_CHANGE_U0 = 0x00U, XUSBPSU_LINK_STATE_CHANGE_SS_DIS = 0x04U, XUSBPSU_LINK_STATE_CHANGE_RX_DET = 0x05U, XUSBPSU_LINK_STATE_CHANGE_SS_INACT = 0x06U, XUSBPSU_LINK_STATE_CHANGE_RECOV = 0x08U, XUSBPSU_LINK_STATE_CHANGE_CMPLY = 0x0AU }

## Functions
s32 | XUsbPsu_CfgInitialize (struct XUsbPsu *InstancePtr, XUsbPsu_Config *ConfigPtr, u32 BaseAddress)
| This function does the following: More...
s32 | XUsbPsu_Start (struct XUsbPsu *InstancePtr)
| Starts the controller so that host can detect this device. More...
s32 | XUsbPsu_Stop (struct XUsbPsu *InstancePtr)
| Stops the controller so that the device disconnects from the host. More...
u8 | XUsbPsu_GetLinkState (struct XUsbPsu *InstancePtr)
| Gets current state of USB link. More...
s32 | XUsbPsu_SetLinkState (struct XUsbPsu *InstancePtr, XusbPsuLinkStateChange State)
| Sets USB Link to a particular State. More...
s32 | XUsbPsu_SetU1SleepTimeout (struct XUsbPsu *InstancePtr, u8 Timeout)
| Sets U1 sleep timeout. More...
s32 | XUsbPsu_SetU2SleepTimeout (struct XUsbPsu *InstancePtr, u8 Timeout)
| Sets U2 sleep timeout. More...
s32 | XUsbPsu_AcceptU1U2Sleep (struct XUsbPsu *InstancePtr)
| Enable Accept U1 and U2 sleep enable. More...
s32 | XUsbPsu_U1SleepEnable (struct XUsbPsu *InstancePtr)
| Enables U1 enable sleep. More...
s32 | XUsbPsu_U2SleepEnable (struct XUsbPsu *InstancePtr)
| Enables U2 enable sleep. More...
s32 | XUsbPsu_U1SleepDisable (struct XUsbPsu *InstancePtr)
| Enables U1 disable sleep. More...
s32 | XUsbPsu_U2SleepDisable (struct XUsbPsu *InstancePtr)
| Enables U2 disable sleep. More...
s32 | XUsbPsu_IsSuperSpeed (struct XUsbPsu *InstancePtr)
| Checks if the current speed is super speed or not. More...
struct XUsbPsu_Trb | __attribute__ ((packed))
| Transfer Request Block - Hardware format. More...
s32 | XUsbPsu_EpEnable (struct XUsbPsu *InstancePtr, u8 UsbEpNum, u8 Dir, u16 Maxsize, u8 Type, u8 Restore)
| Enables endpoint for sending/receiving data. More...
s32 | XUsbPsu_EpDisable (struct XUsbPsu *InstancePtr, u8 UsbEpNum, u8 Dir)
| Disables Endpoint. More...
void | XUsbPsu_ClearStalls (struct XUsbPsu *InstancePtr)
| Clears stall on all endpoints. More...
s32 | XUsbPsu_EpBufferSend (struct XUsbPsu *InstancePtr, u8 UsbEp, u8 *BufferPtr, u32 BufferLen)
| Initiates DMA to send data on endpoint to the host. More...
s32 | XUsbPsu_EpBufferRecv (struct XUsbPsu *InstancePtr, u8 UsbEp, u8 *BufferPtr, u32 Length)
| Initiates DMA to receive data on endpoint from host. More...
void | XUsbPsu_EpSetStall (struct XUsbPsu *InstancePtr, u8 Epnum, u8 Dir)
| Stalls an endpoint. More...
void | XUsbPsu_EpClearStall (struct XUsbPsu *InstancePtr, u8 Epnum, u8 Dir)
| Clears stall on an endpoint. More...
void | XUsbPsu_SetEpHandler (struct XUsbPsu *InstancePtr, u8 Epnum, u8 Dir, void(*Handler)(void *, u32, u32))
| Sets an user handler to be called after data is sent/received by an endpoint. More...
s32 | XUsbPsu_IsEpStalled (struct XUsbPsu *InstancePtr, u8 Epnum, u8 Dir)
| Returns status of endpoint whether it is stalled or not. More...
void | XUsbPsu_StopTransfer (struct XUsbPsu *InstancePtr, u8 UsbEpNum, u8 Dir, u8 Force)
| Stops transfer on Endpoint. More...
void | XUsbPsu_IntrHandler (void *XUsbPsuInstancePtr)
| Main interrupt handler. More...
void | XUsbPsu_EnableIntr (struct XUsbPsu *InstancePtr, u32 Mask)
| Enables an interrupt in event enable RegValister. More...
void | XUsbPsu_DisableIntr (struct XUsbPsu *InstancePtr, u32 Mask)
| Disables an interrupt in event enable RegValister. More...
s32 | XUsbPsu_SetDeviceAddress (struct XUsbPsu *InstancePtr, u16 Addr)
| Sets the device address of the core. More...
void | XUsbPsu_Idle (struct XUsbPsu *InstancePtr)
| This function puts the controller into idle state by stopping the transfers for all endpoints, stopping the usb core, and clearing the event buffers. More...
void | XUsbPsu_SetSpeed (struct XUsbPsu *InstancePtr, u32 Speed)
| Sets speed of the core for connecting to host. More...
void | XUsbPsu_Sleep (u32 USeconds)
| API for Sleep routine. More...
void | XUsbPsu_Ep0StallRestart (struct XUsbPsu *InstancePtr)
| Stalls control endpoint and restarts to receive setup packet. More...
XUsbPsu_Config * | XUsbPsu_LookupConfig (u16 DeviceId)
| Looks up the device configuration based on the unique device ID. More...
struct XUsbPsu_EpParams * | XUsbPsu_GetEpParams (struct XUsbPsu *InstancePtr)
| Returns zeroed parameters to be used by Endpoint commands. More...
s32 | XUsbPsu_SendEpCmd (struct XUsbPsu *InstancePtr, u8 UsbEpNum, u8 Dir, u32 Cmd, struct XUsbPsu_EpParams *Params)
| Sends Endpoint command to the Endpoint. More...
void | XUsbPsu_Ep0DataDone (struct XUsbPsu *InstancePtr, const struct XUsbPsu_Event_Epevt *Event)
| Checks the data phase and calls user endpoint handler. More...
void | XUsbPsu_Ep0StatusDone (struct XUsbPsu *InstancePtr)
| Checks the status phase and starts next control transfer. More...
s32 | XUsbPsu_Ep0StartStatus (struct XUsbPsu *InstancePtr, const struct XUsbPsu_Event_Epevt *Event)
| Starts status phase of control transfer. More...
void | XUsbPsu_Ep0_EndControlData (struct XUsbPsu *InstancePtr, struct XUsbPsu_Ep *Ept)
| Ends data phase which is used in case of the error. More...
s32 | XUsbPsu_EnableControlEp (struct XUsbPsu *InstancePtr, u16 Size)
| Enables USB control endpoint that is EP0OUT and EP0IN of Core. More...
void | XUsbPsu_PhyReset (struct XUsbPsu *InstancePtr)
| Issues core PHY reset. More...
s32 | XUsbPsu_WaitClearTimeout (struct XUsbPsu *InstancePtr, u32 Offset, u32 BitMask, u32 Timeout)
| Waits until a bit in a register is cleared or timeout occurs. More...
s32 | XUsbPsu_WaitSetTimeout (struct XUsbPsu *InstancePtr, u32 Offset, u32 BitMask, u32 Timeout)
| Waits until a bit in a register is set or timeout occurs. More...
u32 | XUsbPsu_ReadHwParams (struct XUsbPsu *InstancePtr, u8 RegIndex)
| Reads data from hardware parameters registers of the core. More...
s32 | XUsbPsu_SetTestMode (struct XUsbPsu *InstancePtr, u32 Mode)
| Enables USB2 test modes. More...
s32 | XUsbPsu_CoreInit (struct XUsbPsu *InstancePtr)
| Initializes the core. More...
void | XUsbPsu_EventBuffersSetup (struct XUsbPsu *InstancePtr)
| Sets up the event buffers so that events are written by Core. More...
u32 | XUsbPsu_EpGetTransferIndex (struct XUsbPsu *InstancePtr, u8 UsbEpNum, u8 Dir)
| Returns transfer index assigned by Core for an endpoint transfer. More...
s32 | XUsbPsu_StartEpConfig (struct XUsbPsu *InstancePtr, u32 UsbEpNum, u8 Dir)
| Sends start new configuration command to the endpoint. More...
s32 | XUsbPsu_SetEpConfig (struct XUsbPsu *InstancePtr, u8 UsbEpNum, u8 Dir, u16 Size, u8 Type, u8 Restore)
| Sends set endpoint configuration command to the endpoint. More...
s32 | XUsbPsu_SetXferResource (struct XUsbPsu *InstancePtr, u8 UsbEpNum, u8 Dir)
| Sends set transfer resource command to the endpoint. More...
void | XUsbPsu_StopActiveTransfers (struct XUsbPsu *InstancePtr)
| Stops any active transfer. More...
void | XUsbPsu_ClearStallAllEp (struct XUsbPsu *InstancePtr)
| Clears stall on all stalled endpoints. More...
s32 | XUsbPsu_RecvSetup (struct XUsbPsu *InstancePtr)
| Initiates DMA on control endpoint 0 to receive setup packet. More...
void | XUsbPsu_Ep0XferComplete (struct XUsbPsu *InstancePtr, const struct XUsbPsu_Event_Epevt *Event)
| Handles transfer complete event of control endpoints EP0 OUT and EP0 IN. More...
void | XUsbPsu_Ep0XferNotReady (struct XUsbPsu *InstancePtr, const struct XUsbPsu_Event_Epevt *Event)
| Handles transfer not ready event of control endpoints EP0 OUT and EP0 IN. More...
s32 | XUsbPsu_Ep0Send (struct XUsbPsu *InstancePtr, u8 *BufferPtr, u32 BufferLen)
| Initiates DMA to send data on control endpoint EP0 IN to host. More...
s32 | XUsbPsu_Ep0Recv (struct XUsbPsu *InstancePtr, u8 *BufferPtr, u32 Length)
| Initiates DMA to receive data on control endpoint EP0 OUT from host. More...
void | XUsbPsu_EpTransferDeactive (struct XUsbPsu *InstancePtr, u8 UsbEpNum, u8 Dir)
| Resets and deactivates transfer endpoint. More...
void | XUsbPsu_SaveEndpointState (struct XUsbPsu *InstancePtr, struct XUsbPsu_Ep *Ept)
| Queries endpoint state and saves it in EpSavedState. More...
void | XUsbPsu_EpXferComplete (struct XUsbPsu *InstancePtr, const struct XUsbPsu_Event_Epevt *Event)
| Checks the data phase and calls user endpoint handler. More...
void | XUsbPsu_EpXferNotReady (struct XUsbPsu *InstancePtr, const struct XUsbPsu_Event_Epevt *Event)
| For Isochronous transfer, gets the microframe time and calls respective endpoint handler. More...
void | XUsbPsu_EpEvent (struct XUsbPsu *InstancePtr, const struct XUsbPsu_Event_Epevt *Event)
| Endpoint event handler. More...
void | XUsbPsu_DeviceEvent (struct XUsbPsu *InstancePtr, const struct XUsbPsu_Event_Devt *Event)
| Device event handler for device specific events. More...
void | XUsbPsu_EventBufferHandler (struct XUsbPsu *InstancePtr)
| Processes events in an event buffer. More...
void | XUsbPsu_DisconnectIntr (struct XUsbPsu *InstancePtr)
| Disconnects interrupt handler. More...
void | XUsbPsu_ResetIntr (struct XUsbPsu *InstancePtr)
| Resets interrupt handler. More...
void | XUsbPsu_Ep0Intr (struct XUsbPsu *InstancePtr, const struct XUsbPsu_Event_Epevt *Event)
| Handle interrupts of control endpoints EP0 OUT and EP0 IN. More...
void | XUsbPsu_ConnDoneIntr (struct XUsbPsu *InstancePtr)
| Interrupt handler which indicates that the connection is completed. More...
void | XUsbPsu_LinkStsChangeIntr (struct XUsbPsu *InstancePtr, u32 EvtInfo)
| Link status change interrupt handler. More...
void | XUsbPsu_EventHandler (struct XUsbPsu *InstancePtr, const union XUsbPsu_Event *Event)
| Processes an event entry in the event Buffer. More...

## Variables
struct XUsbPsu_EpParams | __attribute__
| Endpoint Parameters. More...
XUsbPsu_Config | XUsbPsu_ConfigTable []
| Configuration table. More...

## Macro Definition Documentation

#define XUSBPSU_DEVTEN_CMDCMPLTEN ((u32)0x00000001U << 10U)

Reserved.

#define XUSBPSU_DEVTEN_CONNECTDONEEN ((u32)0x00000001U << 2U)

Connection Done Enable.

Referenced by main().

#define XUSBPSU_DEVTEN_DISCONNEVTEN ((u32)0x00000001U << 0U)

Disconnect Detected Event Enable.

Referenced by main().

#define XUSBPSU_DEVTEN_EOPFEN ((u32)0x00000001U << 6U)

U3/L2-L1 Suspend Event Enable.

#define XUSBPSU_DEVTEN_ERRTICERREN ((u32)0x00000001U << 9U)

Erratic Error Event Enable.

#define XUSBPSU_DEVTEN_EVNTOVERFLOWEN ((u32)0x00000001U << 11U)

Reserved.

Referenced by main().

#define XUSBPSU_DEVTEN_HIBERNATIONREQEVTEN ((u32)0x00000001U << 5U)

Hibernation Request Event.

Referenced by main().

#define XUSBPSU_DEVTEN_SOFEN ((u32)0x00000001U << 7U)

Start of (u)frame.

#define XUSBPSU_DEVTEN_ULSTCNGEN ((u32)0x00000001U << 3U)

Link State Change Event Enable.

Referenced by main().

#define XUSBPSU_DEVTEN_USBRSTEN ((u32)0x00000001U << 1U)

USB Reset Enable.

Referenced by main().

#define XUSBPSU_DEVTEN_VNDRDEVTSTRCVEDEN ((u32)0x00000001U << 12U)

Vendor Device Test LMP Received Event.

#define XUSBPSU_DEVTEN_WKUPEVTEN ((u32)0x00000001U << 4U)

Resume/Remote Wakeup Detected Event Enable.

Referenced by main().

#define XUSBPSU_ENDPOINT_MAX_ADJUSTABLE 0x80

Max EP.

#define XUSBPSU_ENDPOINT_XFER_BULK 2U

Bulk EP.

Referenced by XUsbPsu_EpBufferRecv(), and XUsbPsu_EpBufferSend().

#define XUSBPSU_ENDPOINT_XFER_CONTROL 0U

Control EP.

Referenced by XUsbPsu_EnableControlEp().

#define XUSBPSU_ENDPOINT_XFER_INT 3U

Interrupt EP.

Referenced by XUsbPsu_EpBufferRecv(), and XUsbPsu_EpBufferSend().

#define XUSBPSU_ENDPOINT_XFER_ISOC 1U

ISO EP.

Referenced by XUsbPsu_EpBufferRecv(), XUsbPsu_EpBufferSend(), XUsbPsu_EpXferNotReady(), and XUsbPsu_SetEpConfig().

#define XUSBPSU_ENDPOINT_XFERTYPE_MASK 0x03

Transfer type mask.

#define XUSBPSU_EP_DIR_IN 1U

Direction IN.

Referenced by XUsbPsu_EnableControlEp(), XUsbPsu_Ep0DataDone(), XUsbPsu_Ep0Send(), XUsbPsu_EpBufferSend(), XUsbPsu_EpClearStall(), XUsbPsu_EpDisable(), XUsbPsu_EpEnable(), XUsbPsu_EpGetTransferIndex(), XUsbPsu_EpSetStall(), XUsbPsu_EpTransferDeactive(), XUsbPsu_EpXferComplete(), XUsbPsu_Idle(), XUsbPsu_IsEpStalled(), XUsbPsu_SendEpCmd(), XUsbPsu_SetEpHandler(), and XUsbPsu_StopTransfer().

#define XUSBPSU_EP_DIR_OUT 0U

Direction OUT.

Referenced by XUsbPsu_EnableControlEp(), XUsbPsu_Ep0DataDone(), XUsbPsu_Ep0Recv(), XUsbPsu_Ep0StallRestart(), XUsbPsu_Ep0XferComplete(), XUsbPsu_EpBufferRecv(), XUsbPsu_EpClearStall(), XUsbPsu_EpDisable(), XUsbPsu_EpEnable(), XUsbPsu_EpGetTransferIndex(), XUsbPsu_EpSetStall(), XUsbPsu_EpTransferDeactive(), XUsbPsu_EpXferComplete(), XUsbPsu_Idle(), XUsbPsu_IsEpStalled(), XUsbPsu_RecvSetup(), XUsbPsu_SendEpCmd(), XUsbPsu_SetEpConfig(), XUsbPsu_SetEpHandler(), XUsbPsu_StartEpConfig(), and XUsbPsu_StopTransfer().

#define XUSBPSU_H

by using protection macros

#define XUSBPSU_SPEED_FULL 2U

Device Speed Full.

Referenced by XUsbPsu_ConnDoneIntr().

#define XUSBPSU_SPEED_HIGH 3U

Device Speed High.

Referenced by XUsbPsu_ConnDoneIntr().

#define XUSBPSU_SPEED_LOW 1U

Device Speed Low.

Referenced by XUsbPsu_ConnDoneIntr().

#define XUSBPSU_SPEED_SUPER 4U

Device Speed Speed.

Referenced by XUsbPsu_ConnDoneIntr(), XUsbPsu_IsSuperSpeed(), and XUsbPsu_SetEpConfig().

#define XUSBPSU_SPEED_UNKNOWN 0U

Device Speed Unknown.

Referenced by XUsbPsu_DisconnectIntr().

#define XUSBPSU_STATE_ADDRESS 3U

Device State Address.

Referenced by XUsbPsu_SetDeviceAddress().

#define XUSBPSU_STATE_ATTACHED 0U

Device State Attach.

#define XUSBPSU_STATE_CONFIGURED 4U

Device State Configure.

Referenced by XUsbPsu_SetDeviceAddress().

#define XUSBPSU_STATE_DEFAULT 2U

Device State Default.

Referenced by XUsbPsu_ResetIntr(), and XUsbPsu_SetDeviceAddress().

#define XUSBPSU_STATE_POWERED 1U

Device State Power.

#define XUSBPSU_STATE_SUSPENDED 5U

Device State Suspend.

#define XUSBPSU_TEST_FORCE_ENABLE 5U

Test Mode FORCE ENABLE.

Referenced by XUsbPsu_SetTestMode().

#define XUSBPSU_TEST_J 1U

Test Mode J.

Referenced by XUsbPsu_SetTestMode().

#define XUSBPSU_TEST_K 2U

Test Mode K.

Referenced by XUsbPsu_SetTestMode().

#define XUSBPSU_TEST_PACKET 4U

Test Mode TEST PACKET.

Referenced by XUsbPsu_SetTestMode().

#define XUSBPSU_TEST_SE0_NAK 3U

Test Mode SE0_NAK.

Referenced by XUsbPsu_SetTestMode().

#define XUSBPSU_USB_DIR_IN 0x80U

Direction to host.

Referenced by XUsbPsu_Ep0XferComplete().

#define XUSBPSU_USB_DIR_OUT 0U

Direction to device.

## Typedef Documentation

typedef XUsbPsu_Config Usb_Config

typedef configuration structure

## Enumeration Type Documentation

enum XusbPsuLinkState

Parameters

  XusbPsuLinkState | This typedef defines link state.

Enumerator
XUSBPSU_LINK_STATE_U0 | U0 state/ in HS - ON.
XUSBPSU_LINK_STATE_U1 | U1 state.
XUSBPSU_LINK_STATE_U2 | U2 state/ in HS - SLEEP.
XUSBPSU_LINK_STATE_U3 | U3 state/ in HS - SUSPEND.
XUSBPSU_LINK_STATE_SS_DIS | SuperSpeed connectivity is disabled.
XUSBPSU_LINK_STATE_RX_DET | Warm reset, Receiver detection.
XUSBPSU_LINK_STATE_SS_INACT | Link has failed SuperSpeed operation.
XUSBPSU_LINK_STATE_POLL | POLL.
XUSBPSU_LINK_STATE_RECOV | Retrain SuperSpeed link, Perform Hot reset, Switch to Loop back mode.
XUSBPSU_LINK_STATE_HRESET | Hot reset using Training sets.
XUSBPSU_LINK_STATE_CMPLY | Test the transmitter for compliance to voltage and timing specifications.
XUSBPSU_LINK_STATE_LPBK | For test and fault isolation.
XUSBPSU_LINK_STATE_RESET | RESET.
XUSBPSU_LINK_STATE_RESUME | RESUME.

enum XusbPsuLinkStateChange

Parameters

  XusbPsuLinkStateChange | This typedef defines link state change.

Enumerator
XUSBPSU_LINK_STATE_CHANGE_U0 | U0 /in HS - ON.
XUSBPSU_LINK_STATE_CHANGE_SS_DIS | SuperSpeed connectivity is disabled.
XUSBPSU_LINK_STATE_CHANGE_RX_DET | Warm reset, Receiver detection.
XUSBPSU_LINK_STATE_CHANGE_SS_INACT | Link has failed SuperSpeed operation.
XUSBPSU_LINK_STATE_CHANGE_RECOV | Retrain SuperSpeed link, Perform Hot reset, Switch to Loop back mode.
XUSBPSU_LINK_STATE_CHANGE_CMPLY | Test the transmitter for compliance to voltage and timing specifications.

## Function Documentation

struct XUsbPsu_Trb __attribute__ | ( | (packed) |  | ) |

Transfer Request Block - Hardware format.

Core events.

Device Events.

Device Endpoint Events.

Device Endpoint Events type.

s32 XUsbPsu_AcceptU1U2Sleep | ( | struct XUsbPsu * | InstancePtr | ) |

Enable Accept U1 and U2 sleep enable.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  XST_SUCCESS else XST_FAILURE

s32 XUsbPsu_CfgInitialize | ( | struct XUsbPsu * | InstancePtr,
|  | XUsbPsu_Config * | ConfigPtr,
|  | u32 | BaseAddress
| ) |  |

This function does the following:

      - initializes a specific XUsbPsu instance.
      - sets up Event Buffer for Core to write events.
      - Core Reset and PHY Reset.
      - Sets core in Device Mode.
      - Sets default speed as HIGH_SPEED.
      - Sets Device Address to 0.
      - Enables interrupts.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  ConfigPtr | Points to the XUsbPsu device configuration structure.
  BaseAddress | Device base address in the virtual memory address space. If the address translation is not used then the physical address is passed. Unexpected errors may occur if the address mapping is changed after this function is invoked.

Returns
  XST_SUCCESS else XST_FAILURE

References XUsbPsu::ConfigPtr, XUsbPsu_Config::EnableSuperSpeed, XUsbPsu::NumInEps, XUsbPsu::NumOutEps, Status, XUsbPsu_CoreInit(), XUsbPsu_EventBuffersSetup(), XUsbPsu_ReadHwParams(), XUsbPsu_SetDeviceAddress(), and XUsbPsu_SetSpeed().

void XUsbPsu_ClearStallAllEp | ( | struct XUsbPsu * | InstancePtr | ) |

Clears stall on all stalled endpoints.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  None.

References XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::UsbEpNum, and XUsbPsu_EpClearStall().

Referenced by XUsbPsu_ResetIntr().

void XUsbPsu_ClearStalls | ( | struct XUsbPsu * | InstancePtr | ) |

Clears stall on all endpoints.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  None.

References XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::UsbEpNum, XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().

void XUsbPsu_ConnDoneIntr | ( | struct XUsbPsu * | InstancePtr | ) |

Interrupt handler which indicates that the connection is completed.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  None.

References XUsbPsu::AppData, XUsbPsu::HasHibernation, Size, Usb_DevData::Speed, XUsbPsu_EnableControlEp(), XUsbPsu_RecvSetup(), XUSBPSU_SPEED_FULL, XUSBPSU_SPEED_HIGH, XUSBPSU_SPEED_LOW, and XUSBPSU_SPEED_SUPER.

Referenced by XUsbPsu_DeviceEvent().

s32 XUsbPsu_CoreInit | ( | struct XUsbPsu * | InstancePtr | ) |

Initializes the core.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance to be worked on.

Returns
  - XST_SUCCESS if initialization was successful.
  - XST_FAILURE if initialization was not successful.

References XUsbPsu::ConfigPtr, XUsbPsu::HasHibernation, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_PhyReset(), XUsbPsu_ReadHwParams(), and XUsbPsu_WaitClearTimeout().

Referenced by XUsbPsu_CfgInitialize().

void XUsbPsu_DeviceEvent | ( | struct XUsbPsu * | InstancePtr,
|  | const struct XUsbPsu_Event_Devt * | Event
| ) |  |

Device event handler for device specific events.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Event | Device Event occurred in core.

Returns
  None.

References XUsbPsu_Event_Devt::Event_Info, XUsbPsu::HasHibernation, XUsbPsu_Event_Devt::Type, XUsbPsu_ConnDoneIntr(), XUsbPsu_DisconnectIntr(), XUsbPsu_LinkStsChangeIntr(), and XUsbPsu_ResetIntr().

Referenced by XUsbPsu_EventHandler().

void XUsbPsu_DisableIntr | ( | struct XUsbPsu * | InstancePtr,
|  | u32 | Mask
| ) |  |

Disables an interrupt in event enable RegValister.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance to be worked on.
  Mask | OR of Interrupt Enable Masks XUSBPSU_DEVTEN_VNDRDEVTSTRCVEDEN XUSBPSU_DEVTEN_EVNTOVERFLOWEN XUSBPSU_DEVTEN_CMDCMPLTEN XUSBPSU_DEVTEN_ERRTICERREN XUSBPSU_DEVTEN_SOFEN XUSBPSU_DEVTEN_EOPFEN XUSBPSU_DEVTEN_HIBERNATIONREQEVTEN XUSBPSU_DEVTEN_WKUPEVTEN XUSBPSU_DEVTEN_ULSTCNGEN XUSBPSU_DEVTEN_CONNECTDONEEN XUSBPSU_DEVTEN_USBRSTEN XUSBPSU_DEVTEN_DISCONNEVTEN

Returns
  None

void XUsbPsu_DisconnectIntr | ( | struct XUsbPsu * | InstancePtr | ) |

Disconnects interrupt handler.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  None.

References XUsbPsu::AppData, XUsbPsu::DisconnectIntrHandler, XUsbPsu::HasHibernation, XUsbPsu::IsConfigDone, Usb_DevData::Speed, and XUSBPSU_SPEED_UNKNOWN.

Referenced by XUsbPsu_DeviceEvent().

s32 XUsbPsu_EnableControlEp | ( | struct XUsbPsu * | InstancePtr,
|  | u16 | Size
| ) |  |

Enables USB control endpoint that is EP0OUT and EP0IN of Core.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Size | Control endpoint size.

Returns
  XST_SUCCESS else XST_FAILURE.

References XUSBPSU_ENDPOINT_XFER_CONTROL, XUSBPSU_EP_DIR_IN, XUSBPSU_EP_DIR_OUT, and XUsbPsu_EpEnable().

Referenced by XUsbPsu_ConnDoneIntr().

void XUsbPsu_EnableIntr | ( | struct XUsbPsu * | InstancePtr,
|  | u32 | Mask
| ) |  |

Enables an interrupt in event enable RegValister.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance to be worked on.
  Mask | OR of any interrupt enable Masks: XUSBPSU_DEVTEN_VNDRDEVTSTRCVEDEN XUSBPSU_DEVTEN_EVNTOVERFLOWEN XUSBPSU_DEVTEN_CMDCMPLTEN XUSBPSU_DEVTEN_ERRTICERREN XUSBPSU_DEVTEN_SOFEN XUSBPSU_DEVTEN_EOPFEN XUSBPSU_DEVTEN_HIBERNATIONREQEVTEN XUSBPSU_DEVTEN_WKUPEVTEN XUSBPSU_DEVTEN_ULSTCNGEN XUSBPSU_DEVTEN_CONNECTDONEEN XUSBPSU_DEVTEN_USBRSTEN XUSBPSU_DEVTEN_DISCONNEVTEN

Returns
  None

Referenced by main(), and UsbEnableEvent().

void XUsbPsu_Ep0_EndControlData | ( | struct XUsbPsu * | InstancePtr,
|  | struct XUsbPsu_Ep * | Ept
| ) |  |

Ends data phase which is used in case of the error.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Ept | Pointer to the Endpoint structure.

Returns
  None

References XUsbPsu_Ep::Direction, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Ep::UsbEpNum, XUsbPsu_GetEpParams(), XUsbPsu_SendEpCmd(), and XUsbPsu_Sleep().

Referenced by XUsbPsu_Ep0XferNotReady().

void XUsbPsu_Ep0DataDone | ( | struct XUsbPsu * | InstancePtr,
|  | const struct XUsbPsu_Event_Epevt * | Event
| ) |  |

Checks the data phase and calls user endpoint handler.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Event | Pointer to the Endpoint event occurred in core.

Returns
  None.

References XUsbPsu::AppData, XUsbPsu_Ep::BufferPtr, XUsbPsu_Ep::BytesTxed, XUsbPsu::ConfigPtr, XUsbPsu_Event_Epevt::Epnumber, XUsbPsu::eps, XUsbPsu_Ep::Handler, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_Ep::RequestedBytes, XUsbPsu_Trb::Size, Status, XUsbPsu_Ep::UnalignedTx, XUSBPSU_EP_DIR_IN, and XUSBPSU_EP_DIR_OUT.

Referenced by XUsbPsu_Ep0XferComplete().

void XUsbPsu_Ep0Intr | ( | struct XUsbPsu * | InstancePtr,
|  | const struct XUsbPsu_Event_Epevt * | Event
| ) |  |

Handle interrupts of control endpoints EP0 OUT and EP0 IN.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Event | Pointer to the Endpoint event occurred in core.

Returns
  None.

References XUsbPsu_Event_Epevt::Endpoint_Event, XUsbPsu_Ep0XferComplete(), and XUsbPsu_Ep0XferNotReady().

Referenced by XUsbPsu_EpEvent().

s32 XUsbPsu_Ep0Recv | ( | struct XUsbPsu * | InstancePtr,
|  | u8 * | BufferPtr,
|  | u32 | Length
| ) |  |

Initiates DMA to receive data on control endpoint EP0 OUT from host.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  BufferPtr | Pointer to data.
  Length | Length of data to be received.

Returns
  XST_SUCCESS else XST_FAILURE

References XUsbPsu_Ep::BufferPtr, XUsbPsu_Trb::BufferPtrHigh, XUsbPsu_Trb::BufferPtrLow, XUsbPsu_Ep::BytesTxed, XUsbPsu::ConfigPtr, XUsbPsu_Trb::Ctrl, XUsbPsu_Ep::Direction, XUsbPsu::Ep0State, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_Ep::MaxSize, XUsbPsu_EpParams::Param0, XUsbPsu_EpParams::Param1, XUsbPsu_Ep::RequestedBytes, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Trb::Size, Size, XUsbPsu_Ep::UnalignedTx, XUsbPsu_Ep::UsbEpNum, XUSBPSU_EP_DIR_OUT, XUsbPsu_EpGetTransferIndex(), XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().

Referenced by XUsbPsu_EpBufferRecv().

s32 XUsbPsu_Ep0Send | ( | struct XUsbPsu * | InstancePtr,
|  | u8 * | BufferPtr,
|  | u32 | BufferLen
| ) |  |

Initiates DMA to send data on control endpoint EP0 IN to host.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  BufferPtr | Pointer to data.
  BufferLen | Length of data buffer.

Returns
  XST_SUCCESS else XST_FAILURE

References XUsbPsu_Ep::BufferPtr, XUsbPsu_Trb::BufferPtrHigh, XUsbPsu_Trb::BufferPtrLow, XUsbPsu_Ep::BytesTxed, XUsbPsu::ConfigPtr, XUsbPsu_Trb::Ctrl, XUsbPsu_Ep::Direction, XUsbPsu::Ep0State, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_EpParams::Param0, XUsbPsu_EpParams::Param1, XUsbPsu_Ep::RequestedBytes, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Trb::Size, XUsbPsu_Ep::UsbEpNum, XUSBPSU_EP_DIR_IN, XUsbPsu_EpGetTransferIndex(), XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().

Referenced by XUsbPsu_EpBufferSend().

void XUsbPsu_Ep0StallRestart | ( | struct XUsbPsu * | InstancePtr | ) |

Stalls control endpoint and restarts to receive setup packet.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  None

References XUsbPsu::Ep0State, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUSBPSU_EP_DIR_OUT, XUsbPsu_EpSetStall(), and XUsbPsu_RecvSetup().

Referenced by XUsbPsu_Ep0StatusDone(), and XUsbPsu_Ep0XferNotReady().

s32 XUsbPsu_Ep0StartStatus | ( | struct XUsbPsu * | InstancePtr,
|  | const struct XUsbPsu_Event_Epevt * | Event
| ) |  |

Starts status phase of control transfer.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Event | Pointer to the Endpoint event occurred in core.

Returns
  XST_SUCCESS else XST_FAILURE

References XUsbPsu_Trb::BufferPtrHigh, XUsbPsu_Trb::BufferPtrLow, XUsbPsu::ConfigPtr, XUsbPsu::ControlDir, XUsbPsu_Trb::Ctrl, XUsbPsu_Ep::Direction, XUsbPsu::Ep0State, XUsbPsu_Event_Epevt::Epnumber, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu::IsThreeStage, XUsbPsu_EpParams::Param0, XUsbPsu_EpParams::Param1, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Trb::Size, Type, XUsbPsu_Ep::UsbEpNum, XUsbPsu_EpGetTransferIndex(), XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().

Referenced by XUsbPsu_Ep0XferNotReady().

void XUsbPsu_Ep0StatusDone | ( | struct XUsbPsu * | InstancePtr | ) |

Checks the status phase and starts next control transfer.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  None.

References XUsbPsu::ConfigPtr, XUsbPsu_Config::IsCacheCoherent, XUsbPsu::IsInTestMode, XUsbPsu::TestMode, XUsbPsu_Ep0StallRestart(), XUsbPsu_RecvSetup(), and XUsbPsu_SetTestMode().

Referenced by XUsbPsu_Ep0XferComplete().

void XUsbPsu_Ep0XferComplete | ( | struct XUsbPsu * | InstancePtr,
|  | const struct XUsbPsu_Event_Epevt * | Event
| ) |  |

Handles transfer complete event of control endpoints EP0 OUT and EP0 IN.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Event | Pointer to the Endpoint event occurred in core.

Returns
  None.

References XUsbPsu::AppData, XUsbPsu::Chapter9, XUsbPsu::ConfigPtr, XUsbPsu::ControlDir, Ctrl, XUsbPsu::Ep0State, XUsbPsu_Event_Epevt::Epnumber, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu::IsThreeStage, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Ep0DataDone(), XUsbPsu_Ep0StatusDone(), XUSBPSU_EP_DIR_OUT, and XUSBPSU_USB_DIR_IN.

Referenced by XUsbPsu_Ep0Intr().

void XUsbPsu_Ep0XferNotReady | ( | struct XUsbPsu * | InstancePtr,
|  | const struct XUsbPsu_Event_Epevt * | Event
| ) |  |

Handles transfer not ready event of control endpoints EP0 OUT and EP0 IN.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Event | Pointer to the Endpoint event occurred in core.

Returns
  None.

References XUsbPsu::ControlDir, XUsbPsu_Event_Epevt::Epnumber, XUsbPsu::eps, XUsbPsu_Event_Epevt::Status, XUsbPsu_Ep0_EndControlData(), XUsbPsu_Ep0StallRestart(), and XUsbPsu_Ep0StartStatus().

Referenced by XUsbPsu_Ep0Intr().

s32 XUsbPsu_EpBufferRecv | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | UsbEp,
|  | u8 * | BufferPtr,
|  | u32 | Length
| ) |  |

Initiates DMA to receive data on endpoint from host.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  UsbEp | USB endpoint number.
  BufferPtr | Pointer to data. This data buffer is cache-aligned.
  Length | Length of data to be received.

Returns
  XST_SUCCESS else XST_FAILURE

Note
  This function is expected to initiates DMA to receive data on the endpoint from the host. This data buffer should be aligned.

References XUsbPsu_Ep::BufferPtr, XUsbPsu_Trb::BufferPtrHigh, XUsbPsu_Trb::BufferPtrLow, XUsbPsu_Ep::BytesTxed, XUsbPsu::ConfigPtr, XUsbPsu_Trb::Ctrl, XUsbPsu_Ep::CurUf, XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_Ep::MaxSize, XUsbPsu_EpParams::Param0, XUsbPsu_EpParams::Param1, XUsbPsu_EpParams::Param2, XUsbPsu_Ep::RequestedBytes, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Trb::Size, Size, XUsbPsu_Ep::TrbEnqueue, XUsbPsu_Ep::Type, XUsbPsu_Ep::UnalignedTx, XUsbPsu_Ep::UsbEpNum, XUSBPSU_ENDPOINT_XFER_BULK, XUSBPSU_ENDPOINT_XFER_INT, XUSBPSU_ENDPOINT_XFER_ISOC, XUsbPsu_Ep0Recv(), XUSBPSU_EP_DIR_OUT, XUsbPsu_EpGetTransferIndex(), and XUsbPsu_SendEpCmd().

s32 XUsbPsu_EpBufferSend | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | UsbEp,
|  | u8 * | BufferPtr,
|  | u32 | BufferLen
| ) |  |

Initiates DMA to send data on endpoint to the host.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  UsbEp | USB endpoint number.
  BufferPtr | Pointer to data. This data buffer is cache-aligned.
  BufferLen | Length of data buffer.

Returns
  XST_SUCCESS else XST_FAILURE

Note
  This function is expected to initiates DMA to send data on endpoint towards host. This data buffer should be aligned.

References XUsbPsu_Ep::BufferPtr, XUsbPsu_Trb::BufferPtrHigh, XUsbPsu_Trb::BufferPtrLow, XUsbPsu_Ep::BytesTxed, XUsbPsu::ConfigPtr, XUsbPsu_Trb::Ctrl, XUsbPsu_Ep::CurUf, XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_EpParams::Param0, XUsbPsu_EpParams::Param1, XUsbPsu_EpParams::Param2, XUsbPsu_Ep::PhyEpNum, XUsbPsu_Ep::RequestedBytes, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Trb::Size, XUsbPsu_Ep::TrbEnqueue, XUsbPsu_Ep::Type, XUsbPsu_Ep::UsbEpNum, XUSBPSU_ENDPOINT_XFER_BULK, XUSBPSU_ENDPOINT_XFER_INT, XUSBPSU_ENDPOINT_XFER_ISOC, XUsbPsu_Ep0Send(), XUSBPSU_EP_DIR_IN, XUsbPsu_EpGetTransferIndex(), and XUsbPsu_SendEpCmd().

void XUsbPsu_EpClearStall | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | Epnum,
|  | u8 | Dir
| ) |  |

Clears stall on an endpoint.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Epnum | USB endpoint number.
  Dir | Direction.

Returns
  None.

References XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::UsbEpNum, XUSBPSU_EP_DIR_IN, XUSBPSU_EP_DIR_OUT, XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().

Referenced by XUsbPsu_ClearStallAllEp(), and XUsbPsu_EpDisable().

s32 XUsbPsu_EpDisable | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | UsbEpNum,
|  | u8 | Dir
| ) |  |

Disables Endpoint.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  UsbEpNum | USB endpoint number.
  Dir | Direction of endpoint XUSBPSU_EP_DIR_IN/XUSBPSU_EP_DIR_OUT.

Returns
  XST_SUCCESS else XST_FAILURE.

References XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::MaxSize, XUsbPsu_Ep::PhyEpNum, XUsbPsu_Ep::TrbDequeue, XUsbPsu_Ep::TrbEnqueue, XUsbPsu_Ep::Type, XUsbPsu_Ep::UsbEpNum, XUSBPSU_EP_DIR_IN, XUSBPSU_EP_DIR_OUT, and XUsbPsu_EpClearStall().

s32 XUsbPsu_EpEnable | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | UsbEpNum,
|  | u8 | Dir,
|  | u16 | Maxsize,
|  | u8 | Type,
|  | u8 | Restore
| ) |  |

Enables endpoint for sending/receiving data.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  UsbEpNum | USB endpoint number.
  Dir | Direction of endpoint XUSBPSU_EP_DIR_IN/XUSBPSU_EP_DIR_OUT.
  Maxsize | Size of Endpoint size.
  Type | Endpoint type Control/Bulk/Interrupt/Isoc.
  Restore | Typically False, True if saved state has to be restored.

Returns
  XST_SUCCESS else XST_FAILURE.

References XUsbPsu_Trb::BufferPtrHigh, XUsbPsu_Trb::BufferPtrLow, XUsbPsu::ConfigPtr, XUsbPsu_Trb::Ctrl, XUsbPsu_Ep::CurUf, XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu::IsHibernated, XUsbPsu_Ep::MaxSize, XUsbPsu_Ep::PhyEpNum, XUsbPsu_Ep::TrbDequeue, XUsbPsu_Ep::TrbEnqueue, XUsbPsu_Ep::Type, Type, XUsbPsu_Ep::UsbEpNum, XUSBPSU_EP_DIR_IN, XUSBPSU_EP_DIR_OUT, XUsbPsu_SetEpConfig(), XUsbPsu_SetXferResource(), and XUsbPsu_StartEpConfig().

Referenced by XUsbPsu_EnableControlEp().

void XUsbPsu_EpEvent | ( | struct XUsbPsu * | InstancePtr,
|  | const struct XUsbPsu_Event_Epevt * | Event
| ) |  |

Endpoint event handler.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Event | Endpoint Event occurred in the core.

Returns
  None.

References XUsbPsu_Event_Epevt::Endpoint_Event, XUsbPsu_Event_Epevt::Epnumber, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep0Intr(), XUsbPsu_EpXferComplete(), and XUsbPsu_EpXferNotReady().

Referenced by XUsbPsu_EventHandler().

u32 XUsbPsu_EpGetTransferIndex | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | UsbEpNum,
|  | u8 | Dir
| ) |  |

Returns transfer index assigned by Core for an endpoint transfer.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  UsbEpNum | USB endpoint number.
  Dir | Direction of endpoint XUSBPSU_EP_DIR_IN/XUSBPSU_EP_DIR_OUT

Returns
  Transfer Resource Index.

References XUSBPSU_EP_DIR_IN, and XUSBPSU_EP_DIR_OUT.

Referenced by XUsbPsu_Ep0Recv(), XUsbPsu_Ep0Send(), XUsbPsu_Ep0StartStatus(), XUsbPsu_EpBufferRecv(), XUsbPsu_EpBufferSend(), and XUsbPsu_RecvSetup().

void XUsbPsu_EpSetStall | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | Epnum,
|  | u8 | Dir
| ) |  |

Stalls an endpoint.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Epnum | USB endpoint number.
  Dir | Direction

Returns
  None.

References XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::UsbEpNum, XUSBPSU_EP_DIR_IN, XUSBPSU_EP_DIR_OUT, XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().

Referenced by XUsbPsu_Ep0StallRestart().

void XUsbPsu_EpTransferDeactive | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | UsbEpNum,
|  | u8 | Dir
| ) |  |

Resets and deactivates transfer endpoint.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  UsbEpNum | USB endpoint number.
  Dir | Direction of endpoint XUSBPSU_EP_DIR_IN/XUSBPSU_EP_DIR_OUT.

Returns
  None.

References XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::MaxSize, XUsbPsu_Ep::PhyEpNum, XUsbPsu_Ep::TrbDequeue, XUsbPsu_Ep::TrbEnqueue, XUsbPsu_Ep::Type, XUSBPSU_EP_DIR_IN, and XUSBPSU_EP_DIR_OUT.

Referenced by XUsbPsu_Idle().

void XUsbPsu_EpXferComplete | ( | struct XUsbPsu * | InstancePtr,
|  | const struct XUsbPsu_Event_Epevt * | Event
| ) |  |

Checks the data phase and calls user endpoint handler.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Event | Pointer to the endpoint event occurred in core.

Returns
  None.

References XUsbPsu::AppData, XUsbPsu_Ep::BufferPtr, XUsbPsu_Ep::BytesTxed, XUsbPsu::ConfigPtr, XUsbPsu_Ep::Direction, XUsbPsu_Event_Epevt::Endpoint_Event, XUsbPsu_Event_Epevt::Epnumber, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::Handler, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_Ep::MaxSize, XUsbPsu_Ep::RequestedBytes, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Trb::Size, XUsbPsu_Ep::TrbDequeue, XUsbPsu_Ep::UnalignedTx, XUSBPSU_EP_DIR_IN, and XUSBPSU_EP_DIR_OUT.

Referenced by XUsbPsu_EpEvent().

void XUsbPsu_EpXferNotReady | ( | struct XUsbPsu * | InstancePtr,
|  | const struct XUsbPsu_Event_Epevt * | Event
| ) |  |

For Isochronous transfer, gets the microframe time and calls respective endpoint handler.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Event | Pointer to the Endpoint event occurred in core.

Returns
  None.

References XUsbPsu::AppData, XUsbPsu_Ep::CurUf, XUsbPsu_Event_Epevt::Epnumber, XUsbPsu::eps, XUsbPsu_Ep::Handler, XUsbPsu_Ep::Interval, XUsbPsu_Event_Epevt::Parameters, XUsbPsu_Ep::Type, and XUSBPSU_ENDPOINT_XFER_ISOC.

Referenced by XUsbPsu_EpEvent().

void XUsbPsu_EventBufferHandler | ( | struct XUsbPsu * | InstancePtr | ) |

Processes events in an event buffer.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  None.

References XUsbPsu_EvtBuffer::BuffAddr, XUsbPsu::ConfigPtr, XUsbPsu_EvtBuffer::Count, XUsbPsu::Evt, XUsbPsu_EvtBuffer::Flags, XUsbPsu_Config::IsCacheCoherent, XUsbPsu::IsHibernated, XUsbPsu_EvtBuffer::Offset, XUsbPsu_Event::Raw, and XUsbPsu_EventHandler().

Referenced by XUsbPsu_IntrHandler().

void XUsbPsu_EventBuffersSetup | ( | struct XUsbPsu * | InstancePtr | ) |

Sets up the event buffers so that events are written by Core.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance to be worked on.

Returns
  None

References XUsbPsu_EvtBuffer::BuffAddr, XUsbPsu::Evt, and XUsbPsu_EvtBuffer::Offset.

Referenced by XUsbPsu_CfgInitialize().

void XUsbPsu_EventHandler | ( | struct XUsbPsu * | InstancePtr,
|  | const union XUsbPsu_Event * | Event
| ) |  |

Processes an event entry in the event Buffer.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Event | Event entry.

Returns
  None.

References XUsbPsu_Event::Devt, XUsbPsu_Event::Epevt, XUsbPsu_Event_Type::Is_DevEvt, XUsbPsu_Event_Type::Type, XUsbPsu_Event::Type, XUsbPsu_DeviceEvent(), and XUsbPsu_EpEvent().

Referenced by XUsbPsu_EventBufferHandler().

struct XUsbPsu_EpParams* XUsbPsu_GetEpParams | ( | struct XUsbPsu * | InstancePtr | ) |

Returns zeroed parameters to be used by Endpoint commands.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  Zeroed Params structure pointer.

References XUsbPsu::EpParams, XUsbPsu_EpParams::Param0, XUsbPsu_EpParams::Param1, and XUsbPsu_EpParams::Param2.

Referenced by XUsbPsu_ClearStalls(), XUsbPsu_Ep0_EndControlData(), XUsbPsu_Ep0Recv(), XUsbPsu_Ep0Send(), XUsbPsu_Ep0StartStatus(), XUsbPsu_EpClearStall(), XUsbPsu_EpSetStall(), XUsbPsu_RecvSetup(), XUsbPsu_SaveEndpointState(), XUsbPsu_SetEpConfig(), XUsbPsu_SetXferResource(), XUsbPsu_StartEpConfig(), and XUsbPsu_StopTransfer().

u8 XUsbPsu_GetLinkState | ( | struct XUsbPsu * | InstancePtr | ) |

Gets current state of USB link.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  Link State

void XUsbPsu_Idle | ( | struct XUsbPsu * | InstancePtr | ) |

This function puts the controller into idle state by stopping the transfers for all endpoints, stopping the usb core, and clearing the event buffers.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance to be worked on.

Returns
  None

References XUSBPSU_EP_DIR_IN, XUSBPSU_EP_DIR_OUT, XUsbPsu_EpTransferDeactive(), XUsbPsu_ReadHwParams(), XUsbPsu_Stop(), XUsbPsu_StopTransfer(), and XUsbPsu_WaitClearTimeout().

void XUsbPsu_IntrHandler | ( | void * | XUsbPsuInstancePtr | ) |

Main interrupt handler.

Parameters

  XUsbPsuInstancePtr | Void pointer to the XUsbPsu instance.

Returns
  None.

References XUsbPsu_EvtBuffer::Count, XUsbPsu::Evt, XUsbPsu_EvtBuffer::Flags, and XUsbPsu_EventBufferHandler().

Referenced by main(), and UsbPollHandler().

s32 XUsbPsu_IsEpStalled | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | Epnum,
|  | u8 | Dir
| ) |  |

Returns status of endpoint whether it is stalled or not.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Epnum | USB endpoint number.
  Dir | Direction of endpoint XUSBPSU_EP_DIR_IN/XUSBPSU_EP_DIR_OUT.

Returns
  1 - if stalled 0 - if not stalled

References XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::PhyEpNum, XUSBPSU_EP_DIR_IN, and XUSBPSU_EP_DIR_OUT.

s32 XUsbPsu_IsSuperSpeed | ( | struct XUsbPsu * | InstancePtr | ) |

Checks if the current speed is super speed or not.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  XST_SUCCESS else XST_FAILURE

References XUsbPsu::AppData, Usb_DevData::Speed, and XUSBPSU_SPEED_SUPER.

Referenced by IsSuperSpeed().

void XUsbPsu_LinkStsChangeIntr | ( | struct XUsbPsu * | InstancePtr,
|  | u32 | EvtInfo
| ) |  |

Link status change interrupt handler.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  EvtInfo | Event information.

Returns
  None.

References XUsbPsu::LinkState.

Referenced by XUsbPsu_DeviceEvent().

XUsbPsu_Config * XUsbPsu_LookupConfig | ( | u16 | DeviceId | ) |

Looks up the device configuration based on the unique device ID.

The table contains the configuration info for each device in the system.

Parameters

  DeviceId | Unique device ID of the device being looked up.

Returns
  A pointer to the configuration table entry corresponding to the given device ID, or NULL if no match is found.

References XUsbPsu_ConfigTable.

void XUsbPsu_PhyReset | ( | struct XUsbPsu * | InstancePtr | ) |

Issues core PHY reset.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance to be worked on.

Returns
  None

References XUsbPsu_Sleep().

Referenced by XUsbPsu_CoreInit().

u32 XUsbPsu_ReadHwParams | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | RegIndex
| ) |  |

Reads data from hardware parameters registers of the core.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance to be worked on
  RegIndex | Register number to read. XUSBPSU_GHWPARAMS0 XUSBPSU_GHWPARAMS1 XUSBPSU_GHWPARAMS2 XUSBPSU_GHWPARAMS3 XUSBPSU_GHWPARAMS4 XUSBPSU_GHWPARAMS5 XUSBPSU_GHWPARAMS6 XUSBPSU_GHWPARAMS7

Returns
  One of the GHWPARAMS RegValister contents.

Referenced by XUsbPsu_CfgInitialize(), XUsbPsu_CoreInit(), and XUsbPsu_Idle().

s32 XUsbPsu_RecvSetup | ( | struct XUsbPsu * | InstancePtr | ) |

Initiates DMA on control endpoint 0 to receive setup packet.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  XST_SUCCESS else XST_FAILURE.

References XUsbPsu_Trb::BufferPtrHigh, XUsbPsu_Trb::BufferPtrLow, XUsbPsu::ConfigPtr, XUsbPsu_Trb::Ctrl, XUsbPsu_Ep::Direction, XUsbPsu::Ep0State, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_EpParams::Param0, XUsbPsu_EpParams::Param1, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Trb::Size, XUsbPsu_Ep::UsbEpNum, XUSBPSU_EP_DIR_OUT, XUsbPsu_EpGetTransferIndex(), XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().

Referenced by XUsbPsu_ConnDoneIntr(), XUsbPsu_Ep0StallRestart(), and XUsbPsu_Ep0StatusDone().

void XUsbPsu_ResetIntr | ( | struct XUsbPsu * | InstancePtr | ) |

Resets interrupt handler.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  None.

References XUsbPsu::AppData, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu::IsConfigDone, XUsbPsu::NumInEps, XUsbPsu::NumOutEps, XUsbPsu::ResetIntrHandler, Usb_DevData::State, XUsbPsu::TestMode, XUsbPsu_ClearStallAllEp(), XUSBPSU_STATE_DEFAULT, and XUsbPsu_StopActiveTransfers().

Referenced by XUsbPsu_DeviceEvent().

void XUsbPsu_SaveEndpointState | ( | struct XUsbPsu * | InstancePtr,
|  | struct XUsbPsu_Ep * | Ept
| ) |  |

Queries endpoint state and saves it in EpSavedState.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Ept | Pointer to the XUsbPsu pointer structure.

Returns
  None.

References XUsbPsu_Ep::Direction, XUsbPsu_Ep::EpSavedState, XUsbPsu_Ep::PhyEpNum, XUsbPsu_Ep::UsbEpNum, XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().

s32 XUsbPsu_SendEpCmd | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | UsbEpNum,
|  | u8 | Dir,
|  | u32 | Cmd,
|  | struct XUsbPsu_EpParams * | Params
| ) |  |

Sends Endpoint command to the Endpoint.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  UsbEpNum | USB endpoint number.
  Dir | Direction of endpoint XUSBPSU_EP_DIR_IN/ XUSBPSU_EP_DIR_OUT.
  Cmd | Endpoint command.
  Params | Endpoint command parameters.

Returns
  XST_SUCCESS else XST_FAILURE.

References XUsbPsu_EpParams::Param0, XUsbPsu_EpParams::Param1, XUsbPsu_EpParams::Param2, XUsbPsu_Ep::PhyEpNum, XUsbPsu_Ep::UsbEpNum, XUSBPSU_EP_DIR_IN, XUSBPSU_EP_DIR_OUT, and XUsbPsu_WaitClearTimeout().

Referenced by XUsbPsu_ClearStalls(), XUsbPsu_Ep0_EndControlData(), XUsbPsu_Ep0Recv(), XUsbPsu_Ep0Send(), XUsbPsu_Ep0StartStatus(), XUsbPsu_EpBufferRecv(), XUsbPsu_EpBufferSend(), XUsbPsu_EpClearStall(), XUsbPsu_EpSetStall(), XUsbPsu_RecvSetup(), XUsbPsu_SaveEndpointState(), XUsbPsu_SetEpConfig(), XUsbPsu_SetXferResource(), XUsbPsu_StartEpConfig(), and XUsbPsu_StopTransfer().

s32 XUsbPsu_SetDeviceAddress | ( | struct XUsbPsu * | InstancePtr,
|  | u16 | Addr
| ) |  |

Sets the device address of the core.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Addr | Address to set.

Returns
  XST_SUCCESS else XST_FAILURE

References XUsbPsu::AppData, Usb_DevData::State, XUSBPSU_STATE_ADDRESS, XUSBPSU_STATE_CONFIGURED, and XUSBPSU_STATE_DEFAULT.

Referenced by XUsbPsu_CfgInitialize().

s32 XUsbPsu_SetEpConfig | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | UsbEpNum,
|  | u8 | Dir,
|  | u16 | Size,
|  | u8 | Type,
|  | u8 | Restore
| ) |  |

Sends set endpoint configuration command to the endpoint.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  UsbEpNum | USB endpoint number.
  Dir | Direction of endpoint -XUSBPSU_EP_DIR_IN/XUSBPSU_EP_DIR_OUT.
  Size | Size of Endpoint size.
  Type | Endpoint type Control/Bulk/Interrupt/Isoc.
  Restore | Typically false, true if saved state has to be restored.

Returns
  XST_SUCCESS else XST_FAILURE.

References XUsbPsu::AppData, XUsbPsu::eps, XUsbPsu_Ep::EpSavedState, XUsbPsu_Ep::Interval, XUsbPsu_EpParams::Param0, XUsbPsu_EpParams::Param1, XUsbPsu_EpParams::Param2, Usb_DevData::Speed, XUsbPsu_Ep::Type, XUSBPSU_ENDPOINT_XFER_ISOC, XUSBPSU_EP_DIR_OUT, XUsbPsu_GetEpParams(), XUsbPsu_SendEpCmd(), and XUSBPSU_SPEED_SUPER.

Referenced by XUsbPsu_EpEnable().

void XUsbPsu_SetEpHandler | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | Epnum,
|  | u8 | Dir,
|  | void(*)(void *, u32, u32) | Handler
| ) |  |

Sets an user handler to be called after data is sent/received by an endpoint.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Epnum | USB endpoint number.
  Dir | Direction of endpoint XUSBPSU_EP_DIR_IN/XUSBPSU_EP_DIR_OUT.
  Handler | User handler to be called.

Returns
  None.

References XUsbPsu::eps, XUsbPsu_Ep::Handler, XUsbPsu_Ep::PhyEpNum, XUSBPSU_EP_DIR_IN, and XUSBPSU_EP_DIR_OUT.

s32 XUsbPsu_SetLinkState | ( | struct XUsbPsu * | InstancePtr,
|  | XusbPsuLinkStateChange | State
| ) |  |

Sets USB Link to a particular State.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  State | State of Link to set.

Returns
  XST_SUCCESS else XST_FAILURE

References XUsbPsu_WaitClearTimeout().

void XUsbPsu_SetSpeed | ( | struct XUsbPsu * | InstancePtr,
|  | u32 | Speed
| ) |  |

Sets speed of the core for connecting to host.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Speed | Required speed XUSBPSU_DCFG_HIGHSPEED XUSBPSU_DCFG_FULLSPEED2 XUSBPSU_DCFG_LOWSPEED XUSBPSU_DCFG_FULLSPEED1

Returns
  None

Referenced by XUsbPsu_CfgInitialize().

s32 XUsbPsu_SetTestMode | ( | struct XUsbPsu * | InstancePtr,
|  | u32 | Mode
| ) |  |

Enables USB2 test modes.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Mode | Test mode to set.

Returns
  XST_SUCCESS else XST_FAILURE

References Status, XUSBPSU_TEST_FORCE_ENABLE, XUSBPSU_TEST_J, XUSBPSU_TEST_K, XUSBPSU_TEST_PACKET, and XUSBPSU_TEST_SE0_NAK.

Referenced by XUsbPsu_Ep0StatusDone().

s32 XUsbPsu_SetU1SleepTimeout | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | Timeout
| ) |  |

Sets U1 sleep timeout.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Timeout | Time in microseconds

Returns
  XST_SUCCESS else XST_FAILURE

s32 XUsbPsu_SetU2SleepTimeout | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | Timeout
| ) |  |

Sets U2 sleep timeout.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  Timeout | Time in microseconds.

Returns
  XST_SUCCESS else XST_FAILURE

s32 XUsbPsu_SetXferResource | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | UsbEpNum,
|  | u8 | Dir
| ) |  |

Sends set transfer resource command to the endpoint.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  UsbEpNum | USB endpoint number.
  Dir | Direction of endpoint - XUSBPSU_EP_DIR_IN/XUSBPSU_EP_DIR_OUT

Returns
  XST_SUCCESS else XST_FAILURE.

References XUsbPsu_EpParams::Param0, XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().

Referenced by XUsbPsu_EpEnable().

void XUsbPsu_Sleep | ( | u32 | USeconds | ) |

API for Sleep routine.

Parameters

  USeconds | Time in MicroSeconds.

Returns
  None.

Referenced by XUsbPsu_Ep0_EndControlData(), XUsbPsu_PhyReset(), and XUsbPsu_StopTransfer().

s32 XUsbPsu_Start | ( | struct XUsbPsu * | InstancePtr | ) |

Starts the controller so that host can detect this device.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  XST_SUCCESS else XST_FAILURE

References XUsbPsu_WaitClearTimeout().

s32 XUsbPsu_StartEpConfig | ( | struct XUsbPsu * | InstancePtr,
|  | u32 | UsbEpNum,
|  | u8 | Dir
| ) |  |

Sends start new configuration command to the endpoint.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  UsbEpNum | USB endpoint number.
  Dir | Direction of endpoint XUSBPSU_EP_DIR_IN/ XUSBPSU_EP_DIR_OUT.

Returns
  XST_SUCCESS else XST_FAILURE.

Note
  As per data book this command should be issued by software under these conditions:
  1. After power-on-reset with XferRscIdx=0 before starting to configure Physical Endpoints 0 and 1.
  2. With XferRscIdx=2 before starting to configure Physical Endpoints > 1
  3. This command should always be issued to Endpoint 0 (DEPCMD0).

References XUsbPsu::IsConfigDone, XUSBPSU_EP_DIR_OUT, XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().

Referenced by XUsbPsu_EpEnable().

s32 XUsbPsu_Stop | ( | struct XUsbPsu * | InstancePtr | ) |

Stops the controller so that the device disconnects from the host.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  XST_SUCCESS else XST_FAILURE

References XUsbPsu_WaitSetTimeout().

Referenced by XUsbPsu_Idle().

void XUsbPsu_StopActiveTransfers | ( | struct XUsbPsu * | InstancePtr | ) |

Stops any active transfer.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  None.

References XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::UsbEpNum, and XUsbPsu_StopTransfer().

Referenced by XUsbPsu_ResetIntr().

void XUsbPsu_StopTransfer | ( | struct XUsbPsu * | InstancePtr,
|  | u8 | UsbEpNum,
|  | u8 | Dir,
|  | u8 | Force
| ) |  |

Stops transfer on Endpoint.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.
  UsbEpNum | USB endpoint number.
  Dir | Direction of endpoint XUSBPSU_EP_DIR_IN/XUSBPSU_EP_DIR_OUT.
  Force | Flag to stop/pause transfer.

Returns
  None.

References XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Ep::UsbEpNum, XUSBPSU_EP_DIR_IN, XUSBPSU_EP_DIR_OUT, XUsbPsu_GetEpParams(), XUsbPsu_SendEpCmd(), and XUsbPsu_Sleep().

Referenced by XUsbPsu_Idle(), and XUsbPsu_StopActiveTransfers().

s32 XUsbPsu_U1SleepDisable | ( | struct XUsbPsu * | InstancePtr | ) |

Enables U1 disable sleep.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  XST_SUCCESS else XST_FAILURE

s32 XUsbPsu_U1SleepEnable | ( | struct XUsbPsu * | InstancePtr | ) |

Enables U1 enable sleep.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  XST_SUCCESS else XST_FAILURE

s32 XUsbPsu_U2SleepDisable | ( | struct XUsbPsu * | InstancePtr | ) |

Enables U2 disable sleep.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  XST_SUCCESS else XST_FAILURE

s32 XUsbPsu_U2SleepEnable | ( | struct XUsbPsu * | InstancePtr | ) |

Enables U2 enable sleep.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance.

Returns
  XST_SUCCESS else XST_FAILURE

s32 XUsbPsu_WaitClearTimeout | ( | struct XUsbPsu * | InstancePtr,
|  | u32 | Offset,
|  | u32 | BitMask,
|  | u32 | Timeout
| ) |  |

Waits until a bit in a register is cleared or timeout occurs.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance to be worked on.
  Offset | Register offset.
  BitMask | Bit mask of required bit to be checked.
  Timeout | Time to wait specified in micro seconds.

Returns
  - XST_SUCCESS when bit is cleared.
  - XST_FAILURE when timed out.

References XUsbPsu_Config::BaseAddress, XUsbPsu::ConfigPtr, and Status.

Referenced by XUsbPsu_CoreInit(), XUsbPsu_Idle(), XUsbPsu_SendEpCmd(), XUsbPsu_SetLinkState(), and XUsbPsu_Start().

s32 XUsbPsu_WaitSetTimeout | ( | struct XUsbPsu * | InstancePtr,
|  | u32 | Offset,
|  | u32 | BitMask,
|  | u32 | Timeout
| ) |  |

Waits until a bit in a register is set or timeout occurs.

Parameters

  InstancePtr | Pointer to the XUsbPsu instance to be worked on
  Offset | Register offset.
  BitMask | Bit mask of required bit to be checked.
  Timeout | Time to wait specified in micro seconds.

Returns
  - XST_SUCCESS when bit is set.
  - XST_FAILURE when timed out.

References XUsbPsu_Config::BaseAddress, XUsbPsu::ConfigPtr, and Status.

Referenced by XUsbPsu_Stop().

## Variable Documentation

USB_CONFIG __attribute__

Endpoint Parameters.

Core events.

Device Events.

Device Endpoint Events.

Device Endpoint Events type.

Representation of Event Buffers.

Referenced by Usb_Ch9SetupBosDescReply().

XUsbPsu_Config XUsbPsu_ConfigTable[]

Configuration table.

Referenced by XUsbPsu_LookupConfig().