![NXP Semiconductors LCP43 Series User Manual Download Page 643](http://html1.mh-extra.com/html/nxp-semiconductors/lcp43-series/lcp43-series_user-manual_1721817643.webp)
UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2012. All rights reserved.
User manual
Rev. 1.3 — 6 July 2012
643 of 1269
NXP Semiconductors
UM10503
Chapter 25: LPC43xx USB API
25.5.28 USBD_CDC_INIT_PARAM
Communication Device Class function driver initialization parameter data structure.
init
ErrorCode_t(*ErrorCode_t USBD_CDC_API::init)(USBD_HANDLE_T hUsb, USBD_CDC_INIT_PARAM_T *param,
USBD_HANDLE_T *phCDC)
Function to initialize CDC function driver module.
This function is called by application layer to initialize CDC function driver module.
Parameters:
1. hUsb = Handle to the USB device stack.
2. param = Structure containing CDC 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 CDC_Write() or CDC_Read() or CDC_Verify() callbacks
are not defined.
4. ERR_USBD_BAD_INTF_DESC = Wrong interface descriptor is passed.
5. ERR_USBD_BAD_EP_DESC = Wrong endpoint descriptor is passed.
SendNotification
ErrorCode_t(*ErrorCode_t USBD_CDC_API::SendNotification)(USBD_HANDLE_T hCdc, uint8_t bNotification, uint16_t
data)
Function to send CDC class notifications to host.
This function is called by application layer to send CDC class notifications to host. See the
USB CDC
class specification document
published by usb.org.
Remark:
The current version of the driver only supports following notifications allowed by ACM
subclass: CDC_NOTIFICATION_NETWORK_CONNECTION, CDC_RESPONSE_AVAILABLE,
CDC_NOTIFICATION_SERIAL_STATE. For all other notifications application should construct the
notification buffer appropriately and call hw->USB_WriteEP() for interrupt endpoint associated with the
interface.
Parameters:
1. hCdc = Handle to CDC function driver.
2. bNotification = Notification type allowed by ACM subclass. Should be
CDC_NOTIFICATION_NETWORK_CONNECTION, CDC_RESPONSE_AVAILABLE or
CDC_NOTIFICATION_SERIAL_STATE. For all other types ERR_API_INVALID_PARAM2 is
returned.
3. data = Data associated with notification. For CDC_NOTIFICATION_NETWORK_CONNECTION
a non-zero data value is interpreted as connected state. For CDC_RESPONSE_AVAILABLE
this parameter is ignored. For CDC_NOTIFICATION_SERIAL_STATE the data should use
bitmap values defined in the
USB CDC class specification document
published by usb.org..
Returns:
Returns ErrorCode_t type to indicate success or error condition.
Return values:
1. LPC_OK = On success
2. ERR_API_INVALID_PARAM2 = If unsupported notification type is passed.
Table 519. USBD_CDC_API class structure
Member
Description