1 unstable release
Uses new Rust 2024
| 0.1.0 | Jun 27, 2025 |
|---|
#354 in Science
60KB
1.5K
SLoC
SFC6XXX-rs
This libraray is meant to provide an platform independant rust driver for Sensirion's SFC6xxx mass flow controllers. The code was based arround the official python SHDLC library and should match match its interface, while using Rust's powerful Result type.
Testing
Several tests have been written to tests this library's functionality and a majority of them are in device.rs. Most test reads and checks values but several functions like get_serial_number and get_article_code cannot be accuratley tested. In these cases the code checks to see if the response errored and nothing else.
SFC6xxx-rs
A pure rust implementation of the SHDLC driver for Sensirions SFC6xxx mass flow controllers. The api was made to model the official python library, while adding rust best practices. The bare minimum code needed to get started looks like:
let port = serialport::new("/dev/ttyUSB0", 115200).open_native().unwrap();
let mut device = Device::new(port, 0).unwrap();
// set the devices flow rate
device.set_setpoint(4).unwrap();
// read in the measured value of the device
device.read_measured_value();
Testing
All device functions have an associated test that were passing on a SFC6000D-5slm
Dependencies
~2–13MB
~99K SLoC