usbpsu: xusbpsu.h File Reference

| usbpsu Xilinx SDK Drivers API Documentation

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

Data Structures | Macros | Enumerations | Functions
xusbpsu.h File Reference

## Data Structures
struct | XUsbPsu_EvtBuffer
| Software Event buffer representation. More...
struct | XUsbPsu_Trb
| Transfer Request Block - Hardware format. More...
struct | __attribute__
| USB Standard Control Request. More...
struct | XUsbPsu_Ep
| Endpoint representation. More...
struct | XUsbPsu_Config
| This typedef contains configuration information for the USB device. More...
struct | XUsbPsu
| USB Device Controller representation. More...
struct | XUsbPsu_Event_Epevt
| struct XUsbPsu_event_depvt - Device Endpoint Events : indicates this is an endpoint event : number of the endpoint : The event we have: 0x00 - Reserved 0x01 - XferComplete 0x02 - XferInProgress 0x03 - XferNotReady 0x04 - RxTxFifoEvt (IN->Underrun, OUT->Overrun) 0x05 - Reserved 0x06 - StreamEvt 0x07 - EPCmdCmplt : Reserved, don't use. More...
struct | XUsbPsu_Event_Devt
| struct XUsbPsu_event_devt - Device Events : indicates this is a non-endpoint event : indicates it's a device event. More...
struct | XUsbPsu_Event_Gevt
| struct XUsbPsu_event_gevt - Other Core Events : indicates this is a non-endpoint event (not used) : indicates it's (0x03) Carkit or (0x04) I2C event. More...
union | XUsbPsu_Event
| union XUsbPsu_event - representation of Event Buffer contents : raw 32-bit event : the type of the event : Device Endpoint Event : Device Event : Global Event More...

## Macros
#define | XUSBPSU_EP0_SETUP_PHASE 1U
| Setup Phase. More...
#define | XUSBPSU_EP0_DATA_PHASE 2U
| Data Phase. More...
#define | XUSBPSU_EP0_STATUS_PHASE 3U
| Status Pahse. More...

## Enumerations
enum | XusbPsuLinkState { XUSBPSU_LINK_STATE_U0 = 0x00U , XUSBPSU_LINK_STATE_U2 = 0x02U, XUSBPSU_LINK_STATE_U3 = 0x03U }
enum | XusbPsuLinkStateChange { XUSBPSU_LINK_STATE_CHANGE_U0 = 0x00U }

## Functions
s32 | XUsbPsu_Wait_Clear_Timeout (struct XUsbPsu *InstancePtr, u32 Offset, u32 BitMask, u32 Timeout)
| Waits until a bit in a register is cleared or timeout occurs. More...
s32 | XUsbPsu_Wait_Set_Timeout (struct XUsbPsu *InstancePtr, u32 Offset, u32 BitMask, u32 Timeout)
| Waits until a bit in a register is set or timeout occurs. More...
void | XUsbPsu_SetMode (struct XUsbPsu *InstancePtr, u32 Mode)
| Sets mode of Core to USB Device/Host/OTG. More...
void | XUsbPsu_PhyReset (struct XUsbPsu *InstancePtr)
| Issues core PHY reset. More...
void | XUsbPsu_EventBuffersSetup (struct XUsbPsu *InstancePtr)
| Sets up Event buffers so that events are written by Core. More...
void | XUsbPsu_EventBuffersReset (struct XUsbPsu *InstancePtr)
| Resets Event buffer Registers to zero so that events are not written by Core. More...
u32 | XUsbPsu_ReadHwParams (struct XUsbPsu *InstancePtr, u8 RegIndex)
| Reads data from Hardware Params Registers of Core. More...
s32 | XUsbPsu_CoreInit (struct XUsbPsu *InstancePtr)
| Initializes Core. 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_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 Device disconnects from Host. More...
s32 | XUsbPsu_SetTestMode (struct XUsbPsu *InstancePtr, u32 Mode)
| Enables USB2 Test Modes. 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...
void | XUsbPsu_SetSpeed (struct XUsbPsu *InstancePtr, u32 Speed)
| Sets speed of the Core for connecting to Host. More...
s32 | XUsbPsu_SetDeviceAddress (struct XUsbPsu *InstancePtr, u16 Addr)
| Sets Device Address of the Core. More...
s32 | XUsbPsu_SetU1SleepTimeout (struct XUsbPsu *InstancePtr, u8 Sleep)
| Set U1 sleep timeout. More...
s32 | XUsbPsu_SetU2SleepTimeout (struct XUsbPsu *InstancePtr, u8 Sleep)
| Set U2 sleep timeout. More...
s32 | XUsbPsu_AcceptU1U2Sleep (struct XUsbPsu *InstancePtr)
| Enable Accept U1 and U2 sleep enable. More...
s32 | XUsbPsu_U1SleepEnable (struct XUsbPsu *InstancePtr)
| Enable U1 enable sleep. More...
s32 | XUsbPsu_U2SleepEnable (struct XUsbPsu *InstancePtr)
| Enable U2 enable sleep. More...
s32 | XUsbPsu_U1SleepDisable (struct XUsbPsu *InstancePtr)
| Enable U1 disable sleep. More...
s32 | XUsbPsu_U2SleepDisable (struct XUsbPsu *InstancePtr)
| Enable U2 disable sleep. More...
s32 | XUsbPsu_IsSuperSpeed (struct XUsbPsu *InstancePtr)
| Checks if the current speed is Super Speed or not. More...
struct XUsbPsu_EpParams * | XUsbPsu_GetEpParams (struct XUsbPsu *InstancePtr)
| Returns zeroed parameters to be used by Endpoint commands. More...
u32 | XUsbPsu_EpGetTransferIndex (struct XUsbPsu *InstancePtr, u8 UsbEpNum, u8 Dir)
| Returns Transfer Index assigned by Core for an Endpoint transfer. More...
s32 | XUsbPsu_SendEpCmd (struct XUsbPsu *InstancePtr, u8 UsbEpNum, u8 Dir, u32 Cmd, struct XUsbPsu_EpParams *Params)
| Sends Endpoint command to Endpoint. More...
s32 | XUsbPsu_StartEpConfig (struct XUsbPsu *InstancePtr, u32 UsbEpNum, u8 Dir)
| Sends Start New Configuration command to Endpoint. More...
s32 | XUsbPsu_SetEpConfig (struct XUsbPsu *InstancePtr, u8 UsbEpNum, u8 Dir, u16 Size, u8 Type, u8 Restore)
| Sends Set Endpoint Configuration command to Endpoint. More...
s32 | XUsbPsu_SetXferResource (struct XUsbPsu *InstancePtr, u8 UsbEpNum, u8 Dir)
| Sends Set Transfer Resource command to Endpoint. 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...
s32 | XUsbPsu_EnableControlEp (struct XUsbPsu *InstancePtr, u16 Size)
| Enables USB Control Endpoint i.e., EP0OUT and EP0IN of Core. More...
void | XUsbPsu_InitializeEps (struct XUsbPsu *InstancePtr)
| Initializes Endpoints. More...
void | XUsbPsu_StopTransfer (struct XUsbPsu *InstancePtr, u8 UsbEpNum, u8 Dir, u8 Force)
| Stops transfer on Endpoint. More...
void | XUsbPsu_SaveEndpointState (struct XUsbPsu *InstancePtr, struct XUsbPsu_Ep *Ept)
| Query endpoint state and save it in EpSavedState. 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 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 - Stalled or not. 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, get the microframe time and calls respective Endpoint handler. More...
s32 | XUsbPsu_RecvSetup (struct XUsbPsu *InstancePtr)
| Initiates DMA on Control Endpoint 0 to receive Setup packet. More...
void | XUsbPsu_Ep0StallRestart (struct XUsbPsu *InstancePtr)
| Stalls Control Endpoint and restarts to receive Setup packet. 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, const struct XUsbPsu_Event_Epevt *Event)
| Checks the Status Phase and starts next Control transfer. 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...
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 - used in case of error. 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...
void | XUsbPsu_Ep0Intr (struct XUsbPsu *InstancePtr, const struct XUsbPsu_Event_Epevt *Event)
| Handles Interrupts 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 | XUsbSleep (u32 USeconds)
| API for Sleep routine. More...
void | XUsbPsu_EpInterrupt (struct XUsbPsu *InstancePtr, const struct XUsbPsu_Event_Epevt *Event)
| Endpoint interrupt handler. More...
void | XUsbPsu_DisconnectIntr (struct XUsbPsu *InstancePtr)
| Disconnect Interrupt handler. More...
void | XUsbPsu_ResetIntr (struct XUsbPsu *InstancePtr)
| Reset Interrupt handler. More...
void | XUsbPsu_ConnDoneIntr (struct XUsbPsu *InstancePtr)
| Connection Done Interrupt handler. More...
void | XUsbPsu_LinkStsChangeIntr (struct XUsbPsu *InstancePtr, u32 EvtInfo)
| Link Status Change Interrupt handler. More...
void | XUsbPsu_DevInterrupt (struct XUsbPsu *InstancePtr, const struct XUsbPsu_Event_Devt *Event)
| Interrupt handler for device specific events. More...
void | XUsbPsu_EventHandler (struct XUsbPsu *InstancePtr, const union XUsbPsu_Event *Event)
| Processes an Event entry in Event Buffer. More...
void | XUsbPsu_EventBufferHandler (struct XUsbPsu *InstancePtr)
| Processes events in an Event Buffer. More...
void | XUsbPsu_IntrHandler (void *XUsbPsuInstancePtr)
| Main Interrupt Handler. 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...
XUsbPsu_Config * | XUsbPsu_LookupConfig (u16 DeviceId)
| Lookup the device configuration based on the unique device ID. More...