Skip to main content

Class Pcx8575

Represent an Pcx8575 8 bit I2C port expander

Assembly: Pcx857x.dll
View Source
public abstract class Pcx8575 : Pcx857x, IDigitalOutputController, IDigitalInputController, IDigitalInterruptController, IPinController, II2cPeripheral, IDisposable

Inheritance: System.Object -> Meadow.Foundation.ICs.IOExpanders.Pcx857x

Derived:
Meadow.Foundation.ICs.IOExpanders.Pca8575, Meadow.Foundation.ICs.IOExpanders.Pcf8575

Implements:
Meadow.Hardware.IDigitalOutputController, Meadow.Hardware.IDigitalInputController, Meadow.Hardware.IDigitalInterruptController, Meadow.Hardware.IPinController, Meadow.Hardware.II2cPeripheral, System.IDisposable

Properties

Pins

MCP23x17 pin definitions

View Source
public Pcx8575.PinDefinitions Pins { get; }

NumberOfPins

The number of IO pins available on the device

View Source
public override int NumberOfPins { get; }

Methods

IsValidPin(IPin)

Is the pin valid for this device instance

View Source
protected override bool IsValidPin(IPin pin)
Returns

System.Boolean: True if pin is valid

Parameters
TypeNameDescription
Meadow.Hardware.IPinpinThe IPin to validate

GetPin(string)

Get pin reference by name

View Source
public override IPin GetPin(string pinName)
Returns

Meadow.Hardware.IPin: IPin reference if found

Parameters
TypeNameDescription
System.StringpinNameThe pin name as a string

SetPinDirection(bool, byte)

Set the pin direction

View Source
protected override void SetPinDirection(bool input, byte pinKey)
Parameters
TypeNameDescription
System.Booleaninputtrue for input, false for output
System.BytepinKeyThe pin key value

GetPinState(IPin)

Retrieves the state of a pin

View Source
protected override bool GetPinState(IPin pin)
Returns

System.Boolean

Parameters
TypeNameDescription
Meadow.Hardware.IPinpinThe pin to query

SetPinState(IPin, bool)

Sets the state of a pin

View Source
protected override void SetPinState(IPin pin, bool state)
Parameters
TypeNameDescription
Meadow.Hardware.IPinpinThe pin to affect
System.Booleanstate<b>True</b> to set the pin state high, <b>False</b> to set it low

ReadState()

Reads the peripheral state register for 16 pin devices

View Source
protected override ushort ReadState()
Returns

System.UInt16

WriteState(ushort)

Writes the peripheral state register for 16 pin devices

View Source
protected override void WriteState(ushort state)
Parameters
TypeName
System.UInt16state

SetState(ushort)

Writes the peripheral state register and updates driver internal state

View Source
protected override void SetState(ushort state)
Parameters
TypeName
System.UInt16state

Implements

  • Meadow.Hardware.IDigitalOutputController
  • Meadow.Hardware.IDigitalInputController
  • Meadow.Hardware.IDigitalInterruptController
  • Meadow.Hardware.IPinController
  • Meadow.Hardware.II2cPeripheral
  • System.IDisposable