![]() |
usbpsu
Xilinx SDK Drivers API Documentation
|
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... | |
#define | XUsbPsu_ReadReg(InstancePtr, Offset) Xil_In32((InstancePtr)->ConfigPtr->BaseAddress + (u32)(Offset)) |
Read a register of the USBPS8 device. More... | |
#define | XUsbPsu_WriteReg(InstancePtr, Offset, Data) Xil_Out32((InstancePtr)->ConfigPtr->BaseAddress + (u32)(Offset), (u32)(Data)) |
Write a register of the USBPS8 device. More... | |
#define | XUsbPsu_ReadVendorReg(Offset) Xil_In32(VENDOR_BASE_ADDRESS + (u32)(Offset)) |
Read a vendor register of the USBPS8 device. More... | |
#define | XUsbPsu_WriteVendorReg(Offset, Data) Xil_Out32(VENDOR_BASE_ADDRESS + (u32)(Offset), (u32)(Data)) |
Write a Vendor register of the USBPS8 device. More... | |
#define | XUsbPsu_ReadLpdReg(Offset) Xil_In32(LPD_BASE_ADDRESS + (u32)(Offset)) |
Read a LPD register of the USBPS8 device. More... | |
#define | XUsbPsu_WriteLpdReg(Offset, Data) Xil_Out32(LPD_BASE_ADDRESS + (u32)(Offset), (u32)(Data)) |
Write a LPD register of the USBPS8 device. 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... | |
XusbPsuLinkState | 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... | |
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 incase 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... | |
XUsbPsu_Config * | XUsbPsu_LookupConfig (u16 DeviceId) |
Lookup the device configuration based on the unique device ID. More... | |
#define XUSBPSU_EP0_DATA_PHASE 2U |
#include <xusbpsu.h>
Data Phase.
#define XUSBPSU_EP0_SETUP_PHASE 1U |
#include <xusbpsu.h>
Setup Phase.
#define XUSBPSU_EP0_STATUS_PHASE 3U |
#include <xusbpsu.h>
Status Pahse.
#define XUsbPsu_ReadLpdReg | ( | Offset | ) | Xil_In32(LPD_BASE_ADDRESS + (u32)(Offset)) |
#include <xusbpsu_hw.h>
Read a LPD register of the USBPS8 device.
InstancePtr | is a pointer to the XUsbPsu instance. |
Offset | is the offset of the register to read. |
Referenced by XUsbPsu_WakeupIntr().
#define XUsbPsu_ReadReg | ( | InstancePtr, | |
Offset | |||
) | Xil_In32((InstancePtr)->ConfigPtr->BaseAddress + (u32)(Offset)) |
#include <xusbpsu_hw.h>
Read a register of the USBPS8 device.
This macro provides register access to all registers using the register offsets defined above.
InstancePtr | is a pointer to the XUsbPsu instance. |
Offset | is the offset of the register to read. |
Referenced by XUsbPsu_AcceptU1U2Sleep(), XUsbPsu_DisableIntr(), XUsbPsu_DisconnectIntr(), XUsbPsu_EnableIntr(), XUsbPsu_GetLinkState(), XUsbPsu_IntrHandler(), XUsbPsu_PhyReset(), XUsbPsu_SetU1SleepTimeout(), XUsbPsu_SetU2SleepTimeout(), XUsbPsu_Start(), XUsbPsu_Stop(), XUsbPsu_U1SleepDisable(), XUsbPsu_U1SleepEnable(), XUsbPsu_U2SleepDisable(), XUsbPsu_U2SleepEnable(), XUsbPsu_Wait_Clear_Timeout(), and XUsbPsu_Wait_Set_Timeout().
#define XUsbPsu_ReadVendorReg | ( | Offset | ) | Xil_In32(VENDOR_BASE_ADDRESS + (u32)(Offset)) |
#include <xusbpsu_hw.h>
Read a vendor register of the USBPS8 device.
Offset | is the offset of the register to read. |
#define XUsbPsu_WriteLpdReg | ( | Offset, | |
Data | |||
) | Xil_Out32(LPD_BASE_ADDRESS + (u32)(Offset), (u32)(Data)) |
#include <xusbpsu_hw.h>
Write a LPD register of the USBPS8 device.
InstancePtr | is a pointer to the XUsbPsu instance. |
RegOffset | is the offset of the register to write. |
Data | is the value to write to the register. |
#define XUsbPsu_WriteReg | ( | InstancePtr, | |
Offset, | |||
Data | |||
) | Xil_Out32((InstancePtr)->ConfigPtr->BaseAddress + (u32)(Offset), (u32)(Data)) |
#include <xusbpsu_hw.h>
Write a register of the USBPS8 device.
This macro provides register access to all registers using the register offsets defined above.
InstancePtr | is a pointer to the XUsbPsu instance. |
RegOffset | is the offset of the register to write. |
Data | is the value to write to the register. |
Referenced by XUsbPsu_CoreInit(), XUsbPsu_EventBuffersReset(), XUsbPsu_EventBuffersSetup(), and XUsbPsu_SendGadgetGenericCmd().
#define XUsbPsu_WriteVendorReg | ( | Offset, | |
Data | |||
) | Xil_Out32(VENDOR_BASE_ADDRESS + (u32)(Offset), (u32)(Data)) |
#include <xusbpsu_hw.h>
Write a Vendor register of the USBPS8 device.
RegOffset | is the offset of the register to write. |
Data | is the value to write to the register. |
enum XusbPsuLinkState |
#include <xusbpsu.h>
Enumerator | |
---|---|
XUSBPSU_LINK_STATE_U0 | in HS - ON |
XUSBPSU_LINK_STATE_U2 | in HS - SLEEP |
XUSBPSU_LINK_STATE_U3 | in HS - SUSPEND |
#include <xusbpsu.h>
Enumerator | |
---|---|
XUSBPSU_LINK_STATE_CHANGE_U0 | in HS - ON |
s32 XUsbPsu_AcceptU1U2Sleep | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.c>
Enable Accept U1 and U2 sleep enable.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg.
s32 XUsbPsu_CfgInitialize | ( | struct XUsbPsu * | InstancePtr, |
XUsbPsu_Config * | ConfigPtr, | ||
u32 | BaseAddress | ||
) |
#include <xusbpsu.c>
This function does the following:
InstancePtr | is a pointer to the XUsbPsu instance. |
ConfigPtr | points to the XUsbPsu device configuration structure. |
BaseAddress | is the 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. |
void XUsbPsu_ClearStalls | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.h>
Clears Stall on all endpoints.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_GetEpParams().
void XUsbPsu_ConnDoneIntr | ( | struct XUsbPsu * | InstancePtr | ) |
s32 XUsbPsu_CoreInit | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.c>
Initializes Core.
InstancePtr | is a pointer to the XUsbPsu instance to be worked on. |
References XUsbPsu_WriteReg.
void XUsbPsu_DevInterrupt | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Devt * | Event | ||
) |
void XUsbPsu_DisableIntr | ( | struct XUsbPsu * | InstancePtr, |
u32 | Mask | ||
) |
#include <xusbpsu.c>
Disables an interrupt in Event Enable RegValister.
InstancePtr | is a pointer to the XUsbPsu instance to be worked on. |
Mask | is the OR of Interrupt Enable Masks
|
References XUsbPsu_ReadReg.
void XUsbPsu_DisconnectIntr | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.h>
Disconnect Interrupt handler.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg.
s32 XUsbPsu_EnableControlEp | ( | struct XUsbPsu * | InstancePtr, |
u16 | Size | ||
) |
void XUsbPsu_EnableIntr | ( | struct XUsbPsu * | InstancePtr, |
u32 | Mask | ||
) |
#include <xusbpsu.c>
Enables an interrupt in Event Enable RegValister.
InstancePtr | is a pointer to the XUsbPsu instance to be worked on |
Mask | is the OR of any Interrupt Enable Masks:
|
References XUsbPsu_ReadReg.
void XUsbPsu_Ep0_EndControlData | ( | struct XUsbPsu * | InstancePtr, |
struct XUsbPsu_Ep * | Ept | ||
) |
#include <xusbpsu.h>
Ends Data Phase - used incase of error.
InstancePtr | is a pointer to the XUsbPsu instance. |
Dep | is a pointer to the Endpoint structure. |
References XUsbPsu_Ep::ResourceIndex, and XUsbPsu_GetEpParams().
void XUsbPsu_Ep0DataDone | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Epevt * | Event | ||
) |
void XUsbPsu_Ep0Intr | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Epevt * | Event | ||
) |
s32 XUsbPsu_Ep0Recv | ( | struct XUsbPsu * | InstancePtr, |
u8 * | BufferPtr, | ||
u32 | Length | ||
) |
s32 XUsbPsu_Ep0Send | ( | struct XUsbPsu * | InstancePtr, |
u8 * | BufferPtr, | ||
u32 | BufferLen | ||
) |
#include <xusbpsu.h>
Initiates DMA to send data on Control Endpoint EP0 IN to Host.
InstancePtr | is a pointer to the XUsbPsu instance. |
BufferPtr | is pointer to data. |
BufferLen | is Length of data buffer. |
References XUsbPsu::eps, XUsbPsu_Ep::EpStatus, and XUsbPsu_GetEpParams().
void XUsbPsu_Ep0StallRestart | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.h>
Stalls Control Endpoint and restarts to receive Setup packet.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu::eps, and XUsbPsu_Ep::EpStatus.
Referenced by XUsbPsu_Ep0StatusDone().
s32 XUsbPsu_Ep0StartStatus | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Epevt * | Event | ||
) |
void XUsbPsu_Ep0StatusDone | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Epevt * | Event | ||
) |
#include <xusbpsu.h>
Checks the Status Phase and starts next Control transfer.
InstancePtr | is a pointer to the XUsbPsu instance. |
Event | is a pointer to the Endpoint event occured in core. |
References XUsbPsu::ConfigPtr, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_Ep0StallRestart(), XUsbPsu_RecvSetup(), and XUsbPsu_SetTestMode().
void XUsbPsu_Ep0XferComplete | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Epevt * | Event | ||
) |
void XUsbPsu_Ep0XferNotReady | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Epevt * | Event | ||
) |
#include <xusbpsu.h>
Handles Transfer Not Ready event of Control Endpoints EP0 OUT and EP0 IN.
InstancePtr | is a pointer to the XUsbPsu instance. |
Event | is a pointer to the Endpoint event occured in core. |
References XUsbPsu::eps.
s32 XUsbPsu_EpBufferRecv | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEp, | ||
u8 * | BufferPtr, | ||
u32 | Length | ||
) |
s32 XUsbPsu_EpBufferSend | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEp, | ||
u8 * | BufferPtr, | ||
u32 | BufferLen | ||
) |
#include <xusbpsu.h>
Initiates DMA to send data on endpoint to Host.
InstancePtr | is a pointer to the XUsbPsu instance. |
UsbEp | is USB endpoint number. |
BufferPtr | is pointer to data. |
BufferLen | is length of data buffer. |
References XUsbPsu_Ep::PhyEpNum.
void XUsbPsu_EpClearStall | ( | struct XUsbPsu * | InstancePtr, |
u8 | Epnum, | ||
u8 | Dir | ||
) |
s32 XUsbPsu_EpDisable | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEpNum, | ||
u8 | Dir | ||
) |
s32 XUsbPsu_EpEnable | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEpNum, | ||
u8 | Dir, | ||
u16 | Maxsize, | ||
u8 | Type, | ||
u8 | Restore | ||
) |
#include <xusbpsu.h>
Enables Endpoint for sending/receiving data.
InstancePtr | is a pointer to the XUsbPsu instance. |
UsbEpNum | is USB endpoint number. |
Dir | is direction of endpoint - XUSBPSU_EP_DIR_IN/XUSBPSU_EP_DIR_OUT. |
Maxsize | is size of Endpoint size. |
Type | is Endpoint type Control/Bulk/Interrupt/Isoc. |
Restore | should be true if saved state should be restored; typically this would be false |
u32 XUsbPsu_EpGetTransferIndex | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEpNum, | ||
u8 | Dir | ||
) |
void XUsbPsu_EpInterrupt | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Epevt * | Event | ||
) |
#include <xusbpsu.h>
Endpoint interrupt handler.
InstancePtr | is a pointer to the XUsbPsu instance. |
Event | is endpoint Event occured in the core. |
References XUsbPsu::eps, and XUsbPsu_Ep::EpStatus.
Referenced by XUsbPsu_EventHandler().
void XUsbPsu_EpSetStall | ( | struct XUsbPsu * | InstancePtr, |
u8 | Epnum, | ||
u8 | Dir | ||
) |
void XUsbPsu_EpXferComplete | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Epevt * | Event | ||
) |
#include <xusbpsu.h>
Checks the Data Phase and calls user Endpoint handler.
InstancePtr | is a pointer to the XUsbPsu instance. |
Event | is a pointer to the Endpoint event occured in core. |
References XUsbPsu_Ep::Direction, and XUsbPsu::eps.
void XUsbPsu_EpXferNotReady | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Epevt * | Event | ||
) |
#include <xusbpsu.h>
For Isochronous transfer, get the microframe time and calls respective Endpoint handler.
InstancePtr | is a pointer to the XUsbPsu instance. |
Event | is a pointer to the Endpoint event occurred in core. |
References XUsbPsu_Ep::CurUf, XUsbPsu::eps, and XUsbPsu_Ep::Type.
void XUsbPsu_EventBufferHandler | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.h>
Processes events in an Event Buffer.
InstancePtr | is a pointer to the XUsbPsu instance. Event buffer number. |
References XUsbPsu::ConfigPtr, and XUsbPsu_Config::IsCacheCoherent.
void XUsbPsu_EventBuffersReset | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.c>
Resets Event buffer Registers to zero so that events are not written by Core.
InstancePtr | is a pointer to the XUsbPsu instance to be worked on. |
References XUsbPsu_WriteReg.
void XUsbPsu_EventBuffersSetup | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.c>
Sets up Event buffers so that events are written by Core.
InstancePtr | is a pointer to the XUsbPsu instance to be worked on. |
References XUsbPsu_WriteReg.
void XUsbPsu_EventHandler | ( | struct XUsbPsu * | InstancePtr, |
const union XUsbPsu_Event * | Event | ||
) |
#include <xusbpsu.h>
Processes an Event entry in Event Buffer.
InstancePtr | is a pointer to the XUsbPsu instance. |
Event | is the Event entry. |
References XUsbPsu_EpInterrupt().
struct XUsbPsu_EpParams * XUsbPsu_GetEpParams | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.h>
Returns zeroed parameters to be used by Endpoint commands.
InstancePtr | is a pointer to the XUsbPsu instance. |
Referenced by XUsbPsu_ClearStalls(), XUsbPsu_Ep0_EndControlData(), XUsbPsu_Ep0Send(), XUsbPsu_RecvSetup(), and XUsbPsu_SaveEndpointState().
XusbPsuLinkState XUsbPsu_GetLinkState | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.c>
Gets current State of USB Link.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg.
Referenced by Xusbpsu_HibernationIntr().
void XUsbPsu_InitializeEps | ( | struct XUsbPsu * | InstancePtr | ) |
void XUsbPsu_IntrHandler | ( | void * | XUsbPsuInstancePtr | ) |
s32 XUsbPsu_IsEpStalled | ( | struct XUsbPsu * | InstancePtr, |
u8 | Epnum, | ||
u8 | Dir | ||
) |
#include <xusbpsu.h>
Returns status of endpoint - Stalled or not.
InstancePtr | is a pointer to the XUsbPsu instance. |
EpNum | is USB endpoint number. |
Dir | is direction of endpoint - XUSBPSU_EP_DIR_IN/XUSBPSU_EP_DIR_OUT. |
References XUsbPsu_Ep::PhyEpNum.
void XUsbPsu_LinkStsChangeIntr | ( | struct XUsbPsu * | InstancePtr, |
u32 | EvtInfo | ||
) |
XUsbPsu_Config * XUsbPsu_LookupConfig | ( | u16 | DeviceId | ) |
#include <xusbpsu.h>
Lookup the device configuration based on the unique device ID.
The table contains the configuration info for each device in the system.
DeviceId | is the unique device ID of the device being looked up. |
void XUsbPsu_PhyReset | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.c>
Issues core PHY reset.
InstancePtr | is a pointer to the XUsbPsu instance to be worked on. |
References XUsbPsu_ReadReg.
u32 XUsbPsu_ReadHwParams | ( | struct XUsbPsu * | InstancePtr, |
u8 | RegIndex | ||
) |
#include <xusbpsu.c>
Reads data from Hardware Params Registers of Core.
InstancePtr | is a pointer to the XUsbPsu instance to be worked on. |
RegIndex | is Register number to read
|
s32 XUsbPsu_RecvSetup | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.h>
Initiates DMA on Control Endpoint 0 to receive Setup packet.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu::eps, XUsbPsu_Ep::EpStatus, and XUsbPsu_GetEpParams().
Referenced by XUsbPsu_Ep0StatusDone().
void XUsbPsu_ResetIntr | ( | struct XUsbPsu * | InstancePtr | ) |
void XUsbPsu_SaveEndpointState | ( | struct XUsbPsu * | InstancePtr, |
struct XUsbPsu_Ep * | Ept | ||
) |
#include <xusbpsu.h>
Query endpoint state and save it in EpSavedState.
InstancePtr | is a pointer to the XUsbPsu instance. |
Ept | is a pointer to the XUsbPsu pointer structure. |
References XUsbPsu_Ep::Direction, XUsbPsu_Ep::UsbEpNum, XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().
s32 XUsbPsu_SendEpCmd | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEpNum, | ||
u8 | Dir, | ||
u32 | Cmd, | ||
struct XUsbPsu_EpParams * | Params | ||
) |
#include <xusbpsu.h>
Sends Endpoint command to Endpoint.
InstancePtr | is a pointer to the XUsbPsu instance. |
UsbEpNum | is USB endpoint number. |
Dir | is direction of endpoint
|
Cmd | is Endpoint command. |
Params | is Endpoint command parameters. |
Referenced by XUsbPsu_SaveEndpointState().
s32 XUsbPsu_SetDeviceAddress | ( | struct XUsbPsu * | InstancePtr, |
u16 | Addr | ||
) |
s32 XUsbPsu_SetEpConfig | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEpNum, | ||
u8 | Dir, | ||
u16 | Size, | ||
u8 | Type, | ||
u8 | Restore | ||
) |
#include <xusbpsu.h>
Sends Set Endpoint Configuration command to Endpoint.
InstancePtr | is a pointer to the XUsbPsu instance. |
UsbEpNum | is USB endpoint number. |
Dir | is direction of endpoint - XUSBPSU_EP_DIR_IN/XUSBPSU_EP_DIR_OUT. |
Size | is size of Endpoint size. |
Type | is Endpoint type Control/Bulk/Interrupt/Isoc. |
Restore | should be true if saved state should be restored; typically this would be false |
void XUsbPsu_SetEpHandler | ( | struct XUsbPsu * | InstancePtr, |
u8 | Epnum, | ||
u8 | Dir, | ||
void(*)(void *, u32, u32) | Handler | ||
) |
#include <xusbpsu.h>
Sets an user handler to be called after data is sent/received by an Endpoint.
InstancePtr | is a pointer to the XUsbPsu instance. |
EpNum | is USB endpoint number. |
Dir | is direction of endpoint - XUSBPSU_EP_DIR_IN/XUSBPSU_EP_DIR_OUT. |
Handler | is user handler to be called. |
s32 XUsbPsu_SetLinkState | ( | struct XUsbPsu * | InstancePtr, |
XusbPsuLinkStateChange | State | ||
) |
#include <xusbpsu.c>
Sets USB Link to a particular State.
InstancePtr | is a pointer to the XUsbPsu instance. |
State | is State of Link to set. |
References XUsbPsu_Wait_Clear_Timeout().
void XUsbPsu_SetMode | ( | struct XUsbPsu * | InstancePtr, |
u32 | Mode | ||
) |
void XUsbPsu_SetSpeed | ( | struct XUsbPsu * | InstancePtr, |
u32 | Speed | ||
) |
s32 XUsbPsu_SetTestMode | ( | struct XUsbPsu * | InstancePtr, |
u32 | Mode | ||
) |
#include <xusbpsu.c>
Enables USB2 Test Modes.
InstancePtr | is a pointer to the XUsbPsu instance. |
Mode | is Test mode to set. |
Referenced by XUsbPsu_Ep0StatusDone().
s32 XUsbPsu_SetU1SleepTimeout | ( | struct XUsbPsu * | InstancePtr, |
u8 | Sleep | ||
) |
#include <xusbpsu.c>
Set U1 sleep timeout.
InstancePtr | is a pointer to the XUsbPsu instance. |
Sleep | is time in microseconds |
References XUsbPsu_ReadReg.
s32 XUsbPsu_SetU2SleepTimeout | ( | struct XUsbPsu * | InstancePtr, |
u8 | Sleep | ||
) |
#include <xusbpsu.c>
Set U2 sleep timeout.
InstancePtr | is a pointer to the XUsbPsu instance. |
Sleep | is time in microseconds |
References XUsbPsu_ReadReg.
s32 XUsbPsu_SetXferResource | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEpNum, | ||
u8 | Dir | ||
) |
s32 XUsbPsu_Start | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.c>
Starts the controller so that Host can detect this device.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg.
s32 XUsbPsu_StartEpConfig | ( | struct XUsbPsu * | InstancePtr, |
u32 | UsbEpNum, | ||
u8 | Dir | ||
) |
#include <xusbpsu.h>
Sends Start New Configuration command to Endpoint.
InstancePtr | is a pointer to the XUsbPsu instance. |
UsbEpNum | is USB endpoint number. |
Dir | is direction of endpoint
|
s32 XUsbPsu_Stop | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.c>
Stops the controller so that Device disconnects from Host.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg.
void XUsbPsu_StopTransfer | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEpNum, | ||
u8 | Dir, | ||
u8 | Force | ||
) |
s32 XUsbPsu_U1SleepDisable | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.c>
Enable U1 disable sleep.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg.
s32 XUsbPsu_U1SleepEnable | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.c>
Enable U1 enable sleep.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg.
s32 XUsbPsu_U2SleepDisable | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.c>
Enable U2 disable sleep.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg.
s32 XUsbPsu_U2SleepEnable | ( | struct XUsbPsu * | InstancePtr | ) |
#include <xusbpsu.c>
Enable U2 enable sleep.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg.
s32 XUsbPsu_Wait_Clear_Timeout | ( | struct XUsbPsu * | InstancePtr, |
u32 | Offset, | ||
u32 | BitMask, | ||
u32 | Timeout | ||
) |
#include <xusbpsu.c>
Waits until a bit in a register is cleared or timeout occurs.
InstancePtr | is a pointer to the XUsbPsu instance to be worked on. |
Offset | is register offset. |
BitMask | is bit mask of required bit to be checked. |
Timeout | is the time to wait specified in micro seconds. |
References XUsbPsu_ReadReg, and XUsbSleep().
Referenced by XUsbPsu_SetLinkState().
s32 XUsbPsu_Wait_Set_Timeout | ( | struct XUsbPsu * | InstancePtr, |
u32 | Offset, | ||
u32 | BitMask, | ||
u32 | Timeout | ||
) |
#include <xusbpsu.c>
Waits until a bit in a register is set or timeout occurs.
InstancePtr | is a pointer to the XUsbPsu instance to be worked on. |
Offset | is register offset. |
BitMask | is bit mask of required bit to be checked. |
Timeout | is the time to wait specified in micro seconds. |
References XUsbPsu_ReadReg, and XUsbSleep().
void XUsbSleep | ( | u32 | USeconds | ) |
#include <xusbpsu.h>
API for Sleep routine.
USeconds | is time in MicroSeconds. |
Referenced by XUsbPsu_Wait_Clear_Timeout(), and XUsbPsu_Wait_Set_Timeout().