![]() |
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_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_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... | |
XUsbPsu_Config * | XUsbPsu_LookupConfig (u16 DeviceId) |
Lookup the device configuration based on the unique device ID. More... | |
#define XUSBPSU_EP0_DATA_PHASE 2U |
Data Phase.
Referenced by XUsbPsu_Ep0Recv(), XUsbPsu_Ep0Send(), and XUsbPsu_Ep0XferComplete().
#define XUSBPSU_EP0_SETUP_PHASE 1U |
Setup Phase.
Referenced by XUsbPsu_Ep0StallRestart(), XUsbPsu_Ep0XferComplete(), and XUsbPsu_RecvSetup().
#define XUSBPSU_EP0_STATUS_PHASE 3U |
Status Pahse.
Referenced by XUsbPsu_Ep0StartStatus(), and XUsbPsu_Ep0XferComplete().
#define XUsbPsu_ReadLpdReg | ( | Offset | ) | Xil_In32(LPD_BASE_ADDRESS + (u32)(Offset)) |
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. |
#define XUsbPsu_ReadReg | ( | InstancePtr, | |
Offset | |||
) | Xil_In32((InstancePtr)->ConfigPtr->BaseAddress + (u32)(Offset)) |
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_ConnDoneIntr(), XUsbPsu_CoreInit(), XUsbPsu_DisableIntr(), XUsbPsu_DisconnectIntr(), XUsbPsu_EnableIntr(), XUsbPsu_EpDisable(), XUsbPsu_EpEnable(), XUsbPsu_EpGetTransferIndex(), XUsbPsu_EventBufferHandler(), XUsbPsu_GetLinkState(), XUsbPsu_Idle(), XUsbPsu_IntrHandler(), XUsbPsu_PhyReset(), XUsbPsu_ReadHwParams(), XUsbPsu_ResetIntr(), XUsbPsu_SaveEndpointState(), XUsbPsu_SetDeviceAddress(), XUsbPsu_SetLinkState(), XUsbPsu_SetMode(), XUsbPsu_SetSpeed(), XUsbPsu_SetTestMode(), 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)) |
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)) |
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)) |
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_AcceptU1U2Sleep(), XUsbPsu_ConnDoneIntr(), XUsbPsu_CoreInit(), XUsbPsu_DisableIntr(), XUsbPsu_DisconnectIntr(), XUsbPsu_EnableIntr(), XUsbPsu_EpDisable(), XUsbPsu_EpEnable(), XUsbPsu_EventBufferHandler(), XUsbPsu_EventBuffersReset(), XUsbPsu_EventBuffersSetup(), XUsbPsu_Idle(), XUsbPsu_IntrHandler(), XUsbPsu_PhyReset(), XUsbPsu_ResetIntr(), XUsbPsu_SendEpCmd(), XUsbPsu_SetDeviceAddress(), XUsbPsu_SetLinkState(), XUsbPsu_SetMode(), XUsbPsu_SetSpeed(), XUsbPsu_SetTestMode(), XUsbPsu_SetU1SleepTimeout(), XUsbPsu_SetU2SleepTimeout(), XUsbPsu_Start(), XUsbPsu_Stop(), XUsbPsu_U1SleepDisable(), XUsbPsu_U1SleepEnable(), XUsbPsu_U2SleepDisable(), and XUsbPsu_U2SleepEnable().
#define XUsbPsu_WriteVendorReg | ( | Offset, | |
Data | |||
) | Xil_Out32(VENDOR_BASE_ADDRESS + (u32)(Offset), (u32)(Data)) |
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 |
s32 XUsbPsu_AcceptU1U2Sleep | ( | struct XUsbPsu * | InstancePtr | ) |
Enable Accept U1 and U2 sleep enable.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
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.
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. |
References XUsbPsu::ConfigPtr, XUsbPsu_Config::EnableSuperSpeed, XUsbPsu_CoreInit(), XUsbPsu_EventBuffersSetup(), XUsbPsu_InitializeEps(), XUsbPsu_ReadHwParams(), XUsbPsu_SetDeviceAddress(), XUsbPsu_SetMode(), and XUsbPsu_SetSpeed().
void XUsbPsu_ClearStalls | ( | struct XUsbPsu * | InstancePtr | ) |
Clears Stall on all endpoints.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::UsbEpNum, XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().
void XUsbPsu_ConnDoneIntr | ( | struct XUsbPsu * | InstancePtr | ) |
Connection Done Interrupt handler.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu::HasHibernation, XUsbPsu_EnableControlEp(), XUsbPsu_ReadReg, XUsbPsu_RecvSetup(), and XUsbPsu_WriteReg.
Referenced by XUsbPsu_DevInterrupt().
s32 XUsbPsu_CoreInit | ( | struct XUsbPsu * | InstancePtr | ) |
Initializes Core.
InstancePtr | is a pointer to the XUsbPsu instance to be worked on. |
References XUsbPsu::ConfigPtr, XUsbPsu::HasHibernation, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_PhyReset(), XUsbPsu_ReadHwParams(), XUsbPsu_ReadReg, XUsbPsu_Wait_Clear_Timeout(), and XUsbPsu_WriteReg.
Referenced by XUsbPsu_CfgInitialize().
void XUsbPsu_DevInterrupt | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Devt * | Event | ||
) |
Interrupt handler for device specific events.
InstancePtr | is a pointer to the XUsbPsu instance. |
Event | is the Device Event occurred in core. |
References XUsbPsu::HasHibernation, 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.
InstancePtr | is a pointer to the XUsbPsu instance to be worked on. |
Mask | is the OR of Interrupt Enable Masks
|
References XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
void XUsbPsu_DisconnectIntr | ( | struct XUsbPsu * | InstancePtr | ) |
Disconnect Interrupt handler.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu::HasHibernation, XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
Referenced by XUsbPsu_DevInterrupt().
s32 XUsbPsu_EnableControlEp | ( | struct XUsbPsu * | InstancePtr, |
u16 | Size | ||
) |
Enables USB Control Endpoint i.e., EP0OUT and EP0IN of Core.
InstancePtr | is a pointer to the XUsbPsu instance. |
Size | is control endpoint size. |
References XUsbPsu_EpEnable().
Referenced by XUsbPsu_ConnDoneIntr().
void XUsbPsu_EnableIntr | ( | struct XUsbPsu * | InstancePtr, |
u32 | Mask | ||
) |
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, and XUsbPsu_WriteReg.
Referenced by SetupInterruptSystem(), and UsbEnableEvent().
void XUsbPsu_Ep0_EndControlData | ( | struct XUsbPsu * | InstancePtr, |
struct XUsbPsu_Ep * | Ept | ||
) |
Ends Data Phase - used in case of error.
InstancePtr | is a pointer to the XUsbPsu instance. |
Dep | is a pointer to the Endpoint structure. |
References XUsbPsu_Ep::Direction, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Ep::UsbEpNum, XUsbPsu_GetEpParams(), XUsbPsu_SendEpCmd(), and XUsbSleep().
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.
InstancePtr | is a pointer to the XUsbPsu instance. |
Event | is a pointer to the Endpoint event occurred in core. |
References XUsbPsu_Ep::BufferPtr, XUsbPsu_Ep::BytesTxed, XUsbPsu::ConfigPtr, XUsbPsu::eps, XUsbPsu_Config::IsCacheCoherent, and XUsbPsu_Ep::RequestedBytes.
Referenced by XUsbPsu_Ep0XferComplete().
void XUsbPsu_Ep0Intr | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Epevt * | Event | ||
) |
Handles Interrupts of Control Endpoints EP0 OUT and EP0 IN.
InstancePtr | is a pointer to the XUsbPsu instance. |
Event | is a pointer to the Endpoint event occurred in core. |
References XUsbPsu_Ep0XferComplete(), and XUsbPsu_Ep0XferNotReady().
Referenced by XUsbPsu_EpInterrupt().
s32 XUsbPsu_Ep0Recv | ( | struct XUsbPsu * | InstancePtr, |
u8 * | BufferPtr, | ||
u32 | Length | ||
) |
Initiates DMA to receive data on Control Endpoint EP0 OUT from Host.
InstancePtr | is a pointer to the XUsbPsu instance. |
BufferPtr | is pointer to data. |
Length | is Length of data to be received. |
References XUsbPsu_Ep::BufferPtr, XUsbPsu_Ep::BytesTxed, XUsbPsu::ConfigPtr, XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_Ep::MaxSize, XUsbPsu_Ep::RequestedBytes, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Ep::UsbEpNum, XUSBPSU_EP0_DATA_PHASE, 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.
InstancePtr | is a pointer to the XUsbPsu instance. |
BufferPtr | is pointer to data. |
BufferLen | is Length of data buffer. |
References XUsbPsu_Ep::BufferPtr, XUsbPsu_Ep::BytesTxed, XUsbPsu::ConfigPtr, XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_Ep::RequestedBytes, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Ep::UsbEpNum, XUSBPSU_EP0_DATA_PHASE, 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.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUSBPSU_EP0_SETUP_PHASE, 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.
InstancePtr | is a pointer to the XUsbPsu instance. |
Event | is a pointer to the Endpoint event occurred in core. |
References XUsbPsu::ConfigPtr, XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Ep::UsbEpNum, XUSBPSU_EP0_STATUS_PHASE, XUsbPsu_EpGetTransferIndex(), XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().
Referenced by XUsbPsu_Ep0XferNotReady().
void XUsbPsu_Ep0StatusDone | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Epevt * | Event | ||
) |
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 occurred in core. |
References XUsbPsu::ConfigPtr, XUsbPsu_Config::IsCacheCoherent, 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.
InstancePtr | is a pointer to the XUsbPsu instance. |
Event | is a pointer to the Endpoint event occurred in core. |
References XUsbPsu::ConfigPtr, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_Ep::ResourceIndex, XUSBPSU_EP0_DATA_PHASE, XUSBPSU_EP0_SETUP_PHASE, XUSBPSU_EP0_STATUS_PHASE, XUsbPsu_Ep0DataDone(), and XUsbPsu_Ep0StatusDone().
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.
InstancePtr | is a pointer to the XUsbPsu instance. |
Event | is a pointer to the Endpoint event occurred in core. |
References XUsbPsu::eps, 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.
InstancePtr | is a pointer to the XUsbPsu instance. |
UsbEp | is USB endpoint number. |
BufferPtr | is pointer to data. |
Length | is length of data to be received. |
References XUsbPsu_Ep::BufferPtr, XUsbPsu_Ep::BytesTxed, XUsbPsu::ConfigPtr, XUsbPsu_Ep::CurUf, XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_Ep::MaxSize, XUsbPsu_Ep::RequestedBytes, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Ep::Type, XUsbPsu_Ep::UsbEpNum, XUsbPsu_Ep0Recv(), XUsbPsu_EpGetTransferIndex(), XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().
s32 XUsbPsu_EpBufferSend | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEp, | ||
u8 * | BufferPtr, | ||
u32 | BufferLen | ||
) |
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::BufferPtr, XUsbPsu_Ep::BytesTxed, XUsbPsu::ConfigPtr, XUsbPsu_Ep::CurUf, XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_Ep::PhyEpNum, XUsbPsu_Ep::RequestedBytes, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Ep::Type, XUsbPsu_Ep::UsbEpNum, XUsbPsu_Ep0Send(), XUsbPsu_EpGetTransferIndex(), XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().
void XUsbPsu_EpClearStall | ( | struct XUsbPsu * | InstancePtr, |
u8 | Epnum, | ||
u8 | Dir | ||
) |
Clears Stall on an Endpoint.
InstancePtr | is a pointer to the XUsbPsu instance. |
EpNum | is USB endpoint number. |
Dir | is direction. |
References XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::UsbEpNum, XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().
Referenced by XUsbPsu_EpDisable().
s32 XUsbPsu_EpDisable | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEpNum, | ||
u8 | Dir | ||
) |
Disables Endpoint.
InstancePtr | is a pointer to the XUsbPsu instance. |
UsbEpNum | is USB endpoint number. |
Dir | is direction of endpoint
|
References XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::MaxSize, XUsbPsu_Ep::PhyEpNum, XUsbPsu_Ep::Type, XUsbPsu_Ep::UsbEpNum, XUsbPsu_EpClearStall(), XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
s32 XUsbPsu_EpEnable | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEpNum, | ||
u8 | Dir, | ||
u16 | Maxsize, | ||
u8 | Type, | ||
u8 | Restore | ||
) |
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 |
References XUsbPsu::ConfigPtr, XUsbPsu_Ep::CurUf, XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu::IsHibernated, XUsbPsu_Ep::MaxSize, XUsbPsu_Ep::PhyEpNum, XUsbPsu_Ep::Type, XUsbPsu_Ep::UsbEpNum, XUsbPsu_ReadReg, XUsbPsu_SetEpConfig(), XUsbPsu_SetXferResource(), XUsbPsu_StartEpConfig(), and XUsbPsu_WriteReg.
Referenced by XUsbPsu_EnableControlEp().
u32 XUsbPsu_EpGetTransferIndex | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEpNum, | ||
u8 | Dir | ||
) |
Returns Transfer Index assigned by Core for an Endpoint transfer.
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 |
References XUsbPsu_ReadReg.
Referenced by XUsbPsu_Ep0Recv(), XUsbPsu_Ep0Send(), XUsbPsu_Ep0StartStatus(), XUsbPsu_EpBufferRecv(), XUsbPsu_EpBufferSend(), XUsbPsu_Idle(), and XUsbPsu_RecvSetup().
void XUsbPsu_EpInterrupt | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Epevt * | Event | ||
) |
Endpoint interrupt handler.
InstancePtr | is a pointer to the XUsbPsu instance. |
Event | is endpoint Event occurred in the core. |
References XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep0Intr(), XUsbPsu_EpXferComplete(), and XUsbPsu_EpXferNotReady().
Referenced by XUsbPsu_EventHandler().
void XUsbPsu_EpSetStall | ( | struct XUsbPsu * | InstancePtr, |
u8 | Epnum, | ||
u8 | Dir | ||
) |
Stalls an Endpoint.
InstancePtr | is a pointer to the XUsbPsu instance. |
Epnum | is USB endpoint number. |
Dir | is direction. |
References XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::UsbEpNum, XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().
Referenced by XUsbPsu_Ep0StallRestart().
void XUsbPsu_EpXferComplete | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Epevt * | Event | ||
) |
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 occurred in core. |
References XUsbPsu_Ep::BufferPtr, XUsbPsu_Ep::BytesTxed, XUsbPsu::ConfigPtr, XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_Ep::MaxSize, XUsbPsu_Ep::RequestedBytes, and XUsbPsu_Ep::ResourceIndex.
Referenced by XUsbPsu_EpInterrupt().
void XUsbPsu_EpXferNotReady | ( | struct XUsbPsu * | InstancePtr, |
const struct XUsbPsu_Event_Epevt * | Event | ||
) |
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, XUsbPsu_Ep::Interval, and XUsbPsu_Ep::Type.
Referenced by XUsbPsu_EpInterrupt().
void XUsbPsu_EventBufferHandler | ( | struct XUsbPsu * | InstancePtr | ) |
Processes events in an Event Buffer.
InstancePtr | is a pointer to the XUsbPsu instance. Event buffer number. |
References XUsbPsu::ConfigPtr, XUsbPsu_Config::IsCacheCoherent, XUsbPsu::IsHibernated, XUsbPsu_EventHandler(), XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
Referenced by XUsbPsu_IntrHandler().
void XUsbPsu_EventBuffersReset | ( | struct XUsbPsu * | InstancePtr | ) |
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.
Referenced by XUsbPsu_Idle().
void XUsbPsu_EventBuffersSetup | ( | struct XUsbPsu * | InstancePtr | ) |
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.
Referenced by XUsbPsu_CfgInitialize().
void XUsbPsu_EventHandler | ( | struct XUsbPsu * | InstancePtr, |
const union XUsbPsu_Event * | Event | ||
) |
Processes an Event entry in Event Buffer.
InstancePtr | is a pointer to the XUsbPsu instance. |
Event | is the Event entry. |
References XUsbPsu_DevInterrupt(), and XUsbPsu_EpInterrupt().
Referenced by XUsbPsu_EventBufferHandler().
struct XUsbPsu_EpParams * XUsbPsu_GetEpParams | ( | struct XUsbPsu * | InstancePtr | ) |
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_Ep0Recv(), XUsbPsu_Ep0Send(), XUsbPsu_Ep0StartStatus(), XUsbPsu_EpBufferRecv(), XUsbPsu_EpBufferSend(), XUsbPsu_EpClearStall(), XUsbPsu_EpSetStall(), XUsbPsu_Idle(), 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.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg.
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.
buffers.
InstancePtr | is a pointer to the XUsbPsu instance to be worked on. |
References XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::MaxSize, XUsbPsu_Ep::PhyEpNum, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Ep::Type, XUsbPsu_EpGetTransferIndex(), XUsbPsu_EventBuffersReset(), XUsbPsu_GetEpParams(), XUsbPsu_ReadHwParams(), XUsbPsu_ReadReg, XUsbPsu_SendEpCmd(), XUsbPsu_Stop(), XUsbPsu_Wait_Clear_Timeout(), and XUsbPsu_WriteReg.
void XUsbPsu_InitializeEps | ( | struct XUsbPsu * | InstancePtr | ) |
Initializes Endpoints.
All OUT endpoints are even numbered and all IN endpoints are odd numbered. EP0 is for Control OUT and EP1 is for Control IN.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::PhyEpNum, and XUsbPsu_Ep::ResourceIndex.
Referenced by XUsbPsu_CfgInitialize().
void XUsbPsu_IntrHandler | ( | void * | XUsbPsuInstancePtr | ) |
Main Interrupt Handler.
References XUsbPsu_EventBufferHandler(), XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
Referenced by SetupInterruptSystem(), and UsbPollHandler().
s32 XUsbPsu_IsEpStalled | ( | struct XUsbPsu * | InstancePtr, |
u8 | Epnum, | ||
u8 | Dir | ||
) |
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::eps, XUsbPsu_Ep::EpStatus, and XUsbPsu_Ep::PhyEpNum.
s32 XUsbPsu_IsSuperSpeed | ( | struct XUsbPsu * | InstancePtr | ) |
Checks if the current speed is Super Speed or not.
InstancePtr | is a pointer to the XUsbPsu instance. |
Referenced by IsSuperSpeed().
void XUsbPsu_LinkStsChangeIntr | ( | struct XUsbPsu * | InstancePtr, |
u32 | EvtInfo | ||
) |
Link Status Change Interrupt handler.
InstancePtr | is a pointer to the XUsbPsu instance. |
EvtInfo | is Event information. |
Referenced by XUsbPsu_DevInterrupt().
XUsbPsu_Config * XUsbPsu_LookupConfig | ( | u16 | DeviceId | ) |
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 | ) |
Issues core PHY reset.
InstancePtr | is a pointer to the XUsbPsu instance to be worked on. |
References XUsbPsu_ReadReg, XUsbPsu_WriteReg, and XUsbSleep().
Referenced by XUsbPsu_CoreInit().
u32 XUsbPsu_ReadHwParams | ( | struct XUsbPsu * | InstancePtr, |
u8 | RegIndex | ||
) |
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
|
References XUsbPsu_ReadReg.
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.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu::ConfigPtr, XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Config::IsCacheCoherent, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Ep::UsbEpNum, XUSBPSU_EP0_SETUP_PHASE, XUsbPsu_EpGetTransferIndex(), XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().
Referenced by XUsbPsu_ConnDoneIntr(), XUsbPsu_Ep0StallRestart(), and XUsbPsu_Ep0StatusDone().
void XUsbPsu_ResetIntr | ( | struct XUsbPsu * | InstancePtr | ) |
Reset Interrupt handler.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
Referenced by XUsbPsu_DevInterrupt().
void XUsbPsu_SaveEndpointState | ( | struct XUsbPsu * | InstancePtr, |
struct XUsbPsu_Ep * | Ept | ||
) |
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::EpSavedState, XUsbPsu_Ep::PhyEpNum, XUsbPsu_Ep::UsbEpNum, XUsbPsu_GetEpParams(), XUsbPsu_ReadReg, and XUsbPsu_SendEpCmd().
s32 XUsbPsu_SendEpCmd | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEpNum, | ||
u8 | Dir, | ||
u32 | Cmd, | ||
struct XUsbPsu_EpParams * | Params | ||
) |
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. |
References XUsbPsu_Wait_Clear_Timeout(), and XUsbPsu_WriteReg.
Referenced by XUsbPsu_ClearStalls(), XUsbPsu_Ep0_EndControlData(), XUsbPsu_Ep0Recv(), XUsbPsu_Ep0Send(), XUsbPsu_Ep0StartStatus(), XUsbPsu_EpBufferRecv(), XUsbPsu_EpBufferSend(), XUsbPsu_EpClearStall(), XUsbPsu_EpSetStall(), XUsbPsu_Idle(), XUsbPsu_RecvSetup(), XUsbPsu_SaveEndpointState(), XUsbPsu_SetEpConfig(), XUsbPsu_SetXferResource(), XUsbPsu_StartEpConfig(), and XUsbPsu_StopTransfer().
s32 XUsbPsu_SetDeviceAddress | ( | struct XUsbPsu * | InstancePtr, |
u16 | Addr | ||
) |
Sets Device Address of the Core.
InstancePtr | is a pointer to the XUsbPsu instance. |
Addr | is address to set. |
References XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
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 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 |
References XUsbPsu::eps, XUsbPsu_Ep::EpSavedState, XUsbPsu_Ep::Interval, XUsbPsu_Ep::Type, XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().
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.
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. |
References XUsbPsu::eps, and XUsbPsu_Ep::PhyEpNum.
s32 XUsbPsu_SetLinkState | ( | struct XUsbPsu * | InstancePtr, |
XusbPsuLinkStateChange | State | ||
) |
Sets USB Link to a particular State.
InstancePtr | is a pointer to the XUsbPsu instance. |
State | is State of Link to set. |
References XUsbPsu_ReadReg, XUsbPsu_Wait_Clear_Timeout(), and XUsbPsu_WriteReg.
void XUsbPsu_SetMode | ( | struct XUsbPsu * | InstancePtr, |
u32 | Mode | ||
) |
Sets mode of Core to USB Device/Host/OTG.
InstancePtr | is a pointer to the XUsbPsu instance to be worked on. |
Mode | is mode to set
|
References XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
Referenced by XUsbPsu_CfgInitialize().
void XUsbPsu_SetSpeed | ( | struct XUsbPsu * | InstancePtr, |
u32 | Speed | ||
) |
Sets speed of the Core for connecting to Host.
InstancePtr | is a pointer to the XUsbPsu instance. |
Speed | is required speed
|
References XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
Referenced by XUsbPsu_CfgInitialize().
s32 XUsbPsu_SetTestMode | ( | struct XUsbPsu * | InstancePtr, |
u32 | Mode | ||
) |
Enables USB2 Test Modes.
InstancePtr | is a pointer to the XUsbPsu instance. |
Mode | is Test mode to set. |
References XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
Referenced by XUsbPsu_Ep0StatusDone().
s32 XUsbPsu_SetU1SleepTimeout | ( | struct XUsbPsu * | InstancePtr, |
u8 | Sleep | ||
) |
Set U1 sleep timeout.
InstancePtr | is a pointer to the XUsbPsu instance. |
Sleep | is time in microseconds |
References XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
s32 XUsbPsu_SetU2SleepTimeout | ( | struct XUsbPsu * | InstancePtr, |
u8 | Sleep | ||
) |
Set U2 sleep timeout.
InstancePtr | is a pointer to the XUsbPsu instance. |
Sleep | is time in microseconds |
References XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
s32 XUsbPsu_SetXferResource | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEpNum, | ||
u8 | Dir | ||
) |
Sends Set Transfer Resource 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. |
References XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().
Referenced by XUsbPsu_EpEnable().
s32 XUsbPsu_Start | ( | struct XUsbPsu * | InstancePtr | ) |
Starts the controller so that Host can detect this device.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg, XUsbPsu_Wait_Clear_Timeout(), and XUsbPsu_WriteReg.
s32 XUsbPsu_StartEpConfig | ( | struct XUsbPsu * | InstancePtr, |
u32 | UsbEpNum, | ||
u8 | Dir | ||
) |
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
|
References XUsbPsu_GetEpParams(), and XUsbPsu_SendEpCmd().
Referenced by XUsbPsu_EpEnable().
s32 XUsbPsu_Stop | ( | struct XUsbPsu * | InstancePtr | ) |
Stops the controller so that Device disconnects from Host.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg, XUsbPsu_Wait_Set_Timeout(), and XUsbPsu_WriteReg.
Referenced by XUsbPsu_Idle().
void XUsbPsu_StopTransfer | ( | struct XUsbPsu * | InstancePtr, |
u8 | UsbEpNum, | ||
u8 | Dir, | ||
u8 | Force | ||
) |
Stops transfer on 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. Force flag to stop/pause transfer. |
References XUsbPsu_Ep::Direction, XUsbPsu::eps, XUsbPsu_Ep::EpStatus, XUsbPsu_Ep::ResourceIndex, XUsbPsu_Ep::UsbEpNum, XUsbPsu_GetEpParams(), XUsbPsu_SendEpCmd(), and XUsbSleep().
s32 XUsbPsu_U1SleepDisable | ( | struct XUsbPsu * | InstancePtr | ) |
Enable U1 disable sleep.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
s32 XUsbPsu_U1SleepEnable | ( | struct XUsbPsu * | InstancePtr | ) |
Enable U1 enable sleep.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
s32 XUsbPsu_U2SleepDisable | ( | struct XUsbPsu * | InstancePtr | ) |
Enable U2 disable sleep.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
s32 XUsbPsu_U2SleepEnable | ( | struct XUsbPsu * | InstancePtr | ) |
Enable U2 enable sleep.
InstancePtr | is a pointer to the XUsbPsu instance. |
References XUsbPsu_ReadReg, and XUsbPsu_WriteReg.
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.
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_CoreInit(), XUsbPsu_Idle(), XUsbPsu_SendEpCmd(), XUsbPsu_SetLinkState(), and XUsbPsu_Start().
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.
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_Stop().
void XUsbSleep | ( | u32 | USeconds | ) |
API for Sleep routine.
USeconds | is time in MicroSeconds. |
Referenced by XUsbPsu_Ep0_EndControlData(), XUsbPsu_PhyReset(), XUsbPsu_StopTransfer(), XUsbPsu_Wait_Clear_Timeout(), and XUsbPsu_Wait_Set_Timeout().