Skip to content

Commit

Permalink
Merge pull request #19 from WildernessLabs/develop
Browse files Browse the repository at this point in the history
Merge to main for RC2-2
  • Loading branch information
jorgedevs authored Mar 5, 2023
2 parents a22c862 + 498cd77 commit 8754f94
Show file tree
Hide file tree
Showing 18 changed files with 195 additions and 23 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/nuget-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ jobs:
path: Source/CGNSS10/Driver/CGNSS10.csproj
version: ${VERSION}
token: ${{ env.token }}


- uses: ./.github/actions/build-package
with:
packageId: Meadow.Foundation.mikroBUS.Sensors.Gnss.CGNSS5
path: Source/CGNSS5/Driver/CGNSS5.csproj
version: ${VERSION}
token: ${{ env.token }}

- uses: ./.github/actions/build-package
with:
packageId: Meadow.Foundation.mikroBUS.Sensors.Atmospheric.CTempHum15
Expand Down
5 changes: 2 additions & 3 deletions Source/C16x9/Driver/C16x9.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@ public C16x9(IDigitalOutputPort onOffPort, II2cBus i2cBus, byte address = (byte)
/// <summary>
/// Creates a CharlieWing driver
/// </summary>
/// <param name="device">Meadow device controller</param>
/// <param name="onOffPin">IO pin to controller display on/off state</param>
/// <param name="i2cBus">I2C bus</param>
public C16x9(IMeadowDevice device, IPin onOffPin, II2cBus i2cBus) :
this(device.CreateDigitalOutputPort(onOffPin), i2cBus, (byte)Is31fl3731.Addresses.Default)
public C16x9(IPin onOffPin, II2cBus i2cBus) :
this(onOffPin.CreateDigitalOutputPort(), i2cBus, (byte)Is31fl3731.Addresses.Default)
{
}

Expand Down
2 changes: 1 addition & 1 deletion Source/C16x9/Sample/C16x9G_Sample/MeadowApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public MeadowApp()
{
Console.WriteLine("Initializing ...");

c16x9 = new C16x9(Device, Device.Pins.D14, Device.CreateI2cBus(Meadow.Hardware.I2cBusSpeed.Standard));
c16x9 = new C16x9(Device.Pins.D14, Device.CreateI2cBus(Meadow.Hardware.I2cBusSpeed.Standard));
c16x9.IgnoreOutOfBoundsPixels = true;

c16x9.Clear();
Expand Down
5 changes: 2 additions & 3 deletions Source/C8800Retro/Driver/C8800Retro.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ 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)
public C8800Retro(II2cBus i2cBus, IPin buttonInterruptPin, byte address = 0)
: base(i2cBus, buttonInterruptPin, address)
{ }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="0.*" />
<PackageReference Include="Meadow.Foundation.mikroBUS.Sensors.Buttons.C8800Retro" Version="0.*" />
<ProjectReference Include="..\..\Driver\C8800Retro.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/C8800Retro/Sample/C8800Retro_Sample/MeadowApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public override Task Initialize()
{
Console.WriteLine("Initializing ...");

altair = new C8800Retro(Device, Device.CreateI2cBus(), Device.Pins.D03);
altair = new C8800Retro(Device.CreateI2cBus(), Device.Pins.D03);

var button1B = altair.GetButton(C8800Retro.ButtonColumn._1, C8800Retro.ButtonRow.B);
button1B.Clicked += Button1B_Clicked;
Expand Down
5 changes: 2 additions & 3 deletions Source/C8x8/Driver/C8x8.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ public C8x8(ISpiBus spiBus, IDigitalOutputPort chipselectPort)
/// <summary>
/// Creates a new MikroBus 8x8 object
/// </summary>
/// <param name="device">Meadow Device</param>
/// <param name="spiBus">SPI bus</param>
/// <param name="chipSelectPin">Chip select pin</param>
public C8x8(IMeadowDevice device, ISpiBus spiBus, IPin chipSelectPin)
: base(device, spiBus, chipSelectPin, 1, Max7219Mode.Display)
public C8x8(ISpiBus spiBus, IPin chipSelectPin)
: base(spiBus, chipSelectPin, 1, Max7219Mode.Display)
{ }
}
}
2 changes: 1 addition & 1 deletion Source/C8x8/Sample/C8x8_Sample/MeadowApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public MeadowApp()
{
Console.WriteLine("Initializing ...");

c8x8 = new C8x8(Device, Device.CreateSpiBus(), Device.Pins.D14);
c8x8 = new C8x8(Device.CreateSpiBus(), Device.Pins.D14);

var graphics = new MicroGraphics(c8x8)
{
Expand Down
7 changes: 3 additions & 4 deletions Source/CButton/Driver/CButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ public float Brightness
/// <summary>
/// Creates a new CButton object
/// </summary>
/// <param name="device">Meadow device</param>
/// <param name="ledPin">Led pin</param>
/// <param name="buttonPin">Button pin</param>
public CButton(IMeadowDevice device, IPin ledPin, IPin buttonPin)
: base(device, buttonPin, ResistorMode.InternalPullUp)
public CButton(IPin ledPin, IPin buttonPin)
: base(buttonPin, ResistorMode.InternalPullUp)
{
pwmLed = new PwmLed(device, ledPin, new Units.Voltage(TypicalForwardVoltage.Green));
pwmLed = new PwmLed(ledPin, new Units.Voltage(TypicalForwardVoltage.Green));
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Source/CButton/Sample/CButton_Sample/MeadowApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public MeadowApp()
{
Console.WriteLine("Initializing ...");

ledButton = new CButton(Device, Device.Pins.D03, Device.Pins.D04);
ledButton = new CButton(Device.Pins.D03, Device.Pins.D04);

ledButton.StartPulse(TimeSpan.FromSeconds(2), 0.75f, 0);
ledButton.Clicked += (s, e) =>
Expand Down
7 changes: 7 additions & 0 deletions Source/CGNSS10/Driver/CGNSS10.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,12 @@ public class CGNSS10 : NeoM8
public CGNSS10(ISpiBus spiBus, IDigitalOutputPort chipSelectPort, IDigitalOutputPort resetPort = null)
: base(spiBus, chipSelectPort, resetPort)
{ }

/// <summary>
/// Creates a new CGNSS10 object
/// </summary>
public CGNSS10(ISpiBus spiBus, IPin chipSelectPin, IPin resetPin = null)
: base(spiBus, chipSelectPin, resetPin)
{ }
}
}
25 changes: 25 additions & 0 deletions Source/CGNSS5/Driver/CGNSS5.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Meadow.Foundation.Sensors.Gnss;
using Meadow.Hardware;

namespace Meadow.Foundation.mikroBUS.Sensors.Gnss
{
/// <summary>
/// Represents a mikroBUS GNSS 5 board (Neo M8)
/// </summary>
public class CGNSS5 : NeoM8
{
/// <summary>
/// Creates a new CGNSS5 object using serial
/// </summary>
public CGNSS5(IMeadowDevice device, SerialPortName serialPortName, IPin resetPin, IPin ppsPin = null)
: base(device, serialPortName, resetPin, ppsPin)
{ }

/// <summary>
/// Creates a new CGNSS5 object using I2C
/// </summary>
public CGNSS5(II2cBus i2cBus, IPin resetPin, IPin ppsPin = null)
: base(i2cBus, (byte)Addresses.Default, resetPin: resetPin, ppsPin: ppsPin)
{ }
}
}
24 changes: 24 additions & 0 deletions Source/CGNSS5/Driver/CGNSS5.csproj
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>CGNSS5</AssemblyName>
<Company>Wilderness Labs, Inc</Company>
<PackageProjectUrl>http://developer.wildernesslabs.co/Meadow/Meadow.Foundation/</PackageProjectUrl>
<PackageId>Meadow.Foundation.mikroBUS.Sensors.Gnss.CGNSS5</PackageId>
<RepositoryUrl>https://github.com/WildernessLabs/Meadow.Foundation</RepositoryUrl>
<PackageTags>Meadow,Meadow.Foundation,MikroBus,Mikroe,MikroElectronika,GPS,GNSS,Click,5</PackageTags>
<Version>0.1.0</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>MikroElectronika Serial I2C Neo M8 GPS / GNSS 5 MikroBus click board</Description>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.Sensors.Gnss.NeoM8" Version="0.*" />
</ItemGroup>
</Project>
12 changes: 12 additions & 0 deletions Source/CGNSS5/Sample/CGNSS5_Sample/CGNSS5_Sample.csproj
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.*" />
<ProjectReference Include="..\..\Driver\CGNSS5.csproj" />
</ItemGroup>
</Project>
79 changes: 79 additions & 0 deletions Source/CGNSS5/Sample/CGNSS5_Sample/MeadowApp.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
using Meadow;
using Meadow.Devices;
using Meadow.Foundation.mikroBUS.Sensors.Gnss;
using Meadow.Peripherals.Sensors.Location.Gnss;
using System.Threading.Tasks;

namespace CGNSS5_Sample
{
// Change F7FeatherV2 to F7FeatherV1 for V1.x boards
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

CGNSS5 gps;

public override Task Initialize()
{
Resolver.Log.Info("Initializing ...");

//gps = new CGNSS5(Device.PlatformOS.GetSerialPortName("COM1"), Device.Pins.D09, Device.Pins.D11);

gps = new CGNSS5(Device.CreateI2cBus(), resetPin: Device.Pins.D09, ppsPin: Device.Pins.D11);

gps.GgaReceived += (object sender, GnssPositionInfo location) =>
{
Resolver.Log.Info("*********************************************");
Resolver.Log.Info($"{location}");
Resolver.Log.Info("*********************************************");
};
// GLL
gps.GllReceived += (object sender, GnssPositionInfo location) =>
{
Resolver.Log.Info("*********************************************");
Resolver.Log.Info($"{location}");
Resolver.Log.Info("*********************************************");
};
// GSA
gps.GsaReceived += (object sender, ActiveSatellites activeSatellites) =>
{
Resolver.Log.Info("*********************************************");
Resolver.Log.Info($"{activeSatellites}");
Resolver.Log.Info("*********************************************");
};
// RMC (recommended minimum)
gps.RmcReceived += (object sender, GnssPositionInfo positionCourseAndTime) =>
{
Resolver.Log.Info("*********************************************");
Resolver.Log.Info($"{positionCourseAndTime}");
Resolver.Log.Info("*********************************************");
};
// VTG (course made good)
gps.VtgReceived += (object sender, CourseOverGround courseAndVelocity) =>
{
Resolver.Log.Info("*********************************************");
Resolver.Log.Info($"{courseAndVelocity}");
Resolver.Log.Info("*********************************************");
};
// GSV (satellites in view)
gps.GsvReceived += (object sender, SatellitesInView satellites) =>
{
Resolver.Log.Info("*********************************************");
Resolver.Log.Info($"{satellites}");
Resolver.Log.Info("*********************************************");
};

return Task.CompletedTask;
}

public override Task Run()
{
gps.StartUpdating();

return Task.CompletedTask;
}

//<!=SNOP=>
}
}
5 changes: 2 additions & 3 deletions Source/CJoystick/Driver/CJoystick.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ public TimeSpan LongClickedThreshold
/// <summary>
/// Creates a mikroBUS Joystick Click board instance
/// </summary>
/// <param name="device">meadow device</param>
/// <param name="tstPin">TST pin</param>
/// <param name="i2cBus">I2C bus</param>
public CJoystick(IMeadowDevice device, IPin tstPin, II2cBus i2cBus) : base(i2cBus, (byte)Addresses.Default)
public CJoystick(IPin tstPin, II2cBus i2cBus) : base(i2cBus, (byte)Addresses.Default)
{
button = new PushButton(device, tstPin);
button = new PushButton(tstPin);

button.PressStarted += (s, e) => PressStarted?.Invoke(s, e);
button.PressEnded += (s, e) => PressEnded?.Invoke(s, e);
Expand Down
2 changes: 1 addition & 1 deletion Source/CJoystick/Sample/CJoystick_Sample/MeadowApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public MeadowApp()
{
Console.WriteLine("Initializing ...");

joystick = new CJoystick(Device, Device.Pins.A02, Device.CreateI2cBus());
joystick = new CJoystick(Device.Pins.A02, Device.CreateI2cBus());

//loop and read digital position
for (int i = 0; i < 100; i++)
Expand Down
23 changes: 23 additions & 0 deletions Source/mikroBUS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sensors.Atmospheric.Sht4x",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Displays.Max7219", "..\..\Meadow.Foundation\Source\Meadow.Foundation.Peripherals\Displays.Max7219\Driver\Displays.Max7219.csproj", "{0A92D618-C408-4A00-92E6-D36440D1E18D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CGNSS5", "CGNSS5", "{12F537E2-13DC-4023-89E4-9E8515809604}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CGNSS5", "CGNSS5\Driver\CGNSS5.csproj", "{EEDDAF1D-2E35-4A7A-8C94-9F6BCA9289FB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample", "Sample", "{C259536A-75D7-4D8A-B4F5-8C0306A897DE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CGNSS5_Sample", "CGNSS5\Sample\CGNSS5_Sample\CGNSS5_Sample.csproj", "{1B9F8444-BAC8-423C-9D01-3D354FB8C083}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -239,6 +247,18 @@ Global
{0A92D618-C408-4A00-92E6-D36440D1E18D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A92D618-C408-4A00-92E6-D36440D1E18D}.Release|Any CPU.Build.0 = Release|Any CPU
{0A92D618-C408-4A00-92E6-D36440D1E18D}.Release|Any CPU.Deploy.0 = Release|Any CPU
{EEDDAF1D-2E35-4A7A-8C94-9F6BCA9289FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEDDAF1D-2E35-4A7A-8C94-9F6BCA9289FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEDDAF1D-2E35-4A7A-8C94-9F6BCA9289FB}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{EEDDAF1D-2E35-4A7A-8C94-9F6BCA9289FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEDDAF1D-2E35-4A7A-8C94-9F6BCA9289FB}.Release|Any CPU.Build.0 = Release|Any CPU
{EEDDAF1D-2E35-4A7A-8C94-9F6BCA9289FB}.Release|Any CPU.Deploy.0 = Release|Any CPU
{1B9F8444-BAC8-423C-9D01-3D354FB8C083}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B9F8444-BAC8-423C-9D01-3D354FB8C083}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B9F8444-BAC8-423C-9D01-3D354FB8C083}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{1B9F8444-BAC8-423C-9D01-3D354FB8C083}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B9F8444-BAC8-423C-9D01-3D354FB8C083}.Release|Any CPU.Build.0 = Release|Any CPU
{1B9F8444-BAC8-423C-9D01-3D354FB8C083}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -276,6 +296,9 @@ Global
{A6675803-03EC-41E5-973F-12CD684FCA81} = {20E3A0B4-6103-4EAD-BD90-90C673E07DCC}
{A5DAEA7F-86B7-4BE8-834D-248F5B0CEBE6} = {20E3A0B4-6103-4EAD-BD90-90C673E07DCC}
{0A92D618-C408-4A00-92E6-D36440D1E18D} = {20E3A0B4-6103-4EAD-BD90-90C673E07DCC}
{EEDDAF1D-2E35-4A7A-8C94-9F6BCA9289FB} = {12F537E2-13DC-4023-89E4-9E8515809604}
{C259536A-75D7-4D8A-B4F5-8C0306A897DE} = {12F537E2-13DC-4023-89E4-9E8515809604}
{1B9F8444-BAC8-423C-9D01-3D354FB8C083} = {C259536A-75D7-4D8A-B4F5-8C0306A897DE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BF2FC8CE-57C6-468C-B82D-D8204E6D9360}
Expand Down

0 comments on commit 8754f94

Please sign in to comment.