Streams gap-less data from Pico Technology oscilloscope drivers.
This is a sub crate that you probably don't want to use directly. Try the top level
pico-sdk
crate which exposes everything from here.
Once streaming is started, a PicoStreamingDevice
returns StreamingEvent
s. The possible events
and Connected
, Disconnected
and Data
. The Data
event contains raw Vec<i16>
samples for
each enabled channel that can easily be scaled to the channel units (ie. Volts, Amps, etc).
```rust // Get a streaming device from a PicoDevice let streamdevice = device.intostreaming_device();
// Enable and configure 2 channels streamdevice.enablechannel(PicoChannel::A, PicoRange::X1PROBE2V, PicoCoupling::DC); streamdevice.enablechannel(PicoChannel::B, PicoRange::X1PROBE1V, PicoCoupling::AC);
struct StdoutHandler;
impl NewDataHandler for StdoutHandler { fn handle_event(&self, event: &StreamingEvent) { println!("Sample count: {}", event.length); } }
let handler = Arc::new(StdoutHandler);
// Subscribe to streaming events streamdevice.newdata.subscribe(handler);
// Start streaming with a sample rate of 1k streamdevice.start(1000)?; ```
License: MIT