#sprig #hackclub #read-write #spade

spade-serial

Communications with Sprig devices over serial port

1 unstable release

0.1.0 Dec 8, 2024

#464 in Hardware support

Download history 131/week @ 2024-12-02 37/week @ 2024-12-09

168 downloads per month
Used in spade-upload

MIT license

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 + Writer 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);

No runtime deps