| usbpsu Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Functions
xusb_freertos_class_composite.h File Reference

## Overview

This file contains definitions used in the composite device class code.

    MODIFICATION HISTORY:

    Ver   Who  Date     Changes

    1.0   rb   28/03/18 First release
    1.5   vak  13/02/19 Added support for versal
    1.5   vak  03/25/19 Fixed incorrect data_alignment pragma directive for IAR

## Data Structures
struct | __attribute__
| struct SetupPacket - USB Standard Control Request More...
struct | __attribute__
| struct SetupPacket - USB Standard Control Request More...
struct | __attribute__
| struct SetupPacket - USB Standard Control Request More...
struct | __attribute__
| struct SetupPacket - USB Standard Control Request More...
struct | __attribute__
| struct SetupPacket - USB Standard Control Request More...
struct | __attribute__
| struct SetupPacket - USB Standard Control Request More...
struct | __attribute__
| struct SetupPacket - USB Standard Control Request More...

## Functions
s32 | Usb_DfuSetState (struct dfu_if *DFU, u8 dfu_state)
| This function handles setting of DFU state. More...
void | USB_DfuSetDwloadState (struct dfu_if *DFU, u8 *status)
| This function updates the current state while downloading a file. More...
void | USB_DfuGetStatus (struct dfu_if *DFU, u8 *status)
| This function handles getting of DFU status. More...
void | Usb_DisconnectHandler (struct Usb_DevData *InstancePtr)
| This function handles USB disconnect, called from driver. More...
void | Usb_ResetHandler (struct Usb_DevData *InstancePtr)
| This function handles USB reset, called from driver. More...
void | Usb_SetIntf (struct Usb_DevData *InstancePtr, SetupPacket *SetupData)
| This function handles set interface request. More...
void | Usb_ClassReq (struct Usb_DevData *InstancePtr, SetupPacket *SetupData)
| This function is class request handler for composite device Setup packet received is for Class request(not a Standard Device request) More...
void | ClassReq (struct Usb_DevData *InstancePtr, SetupPacket *SetupData)
| This function is class handler for Mass storage and is called when Setup packet received is for Class request(not Standard Device request) More...
void | ParseCBW (struct Usb_DevData *InstancePtr, struct storage_if *f)
| This function handles Reduced Block Command (RBC) requests from the host. More...
void | SendCSW (struct Usb_DevData *InstancePtr, struct storage_if *f, u32 Length)
| This function is used to send SCSI Command Status Wrapper to Host. More...
void | prvKeyboardTask (void *pvParameters)
| This task implements keyboard functionality. More...
void | prvSCSITask (void *pvParameters)
| This task implements SCSI command functionality. More...
void | prvPlayBackTask (void *pvParameters)
| This task implements audio playback functionality. More...
void | prvRecordTask (void *pvParameters)
| This task implements audio record functionality. More...

## Function Documentation

void ClassReq | ( | struct Usb_DevData * | InstancePtr,
|  | SetupPacket * | SetupData
| ) |  |

This function is class handler for Mass storage and is called when Setup packet received is for Class request(not Standard Device request)

Parameters

  InstancePtr | is pointer to Usb_DevData instance.
  SetupData | is pointer to SetupPacket received.

Returns
  None

Note
  None.

References Usb_DevData::PrivateData.

void ParseCBW | ( | struct Usb_DevData * | InstancePtr,
|  | struct storage_if * | f
| ) |  |

This function handles Reduced Block Command (RBC) requests from the host.

Parameters

  InstancePtr | is a pointer to Usb_DevData instance of the controller.
  f | is a pointer to storage interface

Returns
  None.

Note
  None.

References IsSuperSpeed(), Usb_DevData::PrivateData, and SendCSW().

Referenced by prvSCSITask().

void prvKeyboardTask | ( | void * | pvParameters | ) |

This task implements keyboard functionality.

task will get host and act accordingly

Parameters

  pvParameters | private parameters.

Note
  None.

References Usb_DevData::PrivateData, and Usb_DevData::Speed.

void prvPlayBackTask | ( | void * | pvParameters | ) |

This task implements audio playback functionality.

Parameters

  pvParameters | private parameters.

Note
  None.

References Usb_DevData::PrivateData, and SetEpInterval().

void prvRecordTask | ( | void * | pvParameters | ) |

This task implements audio record functionality.

Parameters

  pvParameters | private parameters.

Note
  None.

References Usb_DevData::PrivateData, SetEpInterval(), and Size.

void prvSCSITask | ( | void * | pvParameters | ) |

This task implements SCSI command functionality.

task will get command from host and act accordingly

Parameters

  pvParameters | private parameters.

Note
  None.

References ParseCBW(), Usb_DevData::PrivateData, SendCSW(), and Usb_DevData::Speed.

void SendCSW | ( | struct Usb_DevData * | InstancePtr,
|  | struct storage_if * | f,
|  | u32 | Length
| ) |  |

This function is used to send SCSI Command Status Wrapper to Host.

Parameters

  InstancePtr | is pointer to Usb_DevData instance.
  Length | is the data residue.

Returns
  None

Note
  None

Parameters

  InstancePtr | is pointer to Usb_DevData instance.
  Length | is the data residue.

Returns
  None

Note

References Usb_DevData::PrivateData.

Referenced by ParseCBW(), and prvSCSITask().

void Usb_ClassReq | ( | struct Usb_DevData * | InstancePtr,
|  | SetupPacket * | SetupData
| ) |  |

This function is class request handler for composite device Setup packet received is for Class request(not a Standard Device request)

Parameters

  InstancePtr | is pointer to Usb_DevData instance.
  SetupData | is pointer to SetupPacket received.

Returns
  None

Note
  None.

This function is class request handler for composite device Setup packet received is for Class request(not a Standard Device request)

Parameters

  InstancePtr | is pointer to Usb_DevData instance.
  SetupData | is the setup packet received from Host.

Note
  None.

References Usb_DevData::PrivateData, Usb_DfuClassReq(), Usb_KeyboardClassReq(), and Usb_StorageClassReq().

void USB_DfuGetStatus | ( | struct dfu_if * | DFU,
|  | u8 * | status
| ) |  |

This function handles getting of DFU status.

Parameters

  DFU | is a pointer to DFU instance of the controller
  status | is the pointer of the DFU status

Returns
  None

Note
  None.

Parameters

  DFU | is a pointer to DFU instance of the controller
  status | is the pointer of the DFU status

Returns
  - XST_SUCCESS if the function is successful.

Note
  None.

References USB_DfuSetDwloadState().

Referenced by Usb_DfuClassReq().

void USB_DfuSetDwloadState | ( | struct dfu_if * | DFU,
|  | u8 * | status
| ) |  |

This function updates the current state while downloading a file.

Parameters

  DFU | is a pointer to DFU instance of the controller
  status | is a pointer of the DFU status

Note
  None.

Referenced by USB_DfuGetStatus().

s32 Usb_DfuSetState | ( | struct dfu_if * | DFU,
|  | u8 | dfu_state
| ) |  |

This function handles setting of DFU state.

Parameters

  DFU | is a pointer to DFU instance of the controller
  dfu_state | is a value of the DFU state to be set

Returns
  - XST_SUCCESS if the function is successful.
  - XST_FAILURE if an Error occurred.

Note
  None.

Referenced by Usb_DfuClassReq(), Usb_DfuSetIntf(), and Usb_SetIntf().

void Usb_DisconnectHandler | ( | struct Usb_DevData * | InstancePtr | ) |

This function handles USB disconnect, called from driver.

Parameters

  InstancePtr | is a pointer to Usb_DevData instance of the controller

Returns
  None.

Note
  None.

References Usb_DevData::PrivateData.

void Usb_ResetHandler | ( | struct Usb_DevData * | InstancePtr | ) |

This function handles USB reset, called from driver.

Parameters

  InstancePtr | is a pointer to Usb_DevData instance of the controller

Returns
  None.

Note
  None.

References Usb_DevData::PrivateData.

void Usb_SetIntf | ( | struct Usb_DevData * | InstancePtr,
|  | SetupPacket * | SetupData
| ) |  |

This function handles set interface request.

Parameters

  InstancePtr | is a pointer to Usb_DevData instance of the controller
  SetupData | is a pointer to setup token of control transfer

Returns
  None.

Note
  None.

References Usb_DevData::PrivateData, SetEpInterval(), and Usb_DfuSetState().