Xilinx Vitis Drivers API Documentation
usbpsu Documentation

This section explains the implementation of functions of USBPSU driver.This driver supports both USB high-speed and super-speed features for USB peripheral mode.

The definitions for endpoints is included by the xusbps_endpoint.c, which is implementing the endpoint functions and by xusbps_intr.c.

Initialization & Configuration

The XUsbPsu_Config structure is used by the driver to configure itself. Fields inside this structure are properties of XUsbPsu based on its hardware build.

To support multiple runtime loading and initialization strategies employed by various operating systems, the driver instance can be initialized in the following way:

  • XUsbPsu_CfgInitialize(InstancePtr, CfgPtr, EffectiveAddr) - Uses a configuration structure provided by the caller. If running in a system with address translation, the parameter EffectiveAddr should be the virtual address.

Endpoint Support

This driver supports control, bulk, interrupt and ISO endpoint and its applications like mass-storage, HID, audio and composite, etc. Based on user application configuration set by the application.


The driver defaults to no interrupts at initialization such that interrupts must be enabled if desired. An interrupt is generated for one of the following conditions.

  • Disconnect Detected Event Enable
  • USB Reset Enable
  • Connection Done Enable
  • Link State Change Event Enable
  • Wakeup Event Enable

The SetupInterruptSystem function setups the interrupt system such that interrupts can occur. This function is application specific since the actual system may or may not have an interrupt controller.

Ver   Who    Date     Changes

1.0 sg 06/06/16 First release 1.1 sg 10/24/16 Update for backward compatibility Added XUsbPsu_IsSuperSpeed function in xusbpsu.c 1.2 mn 01/20/17 removed unnecessary declaration of XUsbPsu_SetConfiguration in xusbpsu.h 1.2 mn 01/30/17 Corrected InstancePtr->UnalignedTx with Ept->UnalignedTx in xusbpsu_controltransfers.c 1.2 mus 02/10/17 Updated data structures to fix compilation errors for IAR compiler ms 03/17/17 Added readme.txt file in examples folder for doxygen generation. ms 04/10/17 Modified filename tag to include the file in doxygen examples. 1.4 bk 12/01/18 Modify USBPSU driver code to fit USB common example code for all USB IPs. myk 12/01/18 Added hibernation support for device mode vak 22/01/18 Added changes for supporting microblaze platform vak 13/03/18 Moved the setup interrupt system calls from driver to example. vak 24/09/18 Added EnableSuperSpeed in XUsbPsu_Config for speed negotiation at the time of connection to Host 1.5 vak 02/06/19 Added "xusbpsu_endpoint.h" header 1.5 vak 03/25/19 Fixed incorrect data_alignment pragma directive for IAR 1.6 pm 22/07/19 Removed coverity warnings 1.7 pm 14/11/19 Updated number of TRB to improve performance pm 03/23/20 Restructured the code for more readability and modularity pm 03/14/20 Added clocking support 1.8 pm 24/07/20 Fixed MISRA-C and Coverity warnings 1.9 pm 03/21/21 Fixed doxygen warnings 1.10 pm 08/30/21 Update MACRO to fix plm compilation warnings