eclipse-threadx / usbx

Eclipse ThreadX - USBX is a high-performance USB host, device, and on-the-go (OTG) embedded stack, that is fully integrated with Eclipse ThreadX RTOS
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/usbx/index.md
MIT License
157 stars 93 forks source link

Change baudrate for prolific host class #112

Open PiPointX opened 1 year ago

PiPointX commented 1 year ago

Is your feature request related to a problem? Please describe. I'm using a prolific PL2303 and I would like to set the baudrate to 921600. I've seen that in the file ux_host_class_prolific.h the default-value is set to 19200 with a define. But with no possibility to change.

Describe the solution you'd like It would be best, if the baudrate could be set with a define in the ux_user.h. Therefor in ux_host_class_prolific.h only the following has to be made:

#ifndef UX_HOST_CLASS_PROLIFIC_LINE_CODING_DEFAULT_RATE
#define UX_HOST_CLASS_PROLIFIC_LINE_CODING_DEFAULT_RATE 19200
#endif

Then in ux_user.h the define UX_HOST_CLASS_PROLIFIC_LINE_CODING_DEFAULT_RATE could be set by the user

xiaocq2001 commented 1 year ago

Thanks for the suggestion.

Currently you can try to change rate by ux_host_class_prolific_ioctl with code UX_HOST_CLASS_PROLIFIC_IOCTL_SET_LINE_CODING.