1 unstable release
0.1.0 | Dec 8, 2024 |
---|
#464 in Hardware support
168 downloads per month
Used in spade-upload
13KB
222 lines
Communication with devices running Spade.
Issues commands to a device running Spade over a provided serial port. It can be used to upload games and check if the device is running a legacy Spade version. This crate is not thread safe.
First, get a Read + Write
r for the serial port connected to the device.
You can do this by using the
serialport crate; this example uses
the device at /dev/cu.usbmodem14101
.
use std::time::Duration;
let mut port = serialport::new("/dev/cu.usbmodem14101", 115200)
.timeout(Duration::from_millis(1000))
.open()?;
Then, pass it to methods in this crate.
#
let legacy = spade_serial::is_running_legacy(&mut port).unwrap_or(false);