Struct capsules::ltc294x::LTC294XDriver
[−]
[src]
pub struct LTC294XDriver<'a> { ltc294x: &'a LTC294X<'a>, callback: Cell<Option<Callback>>, }
Default implementation of the LTC2941 driver that provides a Driver interface for providing access to applications.
Fields
ltc294x: &'a LTC294X<'a>
callback: Cell<Option<Callback>>
Methods
impl<'a> LTC294XDriver<'a>
[src]
pub fn new(ltc: &'a LTC294X) -> LTC294XDriver<'a>
[src]
Trait Implementations
impl<'a> LTC294XClient for LTC294XDriver<'a>
[src]
fn interrupt(&self)
[src]
fn status(
&self,
undervolt_lockout: bool,
vbat_alert: bool,
charge_alert_low: bool,
charge_alert_high: bool,
accumulated_charge_overflow: bool
)
[src]
&self,
undervolt_lockout: bool,
vbat_alert: bool,
charge_alert_low: bool,
charge_alert_high: bool,
accumulated_charge_overflow: bool
)
fn charge(&self, charge: u16)
[src]
fn done(&self)
[src]
fn voltage(&self, voltage: u16)
[src]
fn current(&self, current: u16)
[src]
impl<'a> Driver for LTC294XDriver<'a>
[src]
fn subscribe(&self, subscribe_num: usize, callback: Callback) -> ReturnCode
[src]
Setup callbacks.
subscribe_num
0
: Set the callback that that is triggered when events finish and when readings are ready. The first argument represents which callback was triggered.0
: Interrupt occurred from the LTC294X.1
: Got the status.2
: Read the charge used.3
:done()
was called.4
: Read the voltage.5
: Read the current.
fn command(
&self,
command_num: usize,
data: usize,
_: usize,
_: AppId
) -> ReturnCode
[src]
&self,
command_num: usize,
data: usize,
_: usize,
_: AppId
) -> ReturnCode
Request operations for the LTC294X chip.
command_num
0
: Driver check.1
: Get status of the chip.2
: Configure settings of the chip.3
: Reset accumulated charge measurement to zero.4
: Set the upper threshold for charge.5
: Set the lower threshold for charge.6
: Get the current charge accumulated.7
: Shutdown the chip.8
: Get the voltage reading. Only supported on the LTC2942 and LTC2943.9
: Get the current reading. Only supported on the LTC2943.10
: Set the model of the LTC294X actually being used.data
is the value of the X.
fn allow(
&self,
app: AppId,
minor_num: usize,
slice: AppSlice<Shared, u8>
) -> ReturnCode
[src]
&self,
app: AppId,
minor_num: usize,
slice: AppSlice<Shared, u8>
) -> ReturnCode
allow
lets an application give the driver access to a buffer in the application's memory. This returns ENOSUPPORT
if not used. Read more