使用的芯片是ch340,下载最新的驱动CH341SER_LINUX.ZIP编译加载后出现ttyUSB0设备,对ttyUSB0设备进行操作,发现设备波特率被默认设置为19200,修改ch34x_attach函数中的这部分代码可以改变波特率的:
ch34x_vendor_read( VENDOR_VERSION, 0x0000, 0x0000, serial, buf, 0x02 ); ch34x_vendor_write( VENDOR_SERIAL_INIT, 0x0000, 0x0000, serial, NULL, 0x00 ); ch34x_vendor_write( VENDOR_WRITE, 0x1312, 0xD982, serial, NULL, 0x00 ); ch34x_vendor_write( VENDOR_WRITE, 0x0F2C, 0x0004, serial, NULL, 0x00 ); ch34x_vendor_read( VENDOR_READ, 0x2518, 0x0000, serial, buf, 0x02 ); ch34x_vendor_write( VENDOR_WRITE, 0x2727, 0x0000, serial, NULL, 0x00 ); ch34x_vendor_write( VENDOR_MODEM_OUT, 0x009F, 0x0000, serial, NULL, 0x00 );
但是无法修改奇偶校验等配置,追踪ch34x_set_termios函数,发现按函数中的参数配置了确没有效果。
请问有没有配置这些参数的文档?