capsules_extra::ltc294x

Struct LTC294XDriver

Source
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>

Source

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>

Source§

fn interrupt(&self)

Source§

fn status( &self, undervolt_lockout: bool, vbat_alert: bool, charge_alert_low: bool, charge_alert_high: bool, accumulated_charge_overflow: bool, )

Source§

fn charge(&self, charge: u16)

Source§

fn done(&self)

Source§

fn voltage(&self, voltage: u16)

Source§

fn current(&self, current: u16)

Source§

impl<I: I2CDevice> SyscallDriver for LTC294XDriver<'_, I>

Source§

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>

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)>

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 more

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.