Struct capsules::pca9544a::PCA9544A
[−]
[src]
pub struct PCA9544A<'a> { i2c: &'a I2CDevice, state: Cell<State>, buffer: TakeCell<'static, [u8]>, callback: Cell<Option<Callback>>, }
Fields
i2c: &'a I2CDevice
state: Cell<State>
buffer: TakeCell<'static, [u8]>
callback: Cell<Option<Callback>>
Methods
impl<'a> PCA9544A<'a>
[src]
pub fn new(i2c: &'a I2CDevice, buffer: &'static mut [u8]) -> PCA9544A<'a>
[src]
fn select_channels(&self, channel_bitmask: u8) -> ReturnCode
[src]
Choose which channel(s) are active. Channels are encoded with a bitwise mask (0x01 means enable channel 0, 0x0F means enable all channels). Send 0 to disable all channels.
fn read_interrupts(&self) -> ReturnCode
[src]
fn read_selected_channels(&self) -> ReturnCode
[src]
fn read_control(&self, field: ControlField) -> ReturnCode
[src]
Trait Implementations
impl<'a> I2CClient for PCA9544A<'a>
[src]
fn command_complete(&self, buffer: &'static mut [u8], _error: Error)
[src]
Called when an I2C command completed. The error
denotes whether the command completed successfully or if an error occured. Read more
impl<'a> Driver for PCA9544A<'a>
[src]
fn subscribe(&self, subscribe_num: usize, callback: Callback) -> ReturnCode
[src]
Setup callback for event done.
subscribe_num
0
: Callback is triggered when a channel is finished being selected or when the current channel setup is returned.
fn command(
&self,
command_num: usize,
data: usize,
_: usize,
_: AppId
) -> ReturnCode
[src]
&self,
command_num: usize,
data: usize,
_: usize,
_: AppId
) -> ReturnCode
Control the I2C selector.
command_num
0
: Driver check.1
: Choose which channels are active.2
: Disable all channels.3
: Read the list of fired interrupts.4
: Read which channels are selected.
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