pub struct ADCSensorConfig {
    name: String,
    index: u64,
    poll_interval: Duration,
    scale: f64,
    power_state: PowerState,
    thresholds: Vec<ThresholdConfig>,
    bridge_gpio: Option<Arc<BridgeGPIOConfig>>,
}
Expand description

Internal representation of the dbus config data for an ADC sensor (one channel).

Fields

name: String

Sensor name.

index: u64

Index of this sensor (channel) within the ADC hardware device.

poll_interval: Duration

Polling interval for the sensor.

scale: f64

Scaling multiplier for the sensor.

We store this as the reciprocal of what was provided via the dbus config so that we can multiply instead of dividing

power_state: PowerState

Host power state in which this sensor is active.

thresholds: Vec<ThresholdConfig>

Threshold settings for the sensor.

bridge_gpio: Option<Arc<BridgeGPIOConfig>>

An optional GPIO that must be asserted before reading the sensor.

Common for battery voltage sensors to reduce parasitic battery drain.

Implementations

Construct an ADCSensorConfig from raw dbus config data.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.