|
#define | XUSBPS_MAX_PACKET_SIZE 1024 |
| Maximum value can be put into the queue head. More...
|
|
#define | XUsbPs_GetFrameNum(InstancePtr) XUsbPs_ReadReg((InstancePtr)->Config.BaseAddress, XUSBPS_FRAME_OFFSET) |
| This macro returns the current frame number. More...
|
|
#define | XUsbPs_Start(InstancePtr) XUsbPs_SetBits(InstancePtr, XUSBPS_CMD_OFFSET, XUSBPS_CMD_RS_MASK) |
| This macro starts the USB engine. More...
|
|
#define | XUsbPs_Stop(InstancePtr) XUsbPs_ClrBits(InstancePtr, XUSBPS_CMD_OFFSET, XUSBPS_CMD_RS_MASK) |
| This macro stops the USB engine. More...
|
|
#define | XUsbPs_ForceFS(InstancePtr) |
| This macro forces the USB engine to be in Full Speed (FS) mode. More...
|
|
#define | XUsbPs_StartTimer0(InstancePtr, Interval) |
| This macro starts the USB Timer 0, with repeat option for period of one second. More...
|
|
#define | XUsbPs_StopTimer0(InstancePtr) |
| This macro stops Timer 0. More...
|
|
#define | XUsbPs_ReadTimer0(InstancePtr) |
| This macro reads Timer 0. More...
|
|
#define | XUsbPs_RemoteWakeup(InstancePtr) |
| This macro force remote wakeup on host. More...
|
|
#define | XUsbPs_EpEnable(InstancePtr, EpNum, Dir) |
| This macro enables the given endpoint for the given direction. More...
|
|
#define | XUsbPs_EpDisable(InstancePtr, EpNum, Dir) |
| This macro disables the given endpoint for the given direction. More...
|
|
#define | XUsbPs_EpStall(InstancePtr, EpNum, Dir) |
| This macro stalls the given endpoint for the given direction, and flush the buffers. More...
|
|
#define | XUsbPs_EpUnStall(InstancePtr, EpNum, Dir) |
| This macro unstalls the given endpoint for the given direction. More...
|
|
#define | XUsbPs_EpFlush(InstancePtr, EpNum, Dir) |
| This macro flush an endpoint upon interface disable. More...
|
|
#define | XUsbPs_IntrEnable(InstancePtr, IntrMask) XUsbPs_SetBits(InstancePtr, XUSBPS_IER_OFFSET, IntrMask) |
| This macro enables the interrupts defined by the bit mask. More...
|
|
#define | XUsbPs_IntrDisable(InstancePtr, IntrMask) XUsbPs_ClrBits(InstancePtr, XUSBPS_IER_OFFSET, IntrMask) |
| This function disables the interrupts defined by the bit mask. More...
|
|
#define | XUsbPs_NakIntrEnable(InstancePtr, NakIntrMask) XUsbPs_SetBits(InstancePtr, XUSBPS_EPNAKIER_OFFSET, NakIntrMask) |
| This macro enables the endpoint NAK interrupts defined by the bit mask. More...
|
|
#define | XUsbPs_NakIntrDisable(InstancePtr, NakIntrMask) XUsbPs_ClrBits(InstancePtr, XUSBPS_EPNAKIER_OFFSET, NakIntrMask) |
| This macro disables the endpoint NAK interrupts defined by the bit mask. More...
|
|
#define | XUsbPs_NakIntrClear(InstancePtr, NakIntrMask) |
| This function clears the endpoint NAK interrupts status defined by the bit mask. More...
|
|
#define | XUsbPs_SetIntrThreshold(InstancePtr, Threshold) |
| This macro sets the Interrupt Threshold value in the control register. More...
|
|
#define | XUsbPs_SetSetupTripwire(InstancePtr) |
| This macro sets the Tripwire bit in the USB command register. More...
|
|
#define | XUsbPs_ClrSetupTripwire(InstancePtr) |
| This macro clears the Tripwire bit in the USB command register. More...
|
|
#define | XUsbPs_SetupTripwireIsSet(InstancePtr) |
| This macro checks if the Tripwire bit in the USB command register is set. More...
|
|
#define | XUsbPs_SetBits(InstancePtr, RegOffset, Bits) |
| This macro sets the given bit mask in the register. More...
|
|
#define | XUsbPs_ClrBits(InstancePtr, RegOffset, Bits) |
| This macro clears the given bits in the register. More...
|
|
|
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;
|
#define | XUSBPS_TIMEOUT_COUNTER 1000000 |
|
|
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 |
| Endpoint direction IN. More...
|
|
#define | XUSBPS_EP_DIRECTION_OUT 0x02 |
| Endpoint direction OUT. More...
|
|
|
Definitions to be used with Endpoint related functions that require a 'Type' parameter.
|
#define | XUSBPS_EP_TYPE_NONE 0 |
| Endpoint is not used. More...
|
|
#define | XUSBPS_EP_TYPE_CONTROL 1 |
| Endpoint for Control Transfers. More...
|
|
#define | XUSBPS_EP_TYPE_ISOCHRONOUS 2 |
| Endpoint for isochronous data. More...
|
|
#define | XUSBPS_EP_TYPE_BULK 3 |
| Endpoint for BULK Transfers. More...
|
|
#define | XUSBPS_EP_TYPE_INTERRUPT 4 |
| Endpoint for interrupt Transfers. More...
|
|
|
#define | ENDPOINT_MAXP_LENGTH 0x400 |
| Endpoint Max Packet Length in DeviceConfig is a coded value, ch9.6.6. More...
|
|
|
Definitions for the XUsbPs_GetStatus() function call 'StatusType' parameter.
|
#define | XUSBPS_EP_STS_ADDRESS 1 |
| Address of controller. More...
|
|
#define | XUSBPS_EP_STS_CONTROLLER_STATE 2 |
| Current controller state. More...
|
|
|
#define | XUSBPS_DEFAULT_ALT_SETTING 0 |
| The default alternate setting is 0. More...
|
|
|
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 |
| Setup data has been received on the endpoint. More...
|
|
#define | XUSBPS_EP_EVENT_DATA_RX 0x02 |
| Data frame has been received on the endpoint. More...
|
|
#define | XUSBPS_EP_EVENT_DATA_TX 0x03 |
| Data frame has been sent on the endpoint. More...
|
|
|
int | XUsbPs_CfgInitialize (XUsbPs *InstancePtr, const XUsbPs_Config *ConfigPtr, u32 BaseAddress) |
| Setup / Initialize functions. More...
|
|
int | XUsbPs_ConfigureDevice (XUsbPs *InstancePtr, const XUsbPs_DeviceConfig *CfgPtr) |
| This function configures the DEVICE side of the controller. More...
|
|
int | XUsbPs_Reset (XUsbPs *InstancePtr) |
| Common functions used for DEVICE/HOST mode. More...
|
|
void | XUsbPs_DeviceReset (XUsbPs *InstancePtr) |
| This function performs device reset, device is stopped at the end. More...
|
|
int | XUsbPs_BusReset (XUsbPs *InstancePtr) |
| DEVICE mode specific functions. More...
|
|
int | XUsbPs_SetDeviceAddress (XUsbPs *InstancePtr, u8 Address) |
| This functions sets the controller's DEVICE address. More...
|
|
int | XUsbPs_Suspend (const XUsbPs *InstancePtr) |
| Handling Suspend and Resume. More...
|
|
int | XUsbPs_Resume (const XUsbPs *InstancePtr) |
| USB Resume. More...
|
|
int | XUsbPs_RequestHostResume (const XUsbPs *InstancePtr) |
| USB Assert Resume. More...
|
|
int | XUsbPs_EpBufferSend (XUsbPs *InstancePtr, u8 EpNum, const u8 *BufferPtr, u32 BufferLen) |
| This function sends a given data buffer. More...
|
|
int | XUsbPs_EpBufferSendWithZLT (XUsbPs *InstancePtr, u8 EpNum, const u8 *BufferPtr, u32 BufferLen) |
| This function sends a given data buffer and also zero length packet if the Bufferlen is in multiples of endpoint max packet size. More...
|
|
int | XUsbPs_EpBufferReceive (XUsbPs *InstancePtr, u8 EpNum, u8 **BufferPtr, u32 *BufferLenPtr, u32 *Handle) |
| This function receives a data buffer from the endpoint of the given endpoint number. More...
|
|
void | XUsbPs_EpBufferRelease (u32 Handle) |
| This function returns a previously received data buffer to the driver. More...
|
|
int | XUsbPs_EpSetHandler (XUsbPs *InstancePtr, u8 EpNum, u8 Direction, XUsbPs_EpHandlerFunc CallBackFunc, void *CallBackRef) |
| This function sets the handler for endpoint events. More...
|
|
s32 | XUsbPs_EpSetIsoHandler (XUsbPs *InstancePtr, u8 EpNum, u8 Direction, XUsbPs_EpIsoHandlerFunc CallBackFunc) |
| This function sets the handler for ISO endpoint events. More...
|
|
int | XUsbPs_EpGetSetupData (XUsbPs *InstancePtr, int EpNum, XUsbPs_SetupData *SetupDataPtr) |
| This function extracts the Setup Data from a given endpoint. More...
|
|
int | XUsbPs_EpPrime (XUsbPs *InstancePtr, u8 EpNum, u8 Direction) |
| This function primes an endpoint. More...
|
|
int | XUsbPs_ReconfigureEp (XUsbPs *InstancePtr, XUsbPs_DeviceConfig *CfgPtr, int EpNum, unsigned short NewDirection, int DirectionChanged) |
| This function reconfigures one Ep corresponding to host's request of setting alternate interface. More...
|
|
void | XUsbPs_IntrHandler (void *InstancePtr) |
| This function is the first-level interrupt handler for the USB core. More...
|
|
int | XUsbPs_IntrSetHandler (XUsbPs *InstancePtr, XUsbPs_IntrHandlerFunc CallBackFunc, void *CallBackRef, u32 Mask) |
| This function registers the user callback handler for controller (non-endpoint) interrupts. More...
|
|
void | XUsbPs_EpGetData (XUsbPs *InstancePtr, u8 EpNum, u32 BufferLen) |
| This function receives a data buffer from the endpoint of the given endpoint number and pass it to the application. More...
|
|
s32 | XUsbPs_EpDataBufferReceive (XUsbPs *InstancePtr, u8 EpNum, u8 *BufferPtr, u32 BufferLen) |
| This function receives a data buffer from the endpoint of the given endpoint number. More...
|
|
XUsbPs_Config * | XUsbPs_LookupConfig (u16 DeviceId) |
| Looks up the controller configuration based on the unique controller ID. More...
|
|