This file contains the constants, type definitions, variables and function prototypes used in the mass storage application.
- Note
- None.
MODIFICATION HISTORY:
Ver Who Date Changes
1.00a hvm 2/12/07 First release
1.01a hvm 10/2/08 The variables IntLba in Lba and IntBlockCount in
BlockCount are declared as volatile.
2.00a hvm 03/12/09 Modified the RAMDISKSECTORS constant value from 0x4000 to
0x400 as this would reduce the code size and the example
can run in a smaller memory systems.
3.02a hvm 08/16/10 Updated with the little endian support changes.
4.00a hvm 10/25/10 Updated with DmaIntrHandler function prototype. Updated
INQUIRY command with pad values.
4.00a hvm 06/01/11 Modified the USB Mass Storage Command Status Wrapper
structure. The union for Signature is removed and
only the array definition of Signature is retained.
CR611761 fix.
4.00a hvm 06/24/11 Updated the INQUIRY command fourth parameter value to 0.
CR614794
4.01a hvm 08/11/11 Updated the RamDisk variable to have a 32 bit address
alignment.
4.01a hvm 09/14/11 Fixed the compilation issue at the RamDisk variable
declaration. CR625055.
|
void | InitUsbInterface (XUsb *InstancePtr) |
| This is the USB initialization function. More...
|
|
void | UsbIfIntrHandler (void *CallBackRef, u32 IntrStatus) |
| This function is the interrupt handler for the USB mass storage device application. More...
|
|
void | Ep0IntrHandler (void *CallBackRef, u8 EpNum, u32 IntrStatus) |
| This function is the interrupt handler for the USB End point Zero events. More...
|
|
void | Ep1IntrHandler (void *CallBackRef, u8 EpNum, u32 IntrStatus) |
| This function is the interrupt handler for the USB End point one events. More...
|
|
void | Ep2IntrHandler (void *CallBackRef, u8 EpNum, u32 IntrStatus) |
| This function is the interrupt handler for 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.
This is the USB initialization function.
The following is the configuration.
- EP0 : CONTROL end point, Bidirectional, Packet size 64 bytes.
- EP1 : NON_ISOCHRONOUS, INTERRUPT_IN, packet size of 16 bytes.
- Parameters
-
InstancePtr | is a pointer to the XUsb instance. |
- Returns
- None.
- Note
- None.
This example initializes the device for Microphone Application. The following configuration is done.
- EP0 : CONTROL end point, Bidirectional, Packet size 64 bytes.
- EP1 : ISOCHRONOUS, BULK_IN, packet size 1024 bytes.
- Parameters
-
InstancePtr | is a pointer to the XUsb instance. |
- Returns
- None.
- Note
- None.
This example initializes the USB device for USB mouse example. The following configuration is done.
- EP0 : CONTROL end point, Bidirectional, Packet size 64 bytes.
- EP1 : NON_ISOCHRONOUS, INTERRUPT_IN, packet size of 16 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.
void UsbIfIntrHandler |
( |
void * |
CallBackRef, |
|
|
u32 |
IntrStatus |
|
) |
| |
This function is the interrupt handler for the USB mass storage device application.
- Parameters
-
CallBackRef | is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance. |
IntrStatus | is a bit mask indicating pending interrupts. |
- Returns
- None.
- Note
- None.
This function is the interrupt handler for the USB mass storage device application.
- Parameters
-
CallBackRef | is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance. |
IntrStatus | is a bit mask indicating pending interrupts. |
- Returns
- None.
- Note
- Each interrupt source is disabled upon reception. This is to avoid the repetitive occurrence of the same event. This is done because these event conditions exist for few milliseconds.
This function is the interrupt handler for the USB mass storage device application.
- Parameters
-
CallBackRef | is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance. |
IntrStatus | is a bit mask indicating pending interrupts. |
- Returns
- None.
- Note
- None.
This function is the interrupt handler for the USB mass storage device application.
- Parameters
-
CallBackRef | is the callback reference passed from to the function, which in our case is a pointer to the driver instance. |
IntrStatus | is a bit mask indicating pending interrupts. |
- Returns
- None.
- Note
- None.