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

Feature/mcp 41xxx pot #814

Merged
merged 5 commits into from
Oct 24, 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
@@ -1,4 +1,4 @@
namespace Meadow.Foundation.ICs.IOExpanders
namespace Meadow.Foundation.ICs.DigiPots
{
public partial class Ds3502
{
Expand Down Expand Up @@ -30,7 +30,7 @@ public enum Addresses : byte
Default = Address_0x28
}

enum Register : byte
private enum Register : byte
{
/// <summary>
/// Wiper value register
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System;
using System.Threading.Tasks;

namespace Meadow.Foundation.ICs.IOExpanders
namespace Meadow.Foundation.ICs.DigiPots
{
/// <summary>
/// Represents a DS3502 digital potentiometer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Meadow.Sdk/1.1.0">
<Project Sdk="Meadow.Sdk/1.1.0">
<PropertyGroup>
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
Expand All @@ -12,15 +11,14 @@
<AssemblyName>Ds3502</AssemblyName>
<Company>Wilderness Labs, Inc</Company>
<PackageProjectUrl>http://developer.wildernesslabs.co/Meadow/Meadow.Foundation/</PackageProjectUrl>
<PackageId>Meadow.Foundation.ICs.IOExpanders.Ds3502</PackageId>
<PackageId>Meadow.Foundation.ICs.DigiPots.Ds3502</PackageId>
<RepositoryUrl>https://github.com/WildernessLabs/Meadow.Foundation</RepositoryUrl>
<PackageTags>Meadow.Foundation, IOExpanders, Ds3502</PackageTags>
<PackageTags>Meadow.Foundation, DigiPots, Ds3502</PackageTags>
<Version>0.1.5</Version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add digital and potentionmeter key words

<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>Ds3502 I2C digital potentiometer</Description>
</PropertyGroup>
<ItemGroup>
<None Include=".\Readme.md" Pack="true" PackagePath=""/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-add readme.md ref

<None Include="..\..\..\icon.png" Pack="true" PackagePath="" />
<ProjectReference Include="..\..\..\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\..\Meadow.Core\Source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\Driver\ICs.IOExpanders.Ds3502.csproj" />
<ProjectReference Include="..\..\Driver\ICs.DigiPots.Ds3502.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Meadow;
using Meadow.Devices;
using Meadow.Foundation.ICs.IOExpanders;
using Meadow.Foundation.ICs.DigiPots;
using System.Threading;
using System.Threading.Tasks;

namespace ICs.IOExpanders.Ds3502_Sample
namespace ICs.DigiPots.Ds3502_Sample
{
public class MeadowApp : App<F7FeatherV2>
{
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Meadow.Hardware;
using Meadow.Units;

namespace Meadow.Foundation.ICs.DigiPots;

/// <summary>
/// Represents an MCP4131 digital potentiometer.
/// </summary>
public class Mcp4131 : Mcp4xx1
{
/// <inheritdoc/>
public override int MaxSteps => 129;

/// <summary>
/// Initializes a new instance of the <see cref="Mcp4131"/> class.
/// </summary>
/// <param name="spiBus">The SPI bus to which the MCP4131 is connected.</param>
/// <param name="chipSelect">The digital output port for the chip select (CS) pin.</param>
/// <param name="maxResistance">The maximum resistance of the potentiometer.</param>
public Mcp4131(ISpiBus spiBus, IDigitalOutputPort chipSelect, Resistance maxResistance) :
base(spiBus, chipSelect, 1, maxResistance)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Meadow.Hardware;
using Meadow.Units;

namespace Meadow.Foundation.ICs.DigiPots;

/// <summary>
/// Represents an MCP4132 digital rheostat.
/// </summary>
public class Mcp4132 : Mcp4xx2
{
/// <inheritdoc/>
public override int MaxSteps => 129;

/// <summary>
/// Initializes a new instance of the <see cref="Mcp4132"/> class.
/// </summary>
/// <param name="spiBus">The SPI bus to which the MCP4132 is connected.</param>
/// <param name="chipSelect">The digital output port for the chip select (CS) pin.</param>
/// <param name="maxResistance">The maximum resistance of the rheostat.</param>
public Mcp4132(ISpiBus spiBus, IDigitalOutputPort chipSelect, Resistance maxResistance) :
base(spiBus, chipSelect, 1, maxResistance)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Meadow.Hardware;
using Meadow.Units;

namespace Meadow.Foundation.ICs.DigiPots;

/// <summary>
/// Represents an MCP4141 digital potentiometer.
/// </summary>
public class Mcp4141 : Mcp4xx1
{
/// <inheritdoc/>
public override int MaxSteps => 129;

/// <summary>
/// Initializes a new instance of the <see cref="Mcp4141"/> class.
/// </summary>
/// <param name="spiBus">The SPI bus to which the MCP4141 is connected.</param>
/// <param name="chipSelect">The digital output port for the chip select (CS) pin.</param>
/// <param name="maxResistance">The maximum resistance of the potentiometer.</param>
public Mcp4141(ISpiBus spiBus, IDigitalOutputPort chipSelect, Resistance maxResistance) :
base(spiBus, chipSelect, 1, maxResistance)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Meadow.Hardware;
using Meadow.Units;

namespace Meadow.Foundation.ICs.DigiPots;

/// <summary>
/// Represents an MCP4142 digital rheostat.
/// </summary>
public class Mcp4142 : Mcp4xx2
{
/// <inheritdoc/>
public override int MaxSteps => 129;

/// <summary>
/// Initializes a new instance of the <see cref="Mcp4142"/> class.
/// </summary>
/// <param name="spiBus">The SPI bus to which the MCP4142 is connected.</param>
/// <param name="chipSelect">The digital output port for the chip select (CS) pin.</param>
/// <param name="maxResistance">The maximum resistance of the rheostat.</param>
public Mcp4142(ISpiBus spiBus, IDigitalOutputPort chipSelect, Resistance maxResistance) :
base(spiBus, chipSelect, 1, maxResistance)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Meadow.Hardware;
using Meadow.Units;

namespace Meadow.Foundation.ICs.DigiPots;

/// <summary>
/// Represents an MCP4151 digital potentiometer.
/// </summary>
public class Mcp4151 : Mcp4xx1
{
/// <inheritdoc/>
public override int MaxSteps => 257;

/// <summary>
/// Initializes a new instance of the <see cref="Mcp4151"/> class.
/// </summary>
/// <param name="spiBus">The SPI bus to which the MCP4151 is connected.</param>
/// <param name="chipSelect">The digital output port for the chip select (CS) pin.</param>
/// <param name="maxResistance">The maximum resistance of the potentiometer.</param>
public Mcp4151(ISpiBus spiBus, IDigitalOutputPort chipSelect, Resistance maxResistance) :
base(spiBus, chipSelect, 1, maxResistance)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Meadow.Hardware;
using Meadow.Units;

namespace Meadow.Foundation.ICs.DigiPots;

/// <summary>
/// Represents an MCP4152 digital rheostat.
/// </summary>
public class Mcp4152 : Mcp4xx2
{
/// <inheritdoc/>
public override int MaxSteps => 257;

/// <summary>
/// Initializes a new instance of the <see cref="Mcp4152"/> class.
/// </summary>
/// <param name="spiBus">The SPI bus to which the MCP4152 is connected.</param>
/// <param name="chipSelect">The digital output port for the chip select (CS) pin.</param>
/// <param name="maxResistance">The maximum resistance of the rheostat.</param>
public Mcp4152(ISpiBus spiBus, IDigitalOutputPort chipSelect, Resistance maxResistance) :
base(spiBus, chipSelect, 1, maxResistance)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Meadow.Hardware;
using Meadow.Units;

namespace Meadow.Foundation.ICs.DigiPots;

/// <summary>
/// Represents an MCP4161 digital potentiometer.
/// </summary>
public class Mcp4161 : Mcp4xx1
{
/// <inheritdoc/>
public override int MaxSteps => 257;

/// <summary>
/// Initializes a new instance of the <see cref="Mcp4161"/> class.
/// </summary>
/// <param name="spiBus">The SPI bus to which the MCP4161 is connected.</param>
/// <param name="chipSelect">The digital output port for the chip select (CS) pin.</param>
/// <param name="maxResistance">The maximum resistance of the potentiometer.</param>
public Mcp4161(ISpiBus spiBus, IDigitalOutputPort chipSelect, Resistance maxResistance) :
base(spiBus, chipSelect, 1, maxResistance)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Meadow.Hardware;
using Meadow.Units;

namespace Meadow.Foundation.ICs.DigiPots;

/// <summary>
/// Represents an MCP4162 digital rheostat.
/// </summary>
public class Mcp4162 : Mcp4xx2
{
/// <inheritdoc/>
public override int MaxSteps => 257;

/// <summary>
/// Initializes a new instance of the <see cref="Mcp4162"/> class.
/// </summary>
/// <param name="spiBus">The SPI bus to which the MCP4162 is connected.</param>
/// <param name="chipSelect">The digital output port for the chip select (CS) pin.</param>
/// <param name="maxResistance">The maximum resistance of the rheostat.</param>
public Mcp4162(ISpiBus spiBus, IDigitalOutputPort chipSelect, Resistance maxResistance) :
base(spiBus, chipSelect, 1, maxResistance)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Meadow.Hardware;
using Meadow.Units;

namespace Meadow.Foundation.ICs.DigiPots;

/// <summary>
/// Represents an MCP4231 digital potentiometer.
/// </summary>
public class Mcp4231 : Mcp4xx1
{
/// <inheritdoc/>
public override int MaxSteps => 129;

/// <summary>
/// Initializes a new instance of the <see cref="Mcp4231"/> class.
/// </summary>
/// <param name="spiBus">The SPI bus to which the MCP4231 is connected.</param>
/// <param name="chipSelect">The digital output port for the chip select (CS) pin.</param>
/// <param name="maxResistance">The maximum resistance of the potentiometer.</param>
public Mcp4231(ISpiBus spiBus, IDigitalOutputPort chipSelect, Resistance maxResistance) :
base(spiBus, chipSelect, 2, maxResistance)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Meadow.Hardware;
using Meadow.Units;

namespace Meadow.Foundation.ICs.DigiPots;

/// <summary>
/// Represents an MCP4232 digital rheostat.
/// </summary>
public class Mcp4232 : Mcp4xx2
{
/// <inheritdoc/>
public override int MaxSteps => 129;

/// <summary>
/// Initializes a new instance of the <see cref="Mcp4232"/> class.
/// </summary>
/// <param name="spiBus">The SPI bus to which the MCP4232 is connected.</param>
/// <param name="chipSelect">The digital output port for the chip select (CS) pin.</param>
/// <param name="maxResistance">The maximum resistance of the rheostat.</param>
public Mcp4232(ISpiBus spiBus, IDigitalOutputPort chipSelect, Resistance maxResistance) :
base(spiBus, chipSelect, 2, maxResistance)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Meadow.Hardware;
using Meadow.Units;

namespace Meadow.Foundation.ICs.DigiPots;

/// <summary>
/// Represents an MCP4241 digital potentiometer.
/// </summary>
public class Mcp4241 : Mcp4xx1
{
/// <inheritdoc/>
public override int MaxSteps => 129;

/// <summary>
/// Initializes a new instance of the <see cref="Mcp4241"/> class.
/// </summary>
/// <param name="spiBus">The SPI bus to which the MCP4241 is connected.</param>
/// <param name="chipSelect">The digital output port for the chip select (CS) pin.</param>
/// <param name="maxResistance">The maximum resistance of the potentiometer.</param>
public Mcp4241(ISpiBus spiBus, IDigitalOutputPort chipSelect, Resistance maxResistance) :
base(spiBus, chipSelect, 2, maxResistance)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Meadow.Hardware;
using Meadow.Units;

namespace Meadow.Foundation.ICs.DigiPots;

/// <summary>
/// Represents an MCP4242 digital rheostat.
/// </summary>
public class Mcp4242 : Mcp4xx2
{
/// <inheritdoc/>
public override int MaxSteps => 129;

/// <summary>
/// Initializes a new instance of the <see cref="Mcp4242"/> class.
/// </summary>
/// <param name="spiBus">The SPI bus to which the MCP4242 is connected.</param>
/// <param name="chipSelect">The digital output port for the chip select (CS) pin.</param>
/// <param name="maxResistance">The maximum resistance of the rheostat.</param>
public Mcp4242(ISpiBus spiBus, IDigitalOutputPort chipSelect, Resistance maxResistance) :
base(spiBus, chipSelect, 2, maxResistance)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Meadow.Hardware;
using Meadow.Units;

namespace Meadow.Foundation.ICs.DigiPots;

/// <summary>
/// Represents an MCP4251 digital potentiometer.
/// </summary>
public class Mcp4251 : Mcp4xx1
{
/// <inheritdoc/>
public override int MaxSteps => 257;

/// <summary>
/// Initializes a new instance of the <see cref="Mcp4251"/> class.
/// </summary>
/// <param name="spiBus">The SPI bus to which the MCP4251 is connected.</param>
/// <param name="chipSelect">The digital output port for the chip select (CS) pin.</param>
/// <param name="maxResistance">The maximum resistance of the potentiometer.</param>
public Mcp4251(ISpiBus spiBus, IDigitalOutputPort chipSelect, Resistance maxResistance) :
base(spiBus, chipSelect, 2, maxResistance)
{
}
}
Loading
Loading