Struct sx1509::Sx1509
[−]
[src]
pub struct Sx1509<I2C> where
I2C: WriteRead + Write, { /* fields omitted */ }
The Sx1509
struct encapsulates the basic data about the device.
You need to borrow
or take
the I2C bus to issue IO.
Methods
impl<I2C> Sx1509<I2C> where
I2C: WriteRead + Write,
[src]
I2C: WriteRead + Write,
pub fn new(_i2c: &mut I2C, address: u8) -> Self
[src]
Create an instance. No implicit initialization is performed.
You will likely want to perform a software_reset
as the
next step.
pub fn take(self, i2c: I2C) -> Owned<I2C>
[src]
Take ownership of the bus and return an Owned
instance.
This is best suited for asynchronous usage where you initiate IO
and later test to see whether it is complete. This doesn't make
a lot of sense with the current implementation of the Sx1509 driver
as no such workflows are supported today.
You probably want the borrow
method instead.
pub fn borrow<'a>(&'a mut self, i2c: &'a mut I2C) -> Borrowed<'a, I2C>
[src]
Borrow ownership of the bus and return a Borrowed
instance that
can be used to perform IO.