Struct Axp192Async

Source
pub struct Axp192Async<I2CImpl: RegisterInterface<AddressType = u8, Error = AxpError<I2CBusErr>>, I2CBusErr: Debug = <I2CImpl as RegisterInterface>::Error> {
    pub ll: AxpLowLevel<I2CImpl>,
    /* private fields */
}

Fields§

§ll: AxpLowLevel<I2CImpl>

Implementations§

Source§

impl<I2CBus, E> Axp192<AxpInterface<I2CBus>, E>
where I2CBus: I2c<Error = E>, E: Debug,

Source

pub fn new(i2c: I2CBus) -> Self

Source§

impl<I2CImpl, I2CBusErr> Axp192<I2CImpl, I2CBusErr>
where I2CImpl: CurrentAxpDriverInterface<I2CBusErr>, I2CBusErr: Debug,

Source

pub async fn get_battery_voltage_mv( &mut self, ) -> Result<f32, AxpError<I2CBusErr>>

Source

pub async fn get_battery_charge_current_ma( &mut self, ) -> Result<f32, AxpError<I2CBusErr>>

Source

pub async fn get_battery_instantaneous_power_uw( &mut self, ) -> Result<f32, AxpError<I2CBusErr>>

Source

pub async fn set_dcdc_enable( &mut self, dc: DcId, enable: bool, ) -> Result<(), AxpError<I2CBusErr>>

Source

pub async fn set_dcdc_voltage( &mut self, dc: DcId, voltage_mv: u16, ) -> Result<(), AxpError<I2CBusErr>>

Source

pub async fn set_ldo_voltage_mv( &mut self, ldo: LdoId, voltage_mv: u16, ) -> Result<(), AxpError<I2CBusErr>>

Source

pub async fn set_gpio0_ldo_voltage_mv( &mut self, voltage_mv: u16, ) -> Result<(), AxpError<I2CBusErr>>

Source

pub async fn set_battery_charge_high_temp_threshold_mv( &mut self, threshold_mv: u16, ) -> Result<(), AxpError<I2CBusErr>>

Source

pub async fn set_battery_charge_low_temp_threshold_mv( &mut self, threshold_mv: u16, ) -> Result<(), AxpError<I2CBusErr>>

Auto Trait Implementations§

§

impl<I2CImpl, I2CBusErr> Freeze for Axp192<I2CImpl, I2CBusErr>
where I2CImpl: Freeze,

§

impl<I2CImpl, I2CBusErr> RefUnwindSafe for Axp192<I2CImpl, I2CBusErr>
where I2CImpl: RefUnwindSafe, I2CBusErr: RefUnwindSafe,

§

impl<I2CImpl, I2CBusErr> Send for Axp192<I2CImpl, I2CBusErr>
where I2CImpl: Send, I2CBusErr: Send,

§

impl<I2CImpl, I2CBusErr> Sync for Axp192<I2CImpl, I2CBusErr>
where I2CImpl: Sync, I2CBusErr: Sync,

§

impl<I2CImpl, I2CBusErr> Unpin for Axp192<I2CImpl, I2CBusErr>
where I2CImpl: Unpin, I2CBusErr: Unpin,

§

impl<I2CImpl, I2CBusErr> UnwindSafe for Axp192<I2CImpl, I2CBusErr>
where I2CImpl: UnwindSafe, I2CBusErr: 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>,

Source§

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>,

Source§

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.