FleaScope RS
Fast Rust library for FleaScope oscilloscope devices. High-performance data acquisition with dual probes, digital/analog triggers, and automatic calibration.
Perks
- Fearless state handling, guarded by type states
- read_async for cancellable reads
- Cross-Platform: Better device discovery and serial communication across Windows/Linux/macOS.
- Output as Polars frames
Quick Start
Connect and read data in just a few lines:
use ;
use Duration;
// Connect and acquire data
let mut = connect?;
let trigger_config = start_capturing_when
.is_matching
.into_trigger_fields?;
let = scope.read_sync?;
let uncalibrated_frame : LazyFrame = parse_csv;
let calibrated_frame = x1.apply_calibration
println!;
Device Discovery
use FleaConnector;
let devices = get_available_devices?;
for device in devices.take
Triggers
Digital Triggers - Pattern matching on 9 bits:
use ;
let trigger = start_capturing_when
.bit0
.bit1
.bit2
.starts_matching;
let data = scope.read_sync?;
Analog Triggers - Edge and level detection:
use AnalogTrigger;
let trigger = start_capturing_when.rising_edge;
let data = scope.read_sync?;
Calibration
let mut = connect?;
// Connect probe to ground, then 3.3V
let zero_value = x1.calibrate_0?;
let full_scale = x1.calibrate_3v3?;
x1.write_calibration_to_flash?; // Save to device
API Overview
Data Output:
All methods return polars::DataFrame with:
time- Time in seconds from triggerbnc- Voltage values (auto-converted from ADC)bitmap- Digital bit values (hex string)
Use IdleFleaScope::extract_bits() to convert bitmap to individual bit columns.
Related Projects
- Live monitor GUI https://github.com/daniel-freiermuth/fleascope-monitor-rs
- Sibling project in python https://github.com/daniel-freiermuth/pyfleascope