extern crate serial2; use serial2::SerialPort; use std::time::Duration; fn main() { let mut port = SerialPort::open("/dev/pts/6", 115200).unwrap(); SerialPort::set_read_timeout(&mut port, Duration::from_millis(10000)).unwrap(); // SerialPort::discard_buffers(&mut port).unwrap...
it uses multiple I/O ports for programming different device registers. The unsafeSerialPort::newfunction expects the address of the first I/O port of the UART as an argument, from which it can calculate the addresses of all needed ports. We’re passing the port address0x...