#streaming #oscilloscope #pico-scope #pico-technology

pico-streaming

Unofficial Rust bindings and wrappers for Pico Technology oscilloscope drivers

7 releases

0.3.1 May 12, 2021
0.3.0 Apr 14, 2021
0.2.1 Mar 26, 2021
0.1.4 Nov 18, 2020

#1661 in Hardware support

Download history 11/week @ 2024-02-26 1/week @ 2024-03-04 11/week @ 2024-03-11 80/week @ 2024-04-01

91 downloads per month
Used in pico-sdk

MIT license

215KB
5K SLoC

pico-streaming

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 StreamingEvents. 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).

Example

// Get a streaming device from a PicoDevice
let stream_device = device.into_streaming_device();

// Enable and configure 2 channels
stream_device.enable_channel(PicoChannel::A, PicoRange::X1_PROBE_2V, PicoCoupling::DC);
stream_device.enable_channel(PicoChannel::B, PicoRange::X1_PROBE_1V, 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
stream_device.new_data.subscribe(handler);

// Start streaming with a sample rate of 1k
stream_device.start(1_000)?;

License: MIT

Dependencies

~2.6–3.5MB
~72K SLoC