Skip to main content

Class Pcx8574

Represent an Pcx8574 8 bit I2C port expander

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

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

Derived:
Meadow.Foundation.ICs.IOExpanders.Pca8574

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

Properties

Pins

Pcx8574 pin definitions

View Source
Declaration
public Pcx8574.PinDefinitions Pins { get; }

NumberOfPins

The number of IO pins available on the device

View Source
Declaration
public override int NumberOfPins { get; }

Methods

IsValidPin(IPin)

Is the pin valid for this device instance

View Source
Declaration
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
Declaration
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
Declaration
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
Declaration
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
Declaration
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

View Source
Declaration
protected override ushort ReadState()
Returns

System.UInt16

WriteState(ushort)

Writes the peripheral state register

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

SetState(ushort)

Writes the peripheral state register and updates driver internal state

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

ReadState8()

Reads the peripheral state register for 8 pin devices

View Source
Declaration
protected byte ReadState8()
Returns

System.Byte

WriteState(byte)

Writes the peripheral state register for 8 pin devices

View Source
Declaration
protected void WriteState(byte state)
Parameters
TypeName
System.Bytestate

Implements

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