usbpsu
Xilinx SDK Drivers API Documentation
xusb_freertos_massstorage.c File Reference

Overview

This file implements the mass storage class example.

requirement zcu102 board in usb device mode, connected with host using USB 3.0 cable

Following other files require to run this example o xusb_ch9.c, xusb_ch9.h o xusb_freertos_ch9_storage.c, xusb_freerots_ch9_storage.h o xusb_freertos_class_storage.c, xusb_freertos_class_storage.h

o on success example will be detected as mass storage on host o do IN and OUT transfer of the same size o must not get diff between IN and OUT files

MODIFICATION HISTORY:
Ver   Who  Date     Changes

1.0 rb 22/03/18 First release
 

Functions

void BulkOutHandler (void *CallBackRef, u32 RequestedBytes, u32 BytesTxed)
 This function is Bulk Out Endpoint handler/Callback called by driver when data is received. More...
 
void BulkInHandler (void *CallBackRef, u32 RequestedBytes, u32 BytesTxed)
 This function is Bulk In Endpoint handler/Callback called by driver when data is sent. More...
 
void SetupInterruptSystem (struct XUsbPsu *InstancePtr, u16 UsbIntrId)
 This function setups the interrupt system such that interrupts can occur. More...
 
int main (void)
 This function is the main function of the USB mass storage example. More...
 

Function Documentation

◆ BulkInHandler()

void BulkInHandler ( void *  CallBackRef,
u32  RequestedBytes,
u32  BytesTxed 
)

This function is Bulk In Endpoint handler/Callback called by driver when data is sent.

Parameters
CallBackRefis pointer to Usb_DevData instance.
RequestedBytesis number of bytes requested to send.
BytesTxedis actual number of bytes sent to Host.
Returns
None
Note
None.

◆ BulkOutHandler()

void BulkOutHandler ( void *  CallBackRef,
u32  RequestedBytes,
u32  BytesTxed 
)

This function is Bulk Out Endpoint handler/Callback called by driver when data is received.

Parameters
CallBackRefis pointer to Usb_DevData instance.
RequestedBytesis number of bytes requested for reception.
BytesTxedis actual number of bytes received from Host.
Returns
None
Note
None.

◆ main()

int main ( void  )

This function is the main function of the USB mass storage example.

Parameters
None.
Returns
  • XST_SUCCESS if successful,
  • XST_FAILURE if unsuccessful.
Note
None.

◆ SetupInterruptSystem()

void SetupInterruptSystem ( struct XUsbPsu InstancePtr,
u16  UsbIntrId 
)

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 a processor without an interrupt controller. The user should modify this function to fit the application.

Parameters
InstancePtris a pointer to the XUsbPsu instance.
UsbIntrIdis the interrupt ID of the USB controller
Returns
None
Note
None.

References XUsbPsu_EnableIntr(), and XUsbPsu_IntrHandler().