pub struct LTC294XDriver<'a, I: I2CDevice> { /* private fields */ }
Expand description
Default implementation of the LTC2941 driver that provides a Driver interface for providing access to applications.
Implementations§
Source§impl<'a, I: I2CDevice> LTC294XDriver<'a, I>
impl<'a, I: I2CDevice> LTC294XDriver<'a, I>
pub fn new( ltc: &'a LTC294X<'a, I>, grants: Grant<App, UpcallCount<{ upcall::COUNT }>, AllowRoCount<0>, AllowRwCount<0>>, ) -> LTC294XDriver<'a, I>
Trait Implementations§
Source§impl<I: I2CDevice> LTC294XClient for LTC294XDriver<'_, I>
impl<I: I2CDevice> LTC294XClient for LTC294XDriver<'_, I>
fn interrupt(&self)
fn status( &self, undervolt_lockout: bool, vbat_alert: bool, charge_alert_low: bool, charge_alert_high: bool, accumulated_charge_overflow: bool, )
fn charge(&self, charge: u16)
fn done(&self)
fn voltage(&self, voltage: u16)
fn current(&self, current: u16)
Source§impl<I: I2CDevice> SyscallDriver for LTC294XDriver<'_, I>
impl<I: I2CDevice> SyscallDriver for LTC294XDriver<'_, I>
Source§fn command(
&self,
command_num: usize,
data: usize,
_: usize,
process_id: ProcessId,
) -> CommandReturn
fn command( &self, command_num: usize, data: usize, _: usize, process_id: ProcessId, ) -> CommandReturn
Request operations for the LTC294X chip.
§command_num
0
: Driver existence 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.
Source§fn allocate_grant(&self, processid: ProcessId) -> Result<(), Error>
fn allocate_grant(&self, processid: ProcessId) -> Result<(), Error>
Request to allocate a capsule’s grant for a specific process. Read more
Source§fn allow_userspace_readable(
&self,
app: ProcessId,
which: usize,
slice: ReadWriteProcessBuffer,
) -> Result<ReadWriteProcessBuffer, (ReadWriteProcessBuffer, ErrorCode)>
fn allow_userspace_readable( &self, app: ProcessId, which: usize, slice: ReadWriteProcessBuffer, ) -> Result<ReadWriteProcessBuffer, (ReadWriteProcessBuffer, ErrorCode)>
System call for a process to pass a buffer (a
UserspaceReadableProcessBuffer
) to the kernel that the kernel can
either read or write. The kernel calls this method only after it checks
that the entire buffer is within memory the process can both read and
write. Read moreAuto Trait Implementations§
impl<'a, I> !Freeze for LTC294XDriver<'a, I>
impl<'a, I> !RefUnwindSafe for LTC294XDriver<'a, I>
impl<'a, I> !Send for LTC294XDriver<'a, I>
impl<'a, I> !Sync for LTC294XDriver<'a, I>
impl<'a, I> Unpin for LTC294XDriver<'a, I>
impl<'a, I> !UnwindSafe for LTC294XDriver<'a, I>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more