Edit

Share via


Mcp23xxx Class

Definition

Base class for Mcp23xxx GPIO expanders

public abstract class Mcp23xxx : System.Device.Gpio.GpioDriver
type Mcp23xxx = class
    inherit GpioDriver
Public MustInherit Class Mcp23xxx
Inherits GpioDriver
Inheritance
Mcp23xxx
Derived

Constructors

Mcp23xxx(Mcp23xxx+BusAdapter, Int32, Int32, Int32, GpioController, BankStyle)
Mcp23xxx(Mcp23xxx+BusAdapter, Int32, Int32, Int32, GpioController, BankStyle, Boolean)

A general purpose parallel I/O expansion for I2C or SPI applications.

Fields

_bus

Bus adapter (I2C/SPI) used to communicate with the device

Properties

PinCount

The number of pins provided by the driver.

(Inherited from GpioDriver)

Methods

AddCallbackForPinValueChangedEvent(Int32, PinEventTypes, PinChangeEventHandler)

Adds a handler for a pin value changed event.

ClosePin(Int32)

Closes an open pin.

ConvertPinNumberToLogicalNumberingScheme(Int32)

Converts a board pin number to the driver's logical numbering scheme.

Disable()

Disables the device by setting the reset pin low.

Dispose()

Disposes this instance, closing all open pins

(Inherited from GpioDriver)
Dispose(Boolean)

Disposes this instance

Enable()

Enables the device by setting the reset pin high.

GetPinMode(Int32)

Gets the mode of a pin.

InternalRead(Register, Span<Byte>, Port)

Reads a number of bytes from registers.

InternalReadByte(Register, Port)

Reads byte from the device register

InternalReadInterrupt(Port)

Reads interrupt value

InternalReadUInt16(Register)

Read 16-bit unsigned integer from the device register

InternalWrite(Register, Span<Byte>, Port)

Writes a number of bytes to registers.

InternalWriteByte(Register, Byte, Port)

Write byte to device register

InternalWriteUInt16(Register, UInt16)

Writes 16-bit unsigned integer to the device register

IsPinModeSupported(Int32, PinMode)

Checks if a pin supports a specific mode.

OpenPin(Int32)

Opens a pin in order for it to be ready to use. The driver attempts to open the pin without changing its mode or value.

QueryComponentInformation()

Query information about a component and its children.

(Inherited from GpioDriver)
Read(Int32)

Reads the value of a pin.

Read(Span<PinValuePair>)

Reads the value of a set of pins

ReadByte(Register)

Read a byte from the given register.

ReadInterrupt()

Returns the value of the interrupt pin if configured.

RemoveCallbackForPinValueChangedEvent(Int32, PinChangeEventHandler)

Removes a handler for a pin value changed event.

SetPinMode(Int32, PinMode)

Sets a mode to a pin.

SetPinMode(Int32, PinMode, PinValue)

Sets the mode to a pin and sets an initial value for an output pin.

(Inherited from GpioDriver)
Toggle(Int32)

Toggle the current value of a pin.

Toggle(Int32)

Toggle the current value of a pin.

(Inherited from GpioDriver)
WaitForEvent(Int32, PinEventTypes, CancellationToken)

Blocks execution until an event of type eventType is received or a cancellation is requested.

WaitForEventAsync(Int32, PinEventTypes, CancellationToken)

Async call until an event of type eventType is received or a cancellation is requested.

(Inherited from GpioDriver)
Write(Int32, PinValue)

Writes a value to a pin.

Write(ReadOnlySpan<PinValuePair>)

Writes values to a set of pins

WriteByte(Register, Byte)

Write a byte to the given register.

Applies to