use super::{Channel, Error};
pub trait PowerMeasurementInterface {
fn sample_converter(&mut self, channel: Channel) -> Result<f32, Error>;
fn measure_power(&mut self, channel: Channel) -> Result<f32, Error> {
let analog_measurement = self.sample_converter(channel)?;
Ok(analog_measurement * (1. / 0.0517) + (-58. + 20.))
}
}