Struct sx1509::Borrowed
[−]
[src]
pub struct Borrowed<'a, I2C: 'a> where
I2C: WriteRead + Write, { /* fields omitted */ }
The Borrowed
struct encapsulates the device and a borrowed
bus. This is the struct which holds the actual impl
for
the device driver.
Methods
impl<'a, I2C, E> Borrowed<'a, I2C> where
I2C: WriteRead<Error = E> + Write<Error = E> + 'a,
[src]
I2C: WriteRead<Error = E> + Write<Error = E> + 'a,
pub fn read_16(&mut self, register: Register) -> Result<u16, E>
[src]
Read a 16-bit value from the register and its successor
pub fn software_reset(&mut self) -> Result<(), E>
[src]
Perform a software reset of the module. This restores the device to its power-on defaults.
pub fn set_bank_a_direction(&mut self, mask: u8) -> Result<(), E>
[src]
Set the direction for each pin in BankA. Each 1 bit will be set to output, each 0 bit will be set to input.
pub fn set_bank_b_direction(&mut self, mask: u8) -> Result<(), E>
[src]
Set the direction for each pin in BankB. Each 1 bit will be set to output, each 0 bit will be set to input.
pub fn set_bank_a_data(&mut self, mask: u8) -> Result<(), E>
[src]
Set the data for each pin in BankA. Each 1 bit will be set to high, each 0 bit will be set low.
pub fn set_bank_b_data(&mut self, mask: u8) -> Result<(), E>
[src]
Set the data for each pin in BankB. Each 1 bit will be set to high, each 0 bit will be set low.
pub fn get_bank_a_data(&mut self) -> Result<u8, E>
[src]
Get the data for each pin in BankA. Each 1 bit is set to high, each 0 bit is set low.
pub fn get_bank_b_data(&mut self) -> Result<u8, E>
[src]
Get the data for each pin in BankB. Each 1 bit is set to high, each 0 bit is set low.
pub fn get_bank_a_and_b_data(&mut self) -> Result<u16, E>
[src]
Get the data for each pin in BankB and BankA as a 16-bit value. Each 1 bit is set to high, each 0 bit is set low.
pub fn set_bank_a_pullup(&mut self, mask: u8) -> Result<(), E>
[src]
Set the pull-up for each pin in BankA. Each 1 bit will have pull up enabled, 0 disabled
pub fn set_bank_b_pullup(&mut self, mask: u8) -> Result<(), E>
[src]
Set the pull-up for each pin in BankB. Each 1 bit will have pull up enabled, 0 disabled