使用的芯片是ch340,下載最新的驅(qū)動(dòng)CH341SER_LINUX.ZIP編譯加載后出現(xiàn)ttyUSB0設(shè)備,對(duì)ttyUSB0設(shè)備進(jìn)行操作,發(fā)現(xiàn)設(shè)備波特率被默認(rèn)設(shè)置為19200,修改ch34x_attach函數(shù)中的這部分代碼可以改變波特率的:
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?);
但是無(wú)法修改奇偶校驗(yàn)等配置,追蹤ch34x_set_termios函數(shù),發(fā)現(xiàn)按函數(shù)中的參數(shù)配置了確沒有效果。
請(qǐng)問有沒有配置這些參數(shù)的文檔?