Struct max170xx::Max17044

source ·
pub struct Max17044<I2C> { /* private fields */ }
Expand description

Device driver

Implementations§

source§

impl<I2C, E> Max17044<I2C>
where I2C: I2c<Error = E>,

source

pub fn new(i2c: I2C) -> Self

Create new instance of the device.

source

pub fn destroy(self) -> I2C

Destroy driver instance, return I2C bus.

source

pub fn quickstart(&mut self) -> Result<(), Error<E>>

Quick start

Restarts fuel-gauge calculations in the same manner as initial power-up of the IC. This is useful if an application’s power-up sequence is exceedingly noisy

source

pub fn version(&mut self) -> Result<u16, Error<E>>

Get IC version

source§

impl<I2C, E> Max17044<I2C>
where I2C: I2c<Error = E>,

source

pub fn soc(&mut self) -> Result<f32, Error<E>>

Get state of charge of the cell as calculated by the ModelGauge algorithm as a percentage.

source

pub fn reset(&mut self) -> Result<(), Error<E>>

Software reset

source§

impl<I2C, E> Max17044<I2C>
where I2C: I2c<Error = E>,

source

pub fn voltage(&mut self) -> Result<f32, Error<E>>

Get battery voltage

Trait Implementations§

source§

impl<I2C: Debug> Debug for Max17044<I2C>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<I2C> Freeze for Max17044<I2C>
where I2C: Freeze,

§

impl<I2C> RefUnwindSafe for Max17044<I2C>
where I2C: RefUnwindSafe,

§

impl<I2C> Send for Max17044<I2C>
where I2C: Send,

§

impl<I2C> Sync for Max17044<I2C>
where I2C: Sync,

§

impl<I2C> Unpin for Max17044<I2C>
where I2C: Unpin,

§

impl<I2C> UnwindSafe for Max17044<I2C>
where I2C: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.