| USBD ROM Stack 1.0 ROM based USB device stack

Data Fields
USBD_DFU_API_T Struct Reference
Device Firmware Upgrade (DFU) Class Function Driver

DFU class API functions structure.This module exposes functions which interact directly with USB device controller hardware. More...

`#include <mw_usbd/mw_usbd_dfuuser.h>`

## Data Fields
uint32_t(* | GetMemSize )(USBD_DFU_INIT_PARAM_T *param)
ErrorCode_t(* | init )(USBD_HANDLE_T hUsb, USBD_DFU_INIT_PARAM_T *param, uint32_t init_state)

## Detailed Description

DFU class API functions structure.

This module exposes functions which interact directly with USB device controller hardware.

## Field Documentation

## ◆ GetMemSize

uint32_t USBD_DFU_API_T::GetMemSize

Function to determine the memory required by the DFU function driver module.

This function is called by application layer before calling pUsbApi->dfu->Init(), to allocate memory used by DFU function driver module. The application should allocate the memory which is accessible by USB controller/DMA controller.

Note
  Some memory areas are not accessible by all bus masters.

Parameters

  [in] | param | Structure containing DFU function driver module initialization parameters.

Returns
  Returns the required memory size in bytes.

## ◆ init

ErrorCode_t USBD_DFU_API_T::init

Function to initialize DFU function driver module.

This function is called by application layer to initialize DFU function driver module.

Parameters

  [in] | hUsb | Handle to the USB device stack.
  [in,out] | param | Structure containing DFU function driver module initialization parameters.

Returns
  Returns ErrorCode_t type to indicate success or error condition.

Return values

  LPC_OK | On success
  ERR_USBD_BAD_MEM_BUF | Memory buffer passed is not 4-byte aligned or smaller than required.
  ERR_API_INVALID_PARAM2 | Either DFU_Write() or DFU_Done() or DFU_Read() call-backs are not defined.
  ERR_USBD_BAD_DESC | USB_DFU_DESCRIPTOR_TYPE is not defined immediately after interface descriptor. wTransferSize in descriptor doesn't match the value passed in param->wTransferSize. DFU_Detach() is not defined while USB_DFU_WILL_DETACH is set in DFU descriptor.
  ERR_USBD_BAD_INTF_DESC | Wrong interface descriptor is passed.

The documentation for this struct was generated from the following file:

- mw_usbd/mw_usbd_dfuuser.h