pub struct INA260<I2C> { /* private fields */ }
Implementations§
source§impl<I2C, E> INA260<I2C>where
I2C: WriteRead<Error = E> + Write<Error = E>,
impl<I2C, E> INA260<I2C>where
I2C: WriteRead<Error = E> + Write<Error = E>,
sourcepub fn new(i2c: I2C, address: u8) -> Result<Self, E>
pub fn new(i2c: I2C, address: u8) -> Result<Self, E>
Add a new driver for a INA260 chip found on the I2C bus at the specified address
sourcepub fn release(self) -> I2C
pub fn release(self) -> I2C
Put the INA260 chip managed by the driver in shut down and release I2C resource
sourcepub fn set_averaging_mode(&mut self, a: Averaging) -> Result<(), E>
pub fn set_averaging_mode(&mut self, a: Averaging) -> Result<(), E>
Change the averaging mode of the INA260
sourcepub fn set_operating_mode(&mut self, o: OperMode) -> Result<(), E>
pub fn set_operating_mode(&mut self, o: OperMode) -> Result<(), E>
Change the operating mode of the INA260. Please note that if you change to Triggered mode, you’ll have to call this method again each time you would like to get a new sample.
sourcepub fn set_scconvtime_mode(&mut self, s: SCConvTime) -> Result<(), E>
pub fn set_scconvtime_mode(&mut self, s: SCConvTime) -> Result<(), E>
Change the shut current conversion time
sourcepub fn set_bvconvtime_mode(&mut self, b: BVConvTime) -> Result<(), E>
pub fn set_bvconvtime_mode(&mut self, b: BVConvTime) -> Result<(), E>
Change the bus voltage conversion time
sourcepub fn current_raw(&mut self) -> Result<i16, E>
pub fn current_raw(&mut self) -> Result<i16, E>
Delivers the measured raw current in 1.25mA per bit
sourcepub fn current_split(&mut self) -> Result<(i8, u32), E>
pub fn current_split(&mut self) -> Result<(i8, u32), E>
Delivers the measured current in as tuple of full volts and tenth millivolts
sourcepub fn voltage_raw(&mut self) -> Result<u16, E>
pub fn voltage_raw(&mut self) -> Result<u16, E>
Delivers the measured raw voltage in 1.25mV per bit
sourcepub fn voltage_split(&mut self) -> Result<(u8, u32), E>
pub fn voltage_split(&mut self) -> Result<(u8, u32), E>
Delivers the measured voltage in as tuple of full volts and tenth millivolts
sourcepub fn power_split(&mut self) -> Result<(u8, u32), E>
pub fn power_split(&mut self) -> Result<(u8, u32), E>
Delivers the measured power in as tuple of full volts and tenth millivolts