Struct capsules::mcp23008::MCP23008 [] [src]

pub struct MCP23008<'a> {
    i2c: &'a I2CDevice,
    state: Cell<State>,
    buffer: TakeCell<'static, [u8]>,
    interrupt_pin: Option<&'static Pin>,
    interrupt_settings: Cell<u32>,
    identifier: Cell<usize>,
    client: Cell<Option<&'static Client>>,
}

Fields

Methods

impl<'a> MCP23008<'a>
[src]

[src]

[src]

Set the client of this MCP23008 when commands finish or interrupts occur. The identifier is simply passed back with the callback so that the upper layer can keep track of which device triggered.

[src]

[src]

[src]

Set the pull-up on the pin also configure it to be an input.

[src]

[src]

[src]

[src]

[src]

[src]

Helper function for keeping track of which interrupts are currently enabled.

[src]

[src]

Create an 8 bit bitmask of which interrupts are enabled.

[src]

[src]

Trait Implementations

impl<'a> I2CClient for MCP23008<'a>
[src]

[src]

Called when an I2C command completed. The error denotes whether the command completed successfully or if an error occured. Read more

impl<'a> Client for MCP23008<'a>
[src]

[src]

Called when an interrupt occurs. The identifier will be the same value that was passed to enable_interrupt() when the interrupt was configured. Read more

impl<'a> Port for MCP23008<'a>
[src]

[src]

Try to disable a GPIO pin. This cannot be supported for all devices.

[src]

Configure a pin as an ouput GPIO.

[src]

Configure a pin as an input GPIO. Not all InputMode settings may be supported by a given device. Read more

[src]

Get the state (0 or 1) of an input pin. The value will be returned via a callback. Read more

[src]

Toggle an output GPIO pin.

[src]

Assert a GPIO pin high.

[src]

Clear a GPIO pin low.

[src]

Setup an interrupt on a GPIO input pin. The identifier should be the port number and will be returned when the interrupt callback fires. Read more

[src]

Disable an interrupt on a GPIO input pin.