![NXP Semiconductors LPC43Sxx Скачать руководство пользователя страница 783](http://html1.mh-extra.com/html/nxp-semiconductors/lpc43sxx/lpc43sxx_user-manual_1721827783.webp)
UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2015. All rights reserved.
User manual
Rev. 2.1 — 10 December 2015
783 of 1441
NXP Semiconductors
UM10503
Chapter 27: LPC43xx/LPC43Sxx USB API
27.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.
hUsbHandle to the USB device stack. paramStructure containing CDC function driver module
initialization parameters.
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 usbcdc11.pdf,
section 6.3, Table 67 for various notification types the CDC device can send.
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. See usbcdc11.pdf, section 3.6.2.1, table 5.
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 usbcdc11.pdf, section 6.3.5, Table 69.
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 589. USBD_CDC_API class structure
Member
Description