usbps
Vitis Drivers API Documentation
xusbps_ch9_audio.h 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

 

Macros

Endpoint Type
#define USB_EP_TYPE_NONE   XUSBPS_EP_TYPE_NONE
 
#define USB_EP_TYPE_CONTROL   XUSBPS_EP_TYPE_CONTROL
 
#define USB_EP_TYPE_ISOCHRONOUS   XUSBPS_EP_TYPE_ISOCHRONOUS
 
#define USB_EP_TYPE_BULK   XUSBPS_EP_TYPE_BULK
 
#define USB_EP_TYPE_INTERRUPT   XUSBPS_EP_TYPE_INTERRUPT
 
Endpoint Address
#define USB_EP1_IN   0x81
 
#define USB_EP1_OUT   0x01
 
#define USB_EP2_IN   0x82
 
#define USB_EP2_OUT   0x02
 

Functions

u32 XUsbPs_Ch9SetupDevDescReply (u8 *BufPtr, u32 BufLen)
 This function returns the device descriptor for the device. More...
 
u32 XUsbPs_Ch9SetupCfgDescReply (u8 *BufPtr, u32 BufLen)
 This function returns the configuration descriptor for the device. More...
 
u32 XUsbPs_Ch9SetupStrDescReply (u8 *BufPtr, u32 BufLen, u8 Index)
 This function returns a string descriptor for the given index. More...
 
void XUsbPs_SetConfiguration (XUsbPs *InstancePtr, int config)
 Changes State of Core to USB configured State. More...
 
void XUsbPs_SetConfigurationApp (XUsbPs *InstancePtr, XUsbPs_SetupData *SetupData)
 This function is called by Chapter9 handler when SET_CONFIGURATION command is received from Host. More...
 
void XUsbPs_SetInterfaceHandler (XUsbPs *InstancePtr, XUsbPs_SetupData *SetupData)
 This function is called by Chapter9 handler when SET_CONFIGURATION command or SET_INTERFACE command is received from Host. More...
 

Function Documentation

u32 XUsbPs_Ch9SetupCfgDescReply ( u8 *  BufPtr,
u32  BufLen 
)

This function returns the configuration descriptor for the device.

Parameters
InstancePtris a pointer to the Usb_DevData instance.
BufPtris the pointer to the buffer that is to be filled with the descriptor.
BufLenis the size of the provided buffer.
Returns
Length of the descriptor in the buffer on success. 0 on error.
Parameters
BufPtris the pointer to the buffer that is to be filled with the descriptor.
BufLenis the size of the provided buffer.
Returns
Length of the descriptor in the buffer on success. 0 on error.
u32 XUsbPs_Ch9SetupDevDescReply ( u8 *  BufPtr,
u32  BufLen 
)

This function returns the device descriptor for the device.

Parameters
InstancePtris a pointer to the Usb_DevData instance.
BufPtris pointer to the buffer that is to be filled with the descriptor.
BufLenis the size of the provided buffer.
Returns
Length of the descriptor in the buffer on success. 0 on error.
Parameters
BufPtris pointer to the buffer that is to be filled with the descriptor.
BufLenis the size of the provided buffer.
Returns
Length of the descriptor in the buffer on success. 0 on error.
u32 XUsbPs_Ch9SetupStrDescReply ( u8 *  BufPtr,
u32  BufLen,
u8  Index 
)

This function returns a string descriptor for the given index.

Parameters
InstancePtris a pointer to the Usb_DevData instance.
BufPtris a pointer to the buffer that is to be filled with the descriptor.
BufLenis the size of the provided buffer.
Indexis the index of the string for which the descriptor is requested.
Returns
Length of the descriptor in the buffer on success. 0 on error.
Parameters
BufPtris a pointer to the buffer that is to be filled with the descriptor.
BufLenis the size of the provided buffer.
Indexis the index of the string for which the descriptor is requested.
Returns
Length of the descriptor in the buffer on success. 0 on error.
void XUsbPs_SetConfiguration ( XUsbPs InstancePtr,
int  ConfigIdx 
)

Changes State of Core to USB configured State.

Parameters
InstancePtris a pointer to the Usb_DevData instance.
Ctrlis a pointer to the Setup packet data.
Returns
XST_SUCCESS else XST_FAILURE
Note
None.

Changes State of Core to USB configured State.

Parameters
InstancePtris a pointer to XUsbPs instance of the controller.
ConfigIdxis the Index of the desired configuration.
Returns
None
void XUsbPs_SetConfigurationApp ( XUsbPs InstancePtr,
XUsbPs_SetupData SetupData 
)

This function is called by Chapter9 handler when SET_CONFIGURATION command is received from Host.

Parameters
InstancePtris pointer to Usb_DevData instance.
SetupDatais the setup packet received from Host.
Returns
  • XST_SUCCESS if successful,
  • XST_FAILURE if unsuccessful.
Note
Non control endpoints must be enabled after SET_CONFIGURATION command since hardware clears all previously enabled endpoints except control endpoints when this command is received.
Parameters
InstancePtris pointer to XUsbPs instance of the controller.
SetupDatais the setup packet received from Host.
Returns
  • XST_SUCCESS if successful,
  • XST_FAILURE if unsuccessful.
Note
Non control endpoints must be enabled after SET_CONFIGURATION command since hardware clears all previously enabled endpoints except control endpoints when this command is received.
void XUsbPs_SetInterfaceHandler ( XUsbPs InstancePtr,
XUsbPs_SetupData SetupData 
)

This function is called by Chapter9 handler when SET_CONFIGURATION command or SET_INTERFACE command is received from Host.

Parameters
InstancePtris pointer to Usb_DevData instance.
SetupDatais the setup packet received from Host.
Note
Non control endpoints must be enabled after SET_INTERFACE command since hardware clears all previously enabled endpoints except control endpoints when this command is received.
Parameters
InstancePtris pointer to XUsbPs instance of the controller.
SetupDatais the setup packet received from Host.
Note