Table of Contents

Class Mcp23x1x

Namespace
Iot.Device.Mcp23xxx
Assembly
Iot.Device.Mcp23xxx.dll

Wraps 16-bit MCP I/O expanders.

public abstract class Mcp23x1x : Mcp23xxx
Inheritance
GpioDriver
Mcp23x1x
Derived
Inherited Members

Constructors

Mcp23x1x(BusAdapter, int, int, int, GpioController?, bool)

Constructs Mcp23x1x instance

protected Mcp23x1x(Mcp23xxx.BusAdapter device, int reset, int interruptA, int interruptB, GpioController? controller, bool shouldDispose = true)

Parameters

device Mcp23xxx.BusAdapter

I2C device used to communicate with the device

reset int

Reset pin

interruptA int

Interrupt A pin

interruptB int

Interrupt B pin

controller GpioController

GpioController related with reset interruptA and interruptB pins

shouldDispose bool

True to dispose the Gpio Controller

Properties

PinCount

The number of pins provided by the driver.

protected override int PinCount { get; }

Property Value

int

Methods

ReadByte(Register, Port)

Read a byte from the given register on the given port.

public byte ReadByte(Register register, Port port)

Parameters

register Register
port Port

Returns

byte

ReadInterrupt(Port)

Reads the interrupt pin for the given port if configured.

public PinValue ReadInterrupt(Port port)

Parameters

port Port

Returns

PinValue

ReadUInt16(Register)

Read a ushort from the given register.

public ushort ReadUInt16(Register register)

Parameters

register Register

Returns

ushort

WriteByte(Register, byte, Port)

Write a byte to the given register on the given port.

public void WriteByte(Register register, byte value, Port port)

Parameters

register Register
value byte
port Port

WriteUInt16(Register, ushort)

Write a ushort to the given register. Writes the value to both ports.

public void WriteUInt16(Register register, ushort value)

Parameters

register Register
value ushort