| usbps Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
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

int main | ( | void |  | ) |

This function is the main function of the USB audio example.

Parameters

  None |

Returns
  - XST_SUCCESS if successful,
  - XST_FAILURE if unsuccessful.

Note
  None.

References XUsbPs_Config::BaseAddress, XUsbPs_EpSetup::BufSize, XUsbPs_DeviceConfig::DMAMemPhys, XUsbPs_DeviceConfig::EpCfg, XUsbPs_EpConfig::In, XUsbPs_EpSetup::MaxPacketSize, XUsbPs_EpSetup::NumBufs, XUsbPs_DeviceConfig::NumEndpoints, XUsbPs_EpConfig::Out, XUsbPs_EpSetup::Type, XUsbPs_CfgInit(), XUsbPs_ConfigureDevice(), XUSBPS_EP_DIRECTION_IN, XUSBPS_EP_DIRECTION_OUT, XUSBPS_EP_TYPE_CONTROL, XUSBPS_EP_TYPE_ISOCHRONOUS, XUsbPs_EpSetHandler(), XUsbPs_EpSetIsoHandler(), XUsbPs_IntrEnable, XUsbPs_IntrHandler(), XUSBPS_IXR_UI_MASK, XUSBPS_IXR_UR_MASK, XUsbPs_LookupConfig(), XUsbPs_SetupInterruptSystem(), and XUsbPs_Start.

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

  InstancePtr | is a pointer to XUsbPs instance of the controller.
  ConfigPtr | is 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.
  BaseAddress | is 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

  InstancePtr | is a pointer to the XUsbPs instance.
  IntcDeviceID | is the unique ID of the interrupt controller
  IntcInstacePtr | is 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().