UM10462
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2016. All rights reserved.
User manual
Rev. 5.5 — 21 December 2016
198 of 523
NXP Semiconductors
UM10462
Chapter 10: LPC11U3x/2x/1x USB on-chip drivers
10.5.31 USBD_DFU_INIT_PARAM
USB descriptors data structure.
Table 204. USBD_DFU_API class structure
Member
Description
GetMemSize
uint32_t(*uint32_t USBD_DFU_API::GetMemSize)(USBD_DFU_INIT_PARAM_T *param)
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.
Remark:
Some memory areas are not accessible by all bus masters.
Parameters:
1. param = Structure containing DFU function driver module initialization parameters.
Returns:
Returns the required memory size in bytes.
init
ErrorCode_t(*ErrorCode_t USBD_DFU_API::init)(USBD_HANDLE_T hUsb, USBD_DFU_INIT_PARAM_T *param, uint32_t
init_state)
Function to initialize DFU function driver module.
This function is called by application layer to initialize DFU function driver module.
Parameters:
1. hUsb = Handle to the USB device stack.
2. param = Structure containing DFU function driver module initialization parameters.
Returns:
Returns ErrorCode_t type to indicate success or error condition.
Return values:
1. LPC_OK = On success
2. ERR_USBD_BAD_MEM_BUF = Memory buffer passed is not 4-byte aligned or smaller than
required.
3. ERR_API_INVALID_PARAM2 = Either DFU_Write() or DFU_Done() or DFU_Read() callbacks are
not defined.
4. 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.
5. ERR_USBD_BAD_INTF_DESC = Wrong interface descriptor is passed.
Table 205. USBD_DFU_INIT_PARAM class structure
Member
Description
mem_base
uint32_t USBD_DFU_INIT_PARAM::mem_base
Base memory location from where the stack can allocate data and buffers.
Remark:
The memory address set in this field should be accessible by USB DMA controller. Also this
value should be aligned on 4 byte boundary.
mem_size
uint32_t USBD_DFU_INIT_PARAM::mem_size
The size of memory buffer which stack can use.
Remark:
The mem_size should be greater than the size returned by USBD_DFU_API::GetMemSize()
routine.