USB_DeviceCdcAcmSend, value of class handle (class_handle_t) on LPC55s69

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

USB_DeviceCdcAcmSend, value of class handle (class_handle_t) on LPC55s69

跳至解决方案
1,085 次查看
gertvb
Contributor III

Good Day Everyone!

Not a problem, just a minor question

I am using 2X VCom ports on the USB Full speed adapter USB0 on the LPC55s69

Ive created the 2 ports with MCUXpresso Configtools and use USB_DeviceCdcAcmSend to write data back to 2 TeraTerm instances from the main loop - and everything works fine!

 

I just want to find out if the value for class_handle_t as used in USB_DeviceCdcAcmSend is exposed in a header file somewhere?

 

Currently I am using :0x40101580 and 0x401015e8 as hardcoded magic numbers as parameters to USB_DeviceCdcAcmSend, and although it works fine, I would rather use the data structures as used in the USB system, but I am unable to to find any exposed in a header file somewhere

Thanks

A TechExplorer working with Embedded Software and Electronics in Agriculture and Alternative Energy
标签 (1)
0 项奖励
1 解答
1,064 次查看
gertvb
Contributor III

Thanks for the reply! Much appreciated

Got it working properly by referencing "g_UsbDeviceComposite" as declared in usb_device_composite.c

 

usb_device_composite_struct_t *ptr_UsbDeviceComposite;
ptr_UsbDeviceComposite = &g_UsbDeviceComposite;

USB_DeviceCdcAcmSend(ptr_UsbDeviceComposite->interface0CicVcomHandle, 2, s_VCom_Send_Buffer, i_Size_VCom_Send_Buffer);

A TechExplorer working with Embedded Software and Electronics in Agriculture and Alternative Energy

在原帖中查看解决方案

0 项奖励
2 回复数
1,065 次查看
gertvb
Contributor III

Thanks for the reply! Much appreciated

Got it working properly by referencing "g_UsbDeviceComposite" as declared in usb_device_composite.c

 

usb_device_composite_struct_t *ptr_UsbDeviceComposite;
ptr_UsbDeviceComposite = &g_UsbDeviceComposite;

USB_DeviceCdcAcmSend(ptr_UsbDeviceComposite->interface0CicVcomHandle, 2, s_VCom_Send_Buffer, i_Size_VCom_Send_Buffer);

A TechExplorer working with Embedded Software and Electronics in Agriculture and Alternative Energy
0 项奖励
1,070 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

I don't suggest you use hardcode as parameter because it causes your code not flexible.

You can refer MCUXpresso SDK cdc demo code to mange yours code.

regarding to your hardcode 0x40101580 ,  I suggest you check g_cdcAcmHandle, this structure should defined at this address.