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
187 of 523
NXP Semiconductors
UM10462
Chapter 10: LPC11U3x/2x/1x USB on-chip drivers
CIC_SetRequest
ErrorCode_t(* USBD_CDC_INIT_PARAM::CIC_SetRequest)(USBD_HANDLE_T hCdc, USB_SETUP_PACKET
*pSetup, uint8_t **pBuffer, uint16_t length)
Communication Interface Class specific set request call-back function.
This function is provided by the application software. This function gets called when host
sends a CIC management element 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. If a set request has data
associated, then this call-back is called twice. (1) First when setup request is received, at this
time application code could update pBuffer pointer to point to the intended destination. The
length param is set to 0 so that application code knows this is first time. By default the stack
will assign pBuffer pointer to EP0Buff allocated at init. Note, if data length is greater than 64
bytes and application code doesn't update pBuffer pointer the stack will send STALL
condition to host. (2) Second when the data is received from the host. This time the length
param is set with number of data bytes received.
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 copied to destination buffer.
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.
CDC_BulkIN_Hdlr
ErrorCode_t(* USBD_CDC_INIT_PARAM::CDC_BulkIN_Hdlr)(USBD_HANDLE_T hUsb, void *data, uint32_t
event)
Communication Device Class specific BULK IN endpoint handler.
The application software should provide the BULK IN endpoint handler. Applications should
transfer data depending on the communication protocol type set in descriptors.
Remark:
Parameters:
1. hUsb = Handle to the USB device stack.
2. data = Pointer to the data which will be passed when callback function is called by the
stack.
3. event = Type of endpoint event. See USBD_EVENT_T for more details.
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.
Table 202. USBD_CDC_INIT_PARAM class structure
Member
Description