Struct max7301::expander::Expander[][src]

pub struct Expander<EI: ExpanderInterface> { /* fields omitted */ }
Expand description

The port expander device itself.

Implementations

Create a new Expander.

Takes ownership of the ExpanderInterface which it should use to communicate with the MAX7301.

Begin (re)configuring the port expander hardware by returning a Configurator.

The Configurator is a builder-like interface that can be used to alter port modes and device configuration bits.

Convert this expander into an immediate-mode I/O adapter.

The I/O adapter can be used to generate individual PortPins that allow embedded-hal-compatible access to the GPIOs on the expander directly, with every operation immediately triggering a bus operation.

See ImmediateIO for detail.

Convert this expander into a transactional I/O adapter.

The I/O adapter can be used to generate individual PortPins that allow embedded-hal-compatible access to the GPIOs on the expander. Unlike immediate mode, the operations on PortPin trait methods are buffered in a write-back cache.

See TransactionalIO for detail.

Perform a read of the current value of a single I/O port on the expander.

Perform a read of the current value of 8 consecutive I/O ports on the expander in a single bus transaction.

There is no alignment requirement; the start_port may be any valid port, and that port along with up to 7 following ports will be read in one transaction. The return value is a u8 where the LSB is the value read from start_port, and each higher bit is the 7 ports following it in ascending order. If any of the bits would correspond to a port higher than 31, then those bits will be unset.

Write a value to a single I/O port on the expander.

Write a value to 8 consecutive I/O ports on the expander in a single bus transaction.

There is no alignment requirement; the start_port may be any valid port, and that port along with up to 7 following ports will be written in one transaction. bits is a u8 where the LSB is the value to write to start_port, and each higher bit is the 7 ports following it in ascending order. If any of the bits would correspond to a port higher than 31, then those bits will be ignored.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.