Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default pin ctor value to remove ctor ambiguity + minor cleanup #756

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public abstract partial class Pcx8574 : Pcx857x
/// <param name="i2cBus">The I2C bus</param>
/// <param name="address">The I2C address</param>
/// <param name="interruptPin">The interrupt pin</param>
protected Pcx8574(II2cBus i2cBus, byte address, IPin? interruptPin = null) :
protected Pcx8574(II2cBus i2cBus, byte address, IPin? interruptPin) :
base(i2cBus, address, interruptPin)
{
Pins = new PinDefinitions(this)
Expand Down Expand Up @@ -157,7 +157,6 @@ protected byte ReadState8()
/// </summary>
protected void WriteState(byte state)
{
Console.WriteLine($"WriteState {state}");
state |= directionMask;
i2CCommunications.Write(state);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public abstract partial class Pcx8575 : Pcx857x
/// <param name="i2cBus">The I2C bus</param>
/// <param name="address">The I2C address</param>
/// <param name="interruptPin">The interrupt pin</param>
protected Pcx8575(II2cBus i2cBus, byte address, IPin? interruptPin = null) :
protected Pcx8575(II2cBus i2cBus, byte address, IPin? interruptPin) :
base(i2cBus, address, interruptPin)
{
Pins = new PinDefinitions(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Pca8574 : Pcx8574
/// <param name="i2cBus">The I2C bus the peripheral is connected to</param>
/// <param name="address">The I2C bus address of the peripheral</param>
/// <param name="interruptPin">The interrupt pin</param>
public Pca8574(II2cBus i2cBus, byte address, IPin? interruptPin = default)
public Pca8574(II2cBus i2cBus, byte address, IPin? interruptPin)
: base(i2cBus, address, interruptPin)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Pca8575 : Pcx8575
/// <param name="i2cBus">The I2C bus the peripheral is connected to</param>
/// <param name="address">The I2C bus address of the peripheral</param>
/// <param name="interruptPin">The interrupt pin</param>
public Pca8575(II2cBus i2cBus, byte address, IPin? interruptPin = default)
public Pca8575(II2cBus i2cBus, byte address, IPin? interruptPin)
: base(i2cBus, address, interruptPin)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Pcf8574 : Pcx8574
/// <param name="i2cBus">The I2C bus the peripheral is connected to</param>
/// <param name="address">The I2C bus address of the peripheral</param>
/// <param name="interruptPin">The interrupt pin</param>
public Pcf8574(II2cBus i2cBus, byte address, IPin? interruptPin = default)
public Pcf8574(II2cBus i2cBus, byte address, IPin? interruptPin)
: base(i2cBus, address, interruptPin)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Pcf8575 : Pcx8575
/// <param name="i2cBus">The I2C bus the peripheral is connected to</param>
/// <param name="address">The I2C bus address of the peripheral</param>
/// <param name="interruptPin">The interrupt pin</param>
public Pcf8575(II2cBus i2cBus, byte address, IPin? interruptPin = default)
public Pcf8575(II2cBus i2cBus, byte address, IPin? interruptPin)
: base(i2cBus, address, interruptPin)
{
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Meadow.Hardware;
using Meadow.Utilities;
using System;
using System.Collections.Generic;
using System.Net.NetworkInformation;

namespace Meadow.Foundation.ICs.IOExpanders
{
Expand All @@ -27,8 +25,6 @@ public abstract partial class Pcx857x : IDigitalOutputController, IDigitalInputC
private IDigitalInterruptPort? interruptPort;
private readonly bool createdPort = false;

private ushort lastInputState;

/// <summary>
/// The I2C Communications object
/// </summary>
Expand All @@ -40,7 +36,7 @@ public abstract partial class Pcx857x : IDigitalOutputController, IDigitalInputC
/// <param name="i2cBus">The I2C buss the peripheral is connected to</param>
/// <param name="address">The bus address of the peripheral</param>
/// <param name="interruptPin">The interrupt pin</param>
public Pcx857x(II2cBus i2cBus, byte address, IPin? interruptPin = default)
public Pcx857x(II2cBus i2cBus, byte address, IPin? interruptPin)
: this(i2cBus, address, interruptPin?.CreateDigitalInterruptPort(InterruptMode.EdgeFalling))
{
createdPort = true;
Expand Down
Loading