This file contains Mass storage device application related functions implemented in polled mode.
- Note
- The example is tested on MicroBlaze, with caches included in the H/W design. This example works for USB high speed interface only.
MODIFICATION HISTORY:
Ver Who Date Changes
4.00a hvm 05/24/11 Created based on the xusb_storage.c example.
4.01a bss 11/01/11 Modified UsbIfIntrHandler function to unconditionally
reset when USB reset is asserted (CR 627574).
4.02a bss 04/05/12 Modified the sequence of Cache Flush and Invalidation.
The cache flush happens just before the driver API
EPDataSend is called. Similarly the cache invalidation
is done after the call to EPDataReceive and after the
dma transfer is over.
|
int | main () |
| This main function starts the USB application. More...
|
|
void | InitUsbInterface (XUsb *InstancePtr) |
| This is the USB initialization function. More...
|
|
void | UsbIfIntrHandler (void *CallBackRef, u32 IntrStatus) |
| This function processes the reset and disconnect conditions of the USB mass storage device. More...
|
|
void | Ep0IntrHandler (void *CallBackRef, u8 EpNum, u32 IntrStatus) |
| This function processes the USB End point Zero events. More...
|
|
void | Ep1IntrHandler (void *CallBackRef, u8 EpNum, u32 IntrStatus) |
| This function processes the USB End point one events. More...
|
|
void | Ep2IntrHandler (void *CallBackRef, u8 EpNum, u32 IntrStatus) |
| This function processes the USB End point two events. More...
|
|
void | ProcessRxCmd (XUsb *InstancePtr) |
| This function processes mass storage specific commands and sends the required response. More...
|
|
void | Read10 (XUsb *InstancePtr, PUSBCBW pCmdBlock, PUSBCSW pStatusBlock) |
| This function implements the transmission of data from the device to the READ request from the USB Host. More...
|
|
void | Write10 (XUsb *InstancePtr, PUSBCBW pCmdBlock, PUSBCSW pStatusBlock) |
| This function implements the reception of data in the USB device for the write request from the USB Host. More...
|
|
void | MassStorageReset (XUsb *InstancePtr) |
| This routine is called when a RESET class command is received. More...
|
|
void | GetMaxLUN (XUsb *InstancePtr) |
| This routine is called when a GETMAXLUN class command is received. More...
|
|
void InitUsbInterface |
( |
XUsb * |
InstancePtr | ) |
|
This is the USB initialization function.
This example initializes the device for Mass Storage Application. The following configuration is done.
- EP0 : CONTROL end point, Bidirectional, Packet size 64 bytes.
- EP1 : NON_ISOCHRONOUS, BULK_IN, packet size 512 bytes.
- EP2 : NON_ISOCHRONOUS, BULK_OUT, packet size 512 bytes
- Parameters
-
InstancePtr | is a pointer to the XUsb instance. |
- Returns
- None.
- Note
- None.
References XUsb_Config::BaseAddress, XUsb_EpConfig::Buffer0Ready, XUsb_EpConfig::Buffer1Ready, XUsb::Config, XUsb::DeviceConfig, XUsb_DeviceConfig::Ep, XUsb_EpConfig::EpType, XUsb_DeviceConfig::NumEndpoints, XUsb_EpConfig::OutIn, XUsb_EpConfig::RamBase, XUsb_EpConfig::Size, XUSB_BUFFREADY_OFFSET, XUsb_ConfigureDevice(), XUSB_EP_DIRECTION_IN, XUSB_EP_DIRECTION_OUT, XUsb_EpEnable(), XUSB_STATUS_EP_BUFF2_SHIFT, and XUsb_WriteReg.