usbpsu: xusb_class_dfu.c File Reference

| usbpsu Xilinx SDK Drivers API Documentation

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

Functions
xusb_class_dfu.c File Reference

## Overview

This file contains the implementation of the DFU specific class code for the example.

      MODIFICATION HISTORY:

      Ver   Who  Date     Changes

      1.0    vak  30/11/16 Added DFU support
      1.4    BK   12/01/18 Renamed the file to be in sync with usb common code
                           changes for all USB IPs
      1.5    vak  13/02/19 Added support for versal

    *

## 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...
s32 | USB_DfuGetStatus (struct dfu_if *DFU, u8 *status)
| This function handles getting of DFU status. More...
void | Usb_DfuDisconnect (struct Usb_DevData *InstancePtr)
| This function handles DFU disconnect, called from driver. More...
void | Usb_DfuReset (struct Usb_DevData *InstancePtr)
| This function handles DFU reset, called from driver. More...
void | Usb_DfuSetIntf (struct Usb_DevData *InstancePtr, SetupPacket *SetupData)
| This function handles DFU set interface. More...
void | Usb_DfuClassReq (struct Usb_DevData *InstancePtr, SetupPacket *SetupData)
| This function handles DFU heart and soul of DFU state machine. More...

## Function Documentation

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

This function handles DFU heart and soul of DFU state machine.

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_DfuClassReq(), USB_DfuGetStatus(), and Usb_DfuSetState().

Referenced by Usb_ClassReq(), and Usb_DfuClassReq().

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

This function handles DFU disconnect, called from driver.

Parameters

  InstancePtr | is a pointer to Usb_DevData instance of the controller

Returns
  None.

Note
  None.

s32 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
  - XST_SUCCESS if the function is successful.

Note
  None.

References USB_DfuSetDwloadState().

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

This function handles DFU reset, called from driver.

Parameters

  InstancePtr | is a pointer to Usb_DevData instance of the controller

Returns
  None.

Note
  None.

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.

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

This function handles DFU set interface.

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_DfuSetState().

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.