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
186 of 523
NXP Semiconductors
UM10462
Chapter 10: LPC11U3x/2x/1x USB on-chip drivers
Table 202. USBD_CDC_INIT_PARAM class structure
Member
Description
mem_base
uint32_t USBD_CDC_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_CDC_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_CDC_API::GetMemSize() routine.
cif_intf_desc
uint8_t * USBD_CDC_INIT_PARAM::cif_intf_desc
Pointer to the control interface descriptor within the descriptor array
dif_intf_desc
uint8_t * USBD_CDC_INIT_PARAM::dif_intf_desc
Pointer to the data interface descriptor within the descriptor array
CIC_GetRequest
ErrorCode_t(* USBD_CDC_INIT_PARAM::CIC_GetRequest)(USBD_HANDLE_T hHid, USB_SETUP_PACKET
*pSetup, uint8_t **pBuffer, uint16_t *length)
Communication Interface Class specific get request call-back function.
This function is provided by the application software. This function gets called when host
sends CIC management element get requests.
Remark:
Applications implementing Abstract Control Model subclass can set this param to
NULL. As the default driver parses ACM requests and calls the individual ACM call-back
routines defined in this structure. For all other subclasses this routine should be provided by
the application. The setup packet data (pSetup) is passed to the call-back so that application
can extract the CIC request type and other associated data. By default the stack will assign
pBuffer pointer to EP0Buff allocated at init. The application code can directly write data into
this buffer as long as data is less than 64 byte. If more data has to be sent then application
code should update pBuffer pointer and length accordingly.
Parameters:
1. hCdc = Handle to CDC function driver.
2. pSetup = Pointer to setup packet received from host.
3. pBuffer = Pointer to a pointer of data buffer containing request data. Pointer-to-pointer is
used to implement zero-copy buffers. See USBD_ZeroCopy for more details on
zero-copy concept.
4. length = Amount of data to be sent back to host.
Returns:
The call back should returns ErrorCode_t type to indicate success or error condition.
Return values:
1. LPC_OK = On success.
2. ERR_USBD_UNHANDLED = Event is not handled hence pass the event to next in line.
3. ERR_USBD_xxx = For other error conditions.