Struct capsules::ltc294x::LTC294X
[−]
[src]
pub struct LTC294X<'a> { i2c: &'a I2CDevice, interrupt_pin: Option<&'a Pin>, model: Cell<ChipModel>, state: Cell<State>, buffer: TakeCell<'static, [u8]>, client: Cell<Option<&'static LTC294XClient>>, }
Implementation of a driver for the LTC294X coulomb counters.
Fields
i2c: &'a I2CDevice
interrupt_pin: Option<&'a Pin>
model: Cell<ChipModel>
state: Cell<State>
buffer: TakeCell<'static, [u8]>
client: Cell<Option<&'static LTC294XClient>>
Methods
impl<'a> LTC294X<'a>
[src]
pub fn new(
i2c: &'a I2CDevice,
interrupt_pin: Option<&'a Pin>,
buffer: &'static mut [u8]
) -> LTC294X<'a>
[src]
i2c: &'a I2CDevice,
interrupt_pin: Option<&'a Pin>,
buffer: &'static mut [u8]
) -> LTC294X<'a>
pub fn set_client<C: LTC294XClient>(&self, client: &'static C)
[src]
pub fn read_status(&self) -> ReturnCode
[src]
fn configure(
&self,
int_pin_conf: InterruptPinConf,
prescaler: u8,
vbat_alert: VBatAlert
) -> ReturnCode
[src]
&self,
int_pin_conf: InterruptPinConf,
prescaler: u8,
vbat_alert: VBatAlert
) -> ReturnCode
fn reset_charge(&self) -> ReturnCode
[src]
Set the accumulated charge to 0
fn set_high_threshold(&self, threshold: u16) -> ReturnCode
[src]
fn set_low_threshold(&self, threshold: u16) -> ReturnCode
[src]
fn get_charge(&self) -> ReturnCode
[src]
Get the cumulative charge as measured by the LTC2941.
fn get_voltage(&self) -> ReturnCode
[src]
Get the voltage at sense+
fn get_current(&self) -> ReturnCode
[src]
Get the current sensed by the resistor
fn shutdown(&self) -> ReturnCode
[src]
Put the LTC294X in a low power state.
fn set_model(&self, model_num: usize) -> ReturnCode
[src]
Set the LTC294X model actually on the board.
Trait Implementations
impl<'a> I2CClient for LTC294X<'a>
[src]
fn command_complete(&self, buffer: &'static mut [u8], _error: Error)
[src]
Called when an I2C command completed. The error
denotes whether the command completed successfully or if an error occured. Read more