lager-net 0.2.0

First-class Rust client for Lager box nets: drive power supplies, batteries, e-loads, GPIO, ADC, DAC, SPI, I2C, UART and more from cargo tests.
Documentation
//! ADC nets: analog voltage reads.

use super::net_handle;

pub(crate) mod ops {
    use serde_json::json;

    use crate::wire::{net_command, value_f64, Op, Timeout};

    pub(crate) fn read(name: &str) -> Op<f64> {
        Op {
            req: net_command(name, "adc", "read", json!({}), Timeout::Default),
            parse: value_f64,
        }
    }
}

net_handle! {
    /// Handle for an ADC net.
    sync: Adc,
    async: AsyncAdc,
    methods: {
        /// Read the input voltage in volts.
        fn read() -> f64 = ops::read;
    }
}