Struct capsules_extra::ltc294x::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>,

§

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

§

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.