[][src]Struct bq24195_i2c::ChargerState

pub struct ChargerState { /* fields omitted */ }

BQ24195 state, as viewed from I2C

Methods

impl ChargerState[src]

pub fn try_new<E, I2C: WriteRead<Error = E>>(i2c: &mut I2C) -> Result<Self, E>[src]

Create a new ChargerState struct by reading all registers over I2C

Default is NOT implemented for ChargerState because some registers do not actually have a default

pub fn read_all<E, I2C: WriteRead<Error = E>>(
    &mut self,
    i2c: &mut I2C
) -> Result<(), E>
[src]

Read all registers to set the current state of BQ24195.

pub fn write_all<E, I2C: Write<Error = E>>(
    &self,
    i2c: &mut I2C
) -> Result<(), E>
[src]

Write chip state to all registers. Useful for taking a preset chip state and applying it.

Relevant BQ24195 Datasheet Section

pub fn get_input_source_control(&self) -> InputSourceControl[src]

Get a register state from the current chip state. Does NOT do an I2C call.

pub fn read_input_source_control<E, I2C: WriteRead<Error = E>>(
    &mut self,
    i2c: &mut I2C
) -> Result<(), E>
[src]

Read the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn write_input_source_control<E, I2C: Write<Error = E>>(
    &mut self,
    i2c: &mut I2C,
    input_source_control: InputSourceControl
) -> Result<(), E>
[src]

Write the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn get_power_on_configuration(&self) -> PowerOnConfiguration[src]

Get a register state from the current chip state. Does NOT do an I2C call.

pub fn read_power_on_configuration<E, I2C: WriteRead<Error = E>>(
    &mut self,
    i2c: &mut I2C
) -> Result<(), E>
[src]

Read the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn write_power_on_configuration<E, I2C: Write<Error = E>>(
    &mut self,
    i2c: &mut I2C,
    power_on_configuration: PowerOnConfiguration
) -> Result<(), E>
[src]

Write the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn get_charge_current_control(&self) -> ChargeCurrentControl[src]

Get a register state from the current chip state. Does NOT do an I2C call.

pub fn read_charge_current_control<E, I2C: WriteRead<Error = E>>(
    &mut self,
    i2c: &mut I2C
) -> Result<(), E>
[src]

Read the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn write_charge_current_control<E, I2C: Write<Error = E>>(
    &mut self,
    i2c: &mut I2C,
    charge_current_control: ChargeCurrentControl
) -> Result<(), E>
[src]

Write the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn get_pre_charge_termination_current_control(
    &self
) -> PreChargeTerminationCurrentControl
[src]

Get a register state from the current chip state. Does NOT do an I2C call.

pub fn read_pre_charge_termination_current_control<E, I2C: WriteRead<Error = E>>(
    &mut self,
    i2c: &mut I2C
) -> Result<(), E>
[src]

Read the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn write_pre_charge_termination_current_control<E, I2C: Write<Error = E>>(
    &mut self,
    i2c: &mut I2C,
    pre_charge_termination_current_control: PreChargeTerminationCurrentControl
) -> Result<(), E>
[src]

Write the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn get_charge_voltage_control(&self) -> ChargeVoltageControl[src]

Get a register state from the current chip state. Does NOT do an I2C call.

pub fn read_charge_voltage_control<E, I2C: WriteRead<Error = E>>(
    &mut self,
    i2c: &mut I2C
) -> Result<(), E>
[src]

Read the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn write_charge_voltage_control<E, I2C: Write<Error = E>>(
    &mut self,
    i2c: &mut I2C,
    charge_voltage_control: ChargeVoltageControl
) -> Result<(), E>
[src]

Write the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn get_charge_termination_timer_control(
    &self
) -> ChargeTerminationTimerControl
[src]

Get a register state from the current chip state. Does NOT do an I2C call.

pub fn read_charge_termination_timer_control<E, I2C: WriteRead<Error = E>>(
    &mut self,
    i2c: &mut I2C
) -> Result<(), E>
[src]

Read the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn write_charge_termination_timer_control<E, I2C: Write<Error = E>>(
    &mut self,
    i2c: &mut I2C,
    charge_termination_timer_control: ChargeTerminationTimerControl
) -> Result<(), E>
[src]

Write the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn get_thermal_regulation_control(&self) -> ThermalRegulationControl[src]

Get a register state from the current chip state. Does NOT do an I2C call.

pub fn read_thermal_regulation_control<E, I2C: WriteRead<Error = E>>(
    &mut self,
    i2c: &mut I2C
) -> Result<(), E>
[src]

Read the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn write_thermal_regulation_control<E, I2C: Write<Error = E>>(
    &mut self,
    i2c: &mut I2C,
    thermal_regulation_control: ThermalRegulationControl
) -> Result<(), E>
[src]

Write the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn get_misc_operation_control(&self) -> MiscOperationControl[src]

Get a register state from the current chip state. Does NOT do an I2C call.

pub fn read_misc_operation_control<E, I2C: WriteRead<Error = E>>(
    &mut self,
    i2c: &mut I2C
) -> Result<(), E>
[src]

Read the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn write_misc_operation_control<E, I2C: Write<Error = E>>(
    &mut self,
    i2c: &mut I2C,
    misc_operation_control: MiscOperationControl
) -> Result<(), E>
[src]

Write the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn get_system_status(&self) -> SystemStatus[src]

Get a register state from the current chip state. Does NOT do an I2C call.

pub fn read_system_status<E, I2C: WriteRead<Error = E>>(
    &mut self,
    i2c: &mut I2C
) -> Result<(), E>
[src]

Read the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn write_system_status<E, I2C: Write<Error = E>>(
    &mut self,
    i2c: &mut I2C,
    system_status: SystemStatus
) -> Result<(), E>
[src]

Write the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn get_fault(&self) -> Fault[src]

Get a register state from the current chip state. Does NOT do an I2C call.

pub fn read_fault<E, I2C: WriteRead<Error = E>>(
    &mut self,
    i2c: &mut I2C
) -> Result<(), E>
[src]

Read the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn write_fault<E, I2C: Write<Error = E>>(
    &mut self,
    i2c: &mut I2C,
    fault: Fault
) -> Result<(), E>
[src]

Write the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn get_vendor_part_revision_status(&self) -> VendorPartRevisionStatus[src]

Get a register state from the current chip state. Does NOT do an I2C call.

pub fn read_vendor_part_revision_status<E, I2C: WriteRead<Error = E>>(
    &mut self,
    i2c: &mut I2C
) -> Result<(), E>
[src]

Read the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

pub fn write_vendor_part_revision_status<E, I2C: Write<Error = E>>(
    &mut self,
    i2c: &mut I2C,
    vendor_part_revision_status: VendorPartRevisionStatus
) -> Result<(), E>
[src]

Write the state of a single register over I2C, updating the chip state.

If an error occurs, the chip state remains the same.

Trait Implementations

impl Clone for ChargerState[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.