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
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
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin | pin | The 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
Type | Name | Description |
---|---|---|
System.String | pinName | The pin name as a string |
SetPinDirection(bool, byte)
Set the pin direction
View Source
protected override void SetPinDirection(bool input, byte pinKey)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | input | true for input, false for output |
System.Byte | pinKey | The pin key value |
GetPinState(IPin)
Retrieves the state of a pin
View Source
protected override bool GetPinState(IPin pin)
Returns
System.Boolean
Parameters
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin | pin | The pin to query |
SetPinState(IPin, bool)
Sets the state of a pin
View Source
protected override void SetPinState(IPin pin, bool state)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin | pin | The pin to affect |
System.Boolean | state | <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
Type | Name |
---|---|
System.UInt16 | state |
SetState(ushort)
Writes the peripheral state register and updates driver internal state
View Source
protected override void SetState(ushort state)
Parameters
Type | Name |
---|---|
System.UInt16 | state |
Implements
Meadow.Hardware.IDigitalOutputController
Meadow.Hardware.IDigitalInputController
Meadow.Hardware.IDigitalInterruptController
Meadow.Hardware.IPinController
Meadow.Hardware.II2cPeripheral
System.IDisposable