usbps
Vitis Drivers API Documentation
xusbps_audio_example.c File Reference

Overview

This file contains the implementation of chapter 9 specific code for the example.

MODIFICATION HISTORY:
Ver   Who       Date     Changes


1.0 pm 20/02/20 First release 2.8 pm 07/07/23 Added support for system device-tree flow.

 

Functions

s32 XUsbPs_CfgInit (struct Usb_DevData *InstancePtr, Usb_Config *ConfigPtr, u32 BaseAddress)
 This function initializes a XUsbPs instance/driver. More...
 
s32 XUsbPs_SetupInterruptSystem (XUsbPs *InstancePtr, u16 IntcDeviceID, XScuGic *IntcInstancePtr)
 This function setups the interrupt system such that interrupts can occur. More...
 
int main (void)
 This function is the main function of the USB audio example. More...
 

Function Documentation

s32 XUsbPs_CfgInit ( struct Usb_DevData *  InstancePtr,
Usb_Config ConfigPtr,
u32  BaseAddress 
)

This function initializes a XUsbPs instance/driver.

The initialization entails:

  • Initialize all members of the XUsbPs structure.
Parameters
InstancePtris a pointer to XUsbPs instance of the controller.
ConfigPtris a pointer to a XUsbPs_Config configuration structure. This structure will contain the requested configuration for the device. Typically, this is a local structure and the content of which will be copied into the configuration structure within XUsbPs.
BaseAddressis the base address of the device.
Returns
  • XST_SUCCESS no errors occurred.
  • XST_FAILURE an error occurred during initialization.
Note

References XUsbPs_CfgInitialize().

Referenced by main().

s32 XUsbPs_SetupInterruptSystem ( XUsbPs InstancePtr,
u16  IntcDeviceID,
XScuGic *  IntcInstancePtr 
)

This 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. The USB controller could be directly connected to aprocessor without an interrupt controller. The user should modify this function to fit the application.

Parameters
InstancePtris a pointer to the XUsbPs instance.
IntcDeviceIDis the unique ID of the interrupt controller
IntcInstacePtris a pointer to the interrupt controller instance.
Returns
XST_SUCCESS if successful, otherwise XST_FAILURE.
Note
None.

References XUsbPs_IntrEnable, XUsbPs_IntrHandler(), XUSBPS_IXR_UI_MASK, and XUSBPS_IXR_UR_MASK.

Referenced by main().