Enum mcp230xx::Mcp23017

source ·
#[repr(usize)]
pub enum Mcp23017 {
Show 16 variants A0 = 0, A1 = 1, A2 = 2, A3 = 3, A4 = 4, A5 = 5, A6 = 6, A7 = 7, B0 = 8, B1 = 9, B2 = 10, B3 = 11, B4 = 12, B5 = 13, B6 = 14, B7 = 15,
}
Expand description

MCP23017 register map.

Note: This operates the chip in IOCON.BANK=0 mode, i.e. even register addresses are bank 0. This driver does not set IOCON.BANK, but the factory default is 0 and this driver does not change that value.

See the datasheet for more information on the device.

Variants§

§

A0 = 0

§

A1 = 1

§

A2 = 2

§

A3 = 3

§

A4 = 4

§

A5 = 5

§

A6 = 6

§

A7 = 7

§

B0 = 8

§

B1 = 9

§

B2 = 10

§

B3 = 11

§

B4 = 12

§

B5 = 13

§

B6 = 14

§

B7 = 15

Trait Implementations§

source§

impl Clone for Mcp23017

source§

fn clone(&self) -> Mcp23017

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Mcp23017

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Mcp23017

source§

fn default() -> Mcp23017

Returns the “default value” for a type. Read more
source§

impl From<Mcp23017> for usize

source§

fn from(enum_value: Mcp23017) -> Self

Converts to this type from the input type.
source§

impl Map for Mcp23017

source§

fn map(self, reg: Register) -> (u8, usize)

A way to map a named register (Register) and pin (from Pin, depending on the variant) to a register address and bit index. This may depend on the number of IO banks, the way the banks are ordered in memory, and even the current configuration (IOCON.BANK).
source§

impl PartialEq for Mcp23017

source§

fn eq(&self, other: &Mcp23017) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Mcp23017

source§

impl Eq for Mcp23017

source§

impl StructuralPartialEq for Mcp23017

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.