![]() |
usbps
Xilinx SDK Drivers API Documentation
|
Data Structures | |
struct | XUsbPs_EpOut |
struct | XUsbPs_EpIn |
struct | XUsbPs_Endpoint |
struct | XUsbPs_SetupData |
struct | XUsbPs_EpSetup |
struct | XUsbPs_EpConfig |
struct | XUsbPs_DeviceConfig |
struct | XUsbPs_Config |
struct | XUsbPs |
Macros | |
#define | XUsbPs_GetFrameNum(InstancePtr) XUsbPs_ReadReg((InstancePtr)->Config.BaseAddress, XUSBPS_FRAME_OFFSET) |
#define | XUsbPs_Start(InstancePtr) XUsbPs_SetBits(InstancePtr, XUSBPS_CMD_OFFSET, XUSBPS_CMD_RS_MASK) |
#define | XUsbPs_Stop(InstancePtr) XUsbPs_ClrBits(InstancePtr, XUSBPS_CMD_OFFSET, XUSBPS_CMD_RS_MASK) |
#define | XUsbPs_ForceFS(InstancePtr) |
#define | XUsbPs_StartTimer0(InstancePtr, Interval) |
#define | XUsbPs_StopTimer0(InstancePtr) |
#define | XUsbPs_ReadTimer0(InstancePtr) |
#define | XUsbPs_RemoteWakeup(InstancePtr) |
#define | XUsbPs_EpEnable(InstancePtr, EpNum, Dir) |
#define | XUsbPs_EpDisable(InstancePtr, EpNum, Dir) |
#define | XUsbPs_EpStall(InstancePtr, EpNum, Dir) |
#define | XUsbPs_EpUnStall(InstancePtr, EpNum, Dir) |
#define | XUsbPs_EpFlush(InstancePtr, EpNum, Dir) |
#define | XUsbPs_IntrEnable(InstancePtr, IntrMask) XUsbPs_SetBits(InstancePtr, XUSBPS_IER_OFFSET, IntrMask) |
#define | XUsbPs_IntrDisable(InstancePtr, IntrMask) XUsbPs_ClrBits(InstancePtr, XUSBPS_IER_OFFSET, IntrMask) |
#define | XUsbPs_NakIntrEnable(InstancePtr, NakIntrMask) XUsbPs_SetBits(InstancePtr, XUSBPS_EPNAKIER_OFFSET, NakIntrMask) |
#define | XUsbPs_NakIntrDisable(InstancePtr, NakIntrMask) XUsbPs_ClrBits(InstancePtr, XUSBPS_EPNAKIER_OFFSET, NakIntrMask) |
#define | XUsbPs_NakIntrClear(InstancePtr, NakIntrMask) |
#define | XUsbPs_SetIntrThreshold(InstancePtr, Threshold) |
#define | XUsbPs_SetSetupTripwire(InstancePtr) |
#define | XUsbPs_ClrSetupTripwire(InstancePtr) |
#define | XUsbPs_SetupTripwireIsSet(InstancePtr) |
#define | XUsbPs_SetBits(InstancePtr, RegOffset, Bits) |
#define | XUsbPs_ClrBits(InstancePtr, RegOffset, Bits) |
System hang prevention Timeout counter value. | |
This value is used throughout the code to initialize a Timeout counter that is used when hard polling a register. The ides is to initialize the Timeout counter to a value that is longer than any expected Timeout but short enough so the system will continue to work and report an error while the user is still paying attention. A reasonable Timeout time would be about 10 seconds. The XUSBPS_TIMEOUT_COUNTER value should be chosen so a polling loop would run about 10 seconds before a Timeout is detected. For example: int Timeout = XUSBPS_TIMEOUT_COUNTER; while ((XUsbPs_ReadReg(InstancePtr->Config.BaseAddress, XUSBPS_CMD_OFFSET) & XUSBPS_CMD_RST_MASK) && –Timeout) { ; } if (0 == Timeout) { return XST_FAILURE; } | |
Endpoint Direction (bitmask) | |
Definitions to be used with Endpoint related function that require a 'Direction' parameter. NOTE: The direction is always defined from the perspective of the HOST! This means that an IN endpoint on the controller is used for sending data while the OUT endpoint on the controller is used for receiving data. | |
#define | XUSBPS_EP_DIRECTION_IN 0x01 |
#define | XUSBPS_EP_DIRECTION_OUT 0x02 |
Endpoint Type | |
Definitions to be used with Endpoint related functions that require a 'Type' parameter. | |
#define | XUSBPS_EP_TYPE_NONE 0 |
#define | XUSBPS_EP_TYPE_BULK 3 |
Field names for status retrieval | |
Definitions for the XUsbPs_GetStatus() function call 'StatusType' parameter. | |
#define | XUSBPS_EP_STS_ADDRESS 1 |
#define | XUSBPS_EP_STS_CONTROLLER_STATE 2 |
USB Default alternate setting | |
Endpoint event types | |
Definitions that are used to identify events that occur on endpoints. Passed to the endpoint event handler functions registered with XUsbPs_EpSetHandler(). | |
#define | XUSBPS_EP_EVENT_SETUP_DATA_RECEIVED 0x01 |
#define | XUSBPS_EP_EVENT_DATA_RX 0x02 |
#define | XUSBPS_EP_EVENT_DATA_TX 0x03 |
Functions | |
int | XUsbPs_CfgInitialize (XUsbPs *InstancePtr, const XUsbPs_Config *ConfigPtr, u32 BaseAddress) |
int | XUsbPs_ConfigureDevice (XUsbPs *InstancePtr, const XUsbPs_DeviceConfig *CfgPtr) |
int | XUsbPs_Reset (XUsbPs *InstancePtr) |
void | XUsbPs_DeviceReset (XUsbPs *InstancePtr) |
int | XUsbPs_SetDeviceAddress (XUsbPs *InstancePtr, u8 Address) |
int | XUsbPs_Suspend (const XUsbPs *InstancePtr) |
int | XUsbPs_Resume (const XUsbPs *InstancePtr) |
int | XUsbPs_RequestHostResume (const XUsbPs *InstancePtr) |
int | XUsbPs_EpBufferSend (XUsbPs *InstancePtr, u8 EpNum, const u8 *BufferPtr, u32 BufferLen) |
int | XUsbPs_EpBufferSendWithZLT (XUsbPs *InstancePtr, u8 EpNum, const u8 *BufferPtr, u32 BufferLen) |
int | XUsbPs_EpBufferReceive (XUsbPs *InstancePtr, u8 EpNum, u8 **BufferPtr, u32 *BufferLenPtr, u32 *Handle) |
void | XUsbPs_EpBufferRelease (u32 Handle) |
int | XUsbPs_EpSetHandler (XUsbPs *InstancePtr, u8 EpNum, u8 Direction, XUsbPs_EpHandlerFunc CallBackFunc, void *CallBackRef) |
int | XUsbPs_EpGetSetupData (XUsbPs *InstancePtr, int EpNum, XUsbPs_SetupData *SetupDataPtr) |
int | XUsbPs_EpPrime (XUsbPs *InstancePtr, u8 EpNum, u8 Direction) |
int | XUsbPs_ReconfigureEp (XUsbPs *InstancePtr, XUsbPs_DeviceConfig *CfgPtr, int EpNum, unsigned short NewDirection, int DirectionChanged) |
void | XUsbPs_IntrHandler (void *InstancePtr) |
int | XUsbPs_IntrSetHandler (XUsbPs *InstancePtr, XUsbPs_IntrHandlerFunc CallBackFunc, void *CallBackRef, u32 Mask) |
XUsbPs_Config * | XUsbPs_LookupConfig (u16 DeviceId) |
#define XUsbPs_ClrBits | ( | InstancePtr, | |
RegOffset, | |||
Bits | |||
) |
This macro clears the given bits in the register.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
RegOffset | is the register offset to be written. |
Bits | are the bits to be cleared in the register |
#define XUsbPs_ClrSetupTripwire | ( | InstancePtr | ) |
This macro clears the Tripwire bit in the USB command register.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
Referenced by XUsbPs_EpGetSetupData().
#define XUsbPs_EpDisable | ( | InstancePtr, | |
EpNum, | |||
Dir | |||
) |
This macro disables the given endpoint for the given direction.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
EpNum | is the number of the endpoint to disable. |
Dir | is the direction of the endpoint (bitfield):
|
#define XUsbPs_EpEnable | ( | InstancePtr, | |
EpNum, | |||
Dir | |||
) |
This macro enables the given endpoint for the given direction.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
EpNum | is number of the endpoint to enable. |
Dir | is direction of the endpoint (bitfield):
|
#define XUsbPs_EpFlush | ( | InstancePtr, | |
EpNum, | |||
Dir | |||
) |
This macro flush an endpoint upon interface disable.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
EpNum | is the number of the endpoint to flush. |
Dir | is the direction of the endpoint (bitfield):
|
#define XUsbPs_EpStall | ( | InstancePtr, | |
EpNum, | |||
Dir | |||
) |
This macro stalls the given endpoint for the given direction, and flush the buffers.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
EpNum | is number of the endpoint to stall. |
Dir | is the direction of the endpoint (bitfield):
|
#define XUsbPs_EpUnStall | ( | InstancePtr, | |
EpNum, | |||
Dir | |||
) |
This macro unstalls the given endpoint for the given direction.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
EpNum | is the Number of the endpoint to unstall. |
Dir | is the Direction of the endpoint (bitfield):
|
#define XUsbPs_ForceFS | ( | InstancePtr | ) |
This macro forces the USB engine to be in Full Speed (FS) mode.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
#define XUsbPs_GetFrameNum | ( | InstancePtr | ) | XUsbPs_ReadReg((InstancePtr)->Config.BaseAddress, XUSBPS_FRAME_OFFSET) |
This macro returns the current frame number.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
#define XUsbPs_IntrDisable | ( | InstancePtr, | |
IntrMask | |||
) | XUsbPs_ClrBits(InstancePtr, XUSBPS_IER_OFFSET, IntrMask) |
This function disables the interrupts defined by the bit mask.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
IntrMask | is a Bit mask of interrupts to be disabled. |
#define XUsbPs_IntrEnable | ( | InstancePtr, | |
IntrMask | |||
) | XUsbPs_SetBits(InstancePtr, XUSBPS_IER_OFFSET, IntrMask) |
This macro enables the interrupts defined by the bit mask.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
IntrMask | is the Bit mask of interrupts to be enabled. |
#define XUsbPs_NakIntrClear | ( | InstancePtr, | |
NakIntrMask | |||
) |
This function clears the endpoint NAK interrupts status defined by the bit mask.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
NakIntrMask | is the Bit mask of endpoint NAK interrupts to be cleared. |
#define XUsbPs_NakIntrDisable | ( | InstancePtr, | |
NakIntrMask | |||
) | XUsbPs_ClrBits(InstancePtr, XUSBPS_EPNAKIER_OFFSET, NakIntrMask) |
This macro disables the endpoint NAK interrupts defined by the bit mask.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
NakIntrMask | is a Bit mask of endpoint NAK interrupts to be disabled. |
#define XUsbPs_NakIntrEnable | ( | InstancePtr, | |
NakIntrMask | |||
) | XUsbPs_SetBits(InstancePtr, XUSBPS_EPNAKIER_OFFSET, NakIntrMask) |
This macro enables the endpoint NAK interrupts defined by the bit mask.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
NakIntrMask | is the Bit mask of endpoint NAK interrupts to be enabled. |
#define XUsbPs_ReadTimer0 | ( | InstancePtr | ) |
This macro reads Timer 0.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
#define XUsbPs_RemoteWakeup | ( | InstancePtr | ) |
This macro force remote wakeup on host.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
#define XUsbPs_SetBits | ( | InstancePtr, | |
RegOffset, | |||
Bits | |||
) |
This macro sets the given bit mask in the register.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
RegOffset | is the register offset to be written. |
Bits | is the Bits to be set in the register |
Referenced by XUsbPs_ConfigureDevice().
#define XUsbPs_SetIntrThreshold | ( | InstancePtr, | |
Threshold | |||
) |
This macro sets the Interrupt Threshold value in the control register.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
Threshold | is the Interrupt threshold to be set. Allowed values:
|
#define XUsbPs_SetSetupTripwire | ( | InstancePtr | ) |
This macro sets the Tripwire bit in the USB command register.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
Referenced by XUsbPs_EpGetSetupData().
#define XUsbPs_SetupTripwireIsSet | ( | InstancePtr | ) |
This macro checks if the Tripwire bit in the USB command register is set.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
Referenced by XUsbPs_EpGetSetupData().
#define XUsbPs_Start | ( | InstancePtr | ) | XUsbPs_SetBits(InstancePtr, XUSBPS_CMD_OFFSET, XUSBPS_CMD_RS_MASK) |
This macro starts the USB engine.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
#define XUsbPs_StartTimer0 | ( | InstancePtr, | |
Interval | |||
) |
This macro starts the USB Timer 0, with repeat option for period of one second.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
Interval | is the interval for Timer0 to generate an interrupt |
#define XUsbPs_Stop | ( | InstancePtr | ) | XUsbPs_ClrBits(InstancePtr, XUSBPS_CMD_OFFSET, XUSBPS_CMD_RS_MASK) |
This macro stops the USB engine.
InstancePtr | is a pointer to the XUsbPs instance of the controller. |
Referenced by XUsbPs_DeviceReset().
#define XUsbPs_StopTimer0 | ( | InstancePtr | ) |
This macro stops Timer 0.
InstancePtr | is a pointer to XUsbPs instance of the controller. |
int XUsbPs_BusReset | ( | XUsbPs * | InstancePtr | ) |
DEVICE mode specific functions.