![]() |
usb
Xilinx SDK Drivers API Documentation
|
This file has the USB example Mass storage device application function with SCSI command processing and related response preparation being implemented as a part of the interrupt handler.
MODIFICATION HISTORY:
Ver Who Date Changes
1.00a hvm 2/22/07 First release. 4.00a hvm 06/01/11 Signature parameter of Command Status word is initialized with 'U''S''B''S' in ProcessRxCmd function. CR611761 fix. 4.01a bss 11/01/11 Modified UsbIfIntrHandler function to unconditionally reset when USB reset is asserted (CR 627574). 4.03a bss 02/05/13 Updated the example to support Zynq
Functions | |
void | ReadTransfer (XUsb *InstancePtr) |
This function implements the reception of data in the USB device for the READ request from the USB Host. More... | |
void | WriteTransfer (XUsb *InstancePtr) |
This function implements the reception of data in the USB device for the WRITE request from the USB Host. More... | |
void | DmaIntrHandler (void *CallBackRef, u32 IntrStatus) |
This function is the interrupt handler for the USB DMA events. More... | |
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 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 DmaIntrHandler | ( | void * | CallBackRef, |
u32 | IntrStatus | ||
) |
This function is the interrupt handler for the USB DMA events.
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. |
void Ep0IntrHandler | ( | void * | CallBackRef, |
u8 | EpNum, | ||
u32 | IntrStatus | ||
) |
This function is the interrupt handler for the USB End point Zero events.
CallBackRef | is the callback reference passed from the interrupt. handler, which in our case is a pointer to the driver instance. |
EpNum | is the end point number. |
IntrStatus | is a bit mask indicating pending interrupts. |
void Ep1IntrHandler | ( | void * | CallBackRef, |
u8 | EpNum, | ||
u32 | IntrStatus | ||
) |
This function is the interrupt handler for the USB End point one events.
CallBackRef | is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance. |
EpNum | is the end point number. |
IntrStatus | is a bit mask indicating pending interrupts. |
void Ep2IntrHandler | ( | void * | CallBackRef, |
u8 | EpNum, | ||
u32 | IntrStatus | ||
) |
This function is the interrupt handler for the USB End point two events.
CallBackRef | is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance. |
EpNum | is the end point number. |
IntrStatus | is a bit mask indicating pending interrupts. |
void GetMaxLUN | ( | XUsb * | InstancePtr | ) |
This routine is called when a GETMAXLUN class command is received.
InstancePtr | is a pointer to the XUsb instance of the controller. |
void InitUsbInterface | ( | XUsb * | InstancePtr | ) |
This is the USB initialization function.
This example initializes the device for Mass Storage Application. The following configuration is done.
InstancePtr | is a pointer to the XUsb instance. |
int main | ( | void | ) |
This main function starts the USB application.
None. |
References XUsb_LookupConfig().
void MassStorageReset | ( | XUsb * | InstancePtr | ) |
This routine is called when a RESET class command is received.
InstancePtr | is a pointer to the XUsb instance of the controller. |
void ProcessRxCmd | ( | XUsb * | InstancePtr | ) |
This function processes mass storage specific commands and sends the required response.
InstancePtr | is a pointer to the XUsb instance. |
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.
InstancePtr | is a pointer to the XUsb instance. |
pCmdBlock | is a pointer to the Mass Storage Command Block wrapper. |
pStatusBlock | is a pointer to the Mass Storage Status wrapper. |
void ReadTransfer | ( | XUsb * | InstancePtr | ) |
This function implements the reception of data in the USB device for the READ request from the USB Host.
InstancePtr | is a pointer to the XUsb instance. |
References XUsb_DeviceConfig::CurrentSpeed, XUsb::DeviceConfig, and XUSB_EP_HIGH_SPEED.
void UsbIfIntrHandler | ( | void * | CallBackRef, |
u32 | IntrStatus | ||
) |
This function is the interrupt handler for the USB mass storage device application.
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. |
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.
InstancePtr | is a pointer to the XUsb instance. |
pCmdBlock | is a pointer to the Mass Storage Command Block wrapper. |
pStatusBlock | is a pointer to the Mass Storage Status wrapper. |