-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from WildernessLabs/develop
Update to RC1
- Loading branch information
Showing
28 changed files
with
473 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
namespace Meadow.Foundation.mikroBUS.Displays | ||
{ | ||
public partial class C8800Retro | ||
{ | ||
/// <summary> | ||
/// Button array columns (1-4) | ||
/// </summary> | ||
public enum ButtonColumn | ||
{ | ||
/// <summary> | ||
/// Button column 1 | ||
/// </summary> | ||
_1, | ||
/// <summary> | ||
/// Button column 2 | ||
/// </summary> | ||
_2, | ||
/// <summary> | ||
/// Button column 3 | ||
/// </summary> | ||
_3, | ||
/// <summary> | ||
/// Button column 4 | ||
/// </summary> | ||
_4, | ||
} | ||
|
||
/// <summary> | ||
/// Button array rows (A-D) | ||
/// </summary> | ||
public enum ButtonRow | ||
{ | ||
/// <summary> | ||
/// Button row A | ||
/// </summary> | ||
A, | ||
/// <summary> | ||
/// Button row B | ||
/// </summary> | ||
B, | ||
/// <summary> | ||
/// Button row C | ||
/// </summary> | ||
C, | ||
/// <summary> | ||
/// Button row D | ||
/// </summary> | ||
D, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
using Meadow.Foundation.ICs.IOExpanders; | ||
using Meadow.Hardware; | ||
using Meadow.Peripherals.Sensors.Buttons; | ||
|
||
namespace Meadow.Foundation.mikroBUS.Displays | ||
{ | ||
/// <summary> | ||
/// Represents a mikroBUS Altair 8800 Retro click board | ||
/// </summary> | ||
public partial class C8800Retro : As1115 | ||
{ | ||
/// <summary> | ||
/// Creates an Altair 8800 retro click board object | ||
/// </summary> | ||
/// <param name="device">The Meadow device</param> | ||
/// <param name="i2cBus">The I2C bus</param> | ||
/// <param name="buttonInterruptPin">The interrupt pin</param> | ||
/// <param name="address">The I2C address</param> | ||
public C8800Retro(IMeadowDevice device, II2cBus i2cBus, IPin buttonInterruptPin, byte address = 0) | ||
: base(device, i2cBus, buttonInterruptPin, address) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Get the button for a given row and column | ||
/// </summary> | ||
/// <param name="column">The column of the button (1-4)</param> | ||
/// <param name="row">The row of the button (A-D)</param> | ||
/// <returns>The IButton object</returns> | ||
public IButton GetButton(ButtonColumn column, ButtonRow row) | ||
{ | ||
KeyScanButtonType buttonType = KeyScanButtonType.None; | ||
|
||
if(row == ButtonRow.A) | ||
{ | ||
buttonType = column switch | ||
{ | ||
ButtonColumn._1 => KeyScanButtonType.Button1, | ||
ButtonColumn._2 => KeyScanButtonType.Button2, | ||
ButtonColumn._3 => KeyScanButtonType.Button3, | ||
ButtonColumn._4 => KeyScanButtonType.Button4, | ||
_ => KeyScanButtonType.None | ||
}; | ||
} | ||
if (row == ButtonRow.B) | ||
{ | ||
buttonType = column switch | ||
{ | ||
ButtonColumn._1 => KeyScanButtonType.Button5, | ||
ButtonColumn._2 => KeyScanButtonType.Button6, | ||
ButtonColumn._3 => KeyScanButtonType.Button7, | ||
ButtonColumn._4 => KeyScanButtonType.Button8, | ||
_ => KeyScanButtonType.None | ||
}; | ||
} | ||
if (row == ButtonRow.C) | ||
{ | ||
buttonType = column switch | ||
{ | ||
ButtonColumn._1 => KeyScanButtonType.Button9, | ||
ButtonColumn._2 => KeyScanButtonType.Button10, | ||
ButtonColumn._3 => KeyScanButtonType.Button11, | ||
ButtonColumn._4 => KeyScanButtonType.Button12, | ||
_ => KeyScanButtonType.None | ||
}; | ||
} | ||
if (row == ButtonRow.D) | ||
{ | ||
buttonType = column switch | ||
{ | ||
ButtonColumn._1 => KeyScanButtonType.Button13, | ||
ButtonColumn._2 => KeyScanButtonType.Button14, | ||
ButtonColumn._3 => KeyScanButtonType.Button15, | ||
ButtonColumn._4 => KeyScanButtonType.Button16, | ||
_ => KeyScanButtonType.None | ||
}; | ||
} | ||
|
||
return KeyScanButtons[buttonType]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<Project Sdk="Meadow.Sdk/1.1.0"> | ||
<PropertyGroup> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<PackageIcon>icon.png</PackageIcon> | ||
<Authors>Wilderness Labs, Inc</Authors> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
<OutputType>Library</OutputType> | ||
<AssemblyName>C8800Retro</AssemblyName> | ||
<Company>Wilderness Labs, Inc</Company> | ||
<PackageProjectUrl>http://developer.wildernesslabs.co/Meadow/Meadow.Foundation/</PackageProjectUrl> | ||
<PackageId>Meadow.Foundation.mikroBUS.Sensors.Buttons.C8800Retro</PackageId> | ||
<RepositoryUrl>https://github.com/WildernessLabs/Meadow.Foundation</RepositoryUrl> | ||
<PackageTags>Meadow, Meadow.Foundation, altair, as1115, retro, MikroBus, Mikroe, MikroElectronika, buttons, leds, led driver, keyscan</PackageTags> | ||
<Version>0.1.0</Version> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<Description>MikroElectronika Altair 8800 I2C led driver and keyscan MikroBus retro click board</Description> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<None Include="..\..\icon.png" Pack="true" PackagePath="" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.As1115" Version="0.*" /> | ||
</ItemGroup> | ||
</Project> |
12 changes: 12 additions & 0 deletions
12
Source/C8800Retro/Sample/C8800Retro_Sample/C8800Retro_Sample.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Meadow.Sdk/1.1.0"> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> | ||
<OutputType>Library</OutputType> | ||
<AssemblyName>App</AssemblyName> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Meadow.F7" Version="0.*" /> | ||
<PackageReference Include="Meadow.Foundation.mikroBUS.Sensors.Buttons.C8800Retro" Version="0.*" /> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.