Struct capsules::max17205::MAX17205Driver
[−]
[src]
pub struct MAX17205Driver<'a> { max17205: &'a MAX17205<'a>, callback: Cell<Option<Callback>>, }
Fields
max17205: &'a MAX17205<'a>
callback: Cell<Option<Callback>>
Methods
impl<'a> MAX17205Driver<'a>
[src]
pub fn new(max: &'a MAX17205) -> MAX17205Driver<'a>
[src]
Trait Implementations
impl<'a> MAX17205Client for MAX17205Driver<'a>
[src]
fn status(&self, status: u16, error: ReturnCode)
[src]
fn state_of_charge(
&self,
percent: u16,
capacity: u16,
full_capacity: u16,
error: ReturnCode
)
[src]
&self,
percent: u16,
capacity: u16,
full_capacity: u16,
error: ReturnCode
)
fn voltage_current(&self, voltage: u16, current: u16, error: ReturnCode)
[src]
fn coulomb(&self, coulomb: u16, error: ReturnCode)
[src]
fn romid(&self, rid: u64, error: ReturnCode)
[src]
impl<'a> Driver for MAX17205Driver<'a>
[src]
fn subscribe(&self, subscribe_num: usize, callback: Callback) -> ReturnCode
[src]
fn command(
&self,
command_num: usize,
_data: usize,
_: usize,
_: AppId
) -> ReturnCode
[src]
&self,
command_num: usize,
_data: usize,
_: usize,
_: AppId
) -> ReturnCode
Setup and read the MAX17205.
command_num
0
: Driver check.1
: Read the current status of the MAX17205.2
: Read the current state of charge percent.3
: Read the current voltage and current draw.4
: Read the raw coulomb count.5
: Read the unique 64 bit RomID.
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