Datasheet

g_CdcVcomDicInterfaceIndex g_CdcVcomCicInterfaceIndex,
g_CdcVcomBulkInPacketSize, g_CdcVcomBulkOutPacketSize array.
These arrays are only used to simplify the initialization of each endpoint in the
USB_DeviceCdcVcomSetConfigure() function.
NOTE
Modify the initialization process for the interrupt endpoint in each CDC class in the USB_DeviceCdcVcomSetConfigure() function.
if (USB_COMPOSITE_CONFIGURE_INDEX == configure)
{
for ( uint8_t i = 0; i < USB_DEVICE_CONFIG_CDC_ACM; i++)
{
/****** Initiailizecdc endpoint *****/
g_deviceComposite-> cdcVcom [i]. attach = 1;
#if USB_CDC_CIC_INTERRUPT_IN_ENDPOINT_ENABLE
/* Initiailizeendpoint for interrupt pipe */
epCallback.callbackFn = USB_DeviceCdcAcmInterruptIn;
epCallback.callbackParam = (void
*)&g_deviceComposite->cdcVcom[i].communicationInterfaceNumber;
epInitStruct.zlt = 0;
epInitStruct.transferType = USB_ENDPOINT_INTERRUPT;
epInitStruct.endpointAddress =
g_CdcVcomCicInterruptInEndpoint[i] | (USB_IN <<
USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_SHIFT);
epInitStruct.maxPacketSize = FS_CDC_VCOM_INTERRUPT_IN_PACKET_SIZE;
epInitStruct.interval = FS_CDC_VCOM_INTERRUPT_IN_INTERVAL;
g_deviceComposite->cdcVcom[i].interruptEndpoint =
g_CdcVcomCicInterruptInEndpoint[i];
g_deviceComposite->cdcVcom[i].interruptEndpointMaxPacketSize =
epInitStruct.maxPacketSize;
g_deviceComposite->cdcVcom[i].communicationInterfaceNumber =
g_CdcVcomCicInterfaceIndex[i];
USB_DeviceInitEndpoint(handle, &epInitStruct, &epCallback);
#else
g_deviceComposite-> cdcVcom [i]. communicationInterfaceNumber =
g_CdcVcomCicInterfaceIndex[i];
#endif
Do not delete the following content
g_deviceComposite->cdcVcom[i].communicationInterfaceNumber =
USB_CDC_VCOM_CIC_INTERFACE_INDEX;
. To see the complete code, refer to AN12597SW.
NOTE
6.3 Code optimization
The steps in Sections 6.1 and 6.2 are a bit complicated. Users need to have some understanding of the USB protocol stack. If
there is a step error, it may cause the function to fail. For each additional VCOM, users need to repeat the steps in Section 6.1.
To make the process more convenient to use the function of VCOM, some optimizations are made on the code based on section
6.1 and 6.2, which makes it easy for users to configure the number of VCOM and to decide whether to use the interrupt IN endpoint
in CIC interface through macro definition.
NXP Semiconductors
Key Steps
USB to Multi VCOM on K32L2 Series MCU, Rev. 0, November 2019
Application Note 18 / 25