pub struct Charger<D> { /* private fields */ }
Expand description
A MAX77975/MAX77976 battery charger.
Implementations§
Source§impl<D: I2c> Charger<D>
impl<D: I2c> Charger<D>
Sourcepub async fn set_sys_ilim(
&mut self,
milliamps: u16,
recycle_en: bool,
) -> Result<(), D::Error>
pub async fn set_sys_ilim( &mut self, milliamps: u16, recycle_en: bool, ) -> Result<(), D::Error>
Set the current limit for Vsys out.
If the current limit is exceeded, Vsys will be shut off. If recycle_en
is false, it will remain
shut off until a valid charger is present. Otherwise, it will attempt to recycle after 150ms.
Sourcepub async fn set_chgin_ilim(&mut self, milliamps: u16) -> Result<(), D::Error>
pub async fn set_chgin_ilim(&mut self, milliamps: u16) -> Result<(), D::Error>
Set the current limit for CHGIN.
Sourcepub async fn set_fast_charge_current(
&mut self,
milliamps: u16,
) -> Result<(), D::Error>
pub async fn set_fast_charge_current( &mut self, milliamps: u16, ) -> Result<(), D::Error>
Set the current to use during the ChargerDetails::ConstantCurrent
charging phase.
Sourcepub async fn enter_ship_mode(&mut self) -> Result<(), D::Error>
pub async fn enter_ship_mode(&mut self) -> Result<(), D::Error>
Enter ship mode.
All power will be shut down and remain off until a valid charger is present. Ship mode can not be enetered when a valid charger is present.
Sourcepub async fn set_charger_irq_mask(
&mut self,
irqs: ChargerInterrupts,
) -> Result<(), D::Error>
pub async fn set_charger_irq_mask( &mut self, irqs: ChargerInterrupts, ) -> Result<(), D::Error>
Enable charger interrupts.
Fields set to true
in irqs
will have their interrupts enabled.
Sourcepub async fn charger_irq_flags(&mut self) -> Result<ChargerInterrupts, D::Error>
pub async fn charger_irq_flags(&mut self) -> Result<ChargerInterrupts, D::Error>
Reads and clears the current charger interrupt flags
Sourcepub async fn charger_status(&mut self) -> Result<ChargerInterrupts, D::Error>
pub async fn charger_status(&mut self) -> Result<ChargerInterrupts, D::Error>
Clears the charger interrupt flags and returns the current status bits
This method reads from Reg::CHARGER_INTERRUPT
through Reg::CHARGER_INTERRUPT_STATUS
in a single transaction to atomically clear the interrupt flags and return the current
status bits.
Sourcepub async fn charger_details(&mut self) -> Result<Details, D::Error>
pub async fn charger_details(&mut self) -> Result<Details, D::Error>
Get the detailed status of the charger.