Skip to content

Commit

Permalink
Merge pull request #74 from WildernessLabs/v2.0.1.2
Browse files Browse the repository at this point in the history
Release 2.0.1.2
  • Loading branch information
jorgedevs authored Jan 19, 2025
2 parents aef12e8 + db04cef commit c200a88
Show file tree
Hide file tree
Showing 40 changed files with 605 additions and 420 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/develop-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Develop Build
on:
workflow_dispatch:
pull_request:
branches: [ develop ]
push:
branches: [ develop ]

Expand Down Expand Up @@ -69,7 +70,6 @@ jobs:
uses: actions/checkout@v3
with:
path: Meadow.Foundation.FeatherWings
ref: develop

- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
Expand Down
23 changes: 23 additions & 0 deletions Source/CanBusWing/Driver/CanBusWing.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Meadow.Foundation.ICs.CAN;
using Meadow.Hardware;
using Meadow.Units;

namespace Meadow.Foundation.FeatherWings
{
/// <summary>
/// Represents an Adafruit CAN Bus featherwing
/// </summary>
public class CanBusWing : Mcp2515
{
/// <summary>
/// Creates a CanBusWing driver
/// </summary>
public CanBusWing(IF7FeatherMeadowDevice feather)
: base(
bus: feather.CreateSpiBus(3, 1_000_000.Hertz()),
chipSelect: feather.Pins.D09.CreateDigitalOutputPort(true),
interruptPort: feather.Pins.D10.CreateDigitalInterruptPort(InterruptMode.EdgeFalling),
oscillator: CanOscillator.Osc_16MHz)
{ }
}
}
29 changes: 29 additions & 0 deletions Source/CanBusWing/Driver/CanBusWing.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Meadow.Sdk/1.1.0">
<PropertyGroup>
<Version>1.11.0</Version>
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageIcon>icon.png</PackageIcon>
<Authors>Wilderness Labs, Inc</Authors>
<TargetFramework>netstandard2.1</TargetFramework>
<OutputType>Library</OutputType>
<AssemblyName>CanBusWing</AssemblyName>
<Company>Wilderness Labs, Inc</Company>
<PackageProjectUrl>http://developer.wildernesslabs.co/Meadow/Meadow.Foundation/</PackageProjectUrl>
<PackageId>Meadow.Foundation.FeatherWings.CanBusWing</PackageId>
<RepositoryUrl>https://github.com/WildernessLabs/Meadow.Foundation.FeatherWings</RepositoryUrl>
<PackageTags>Meadow.Foundation, CanBusWing, CAN</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>AdaFruit CAN Bus FeatherWing</Description>
</PropertyGroup>
<ItemGroup>
<None Include=".\Readme.md" Pack="true" PackagePath="" />
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="2.0.1.2" />
<PackageReference Include="Meadow.Foundation.ICs.CAN.Mcp2515" Version="2.0.1.2" />
</ItemGroup>
</Project>
99 changes: 99 additions & 0 deletions Source/CanBusWing/Driver/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Meadow.Foundation.FeatherWings.CanBusWing

**AdaFruit CAN Bus FeatherWing**

The **CanBusWing** library is included in the **Meadow.Foundation.FeatherWings.CanBusWing** nuget package and is designed for the [Wilderness Labs](www.wildernesslabs.co) Meadow .NET IoT platform.

This driver is part of the [Meadow.Foundation](https://developer.wildernesslabs.co/Meadow/Meadow.Foundation/) peripherals library, an open-source repository of drivers and libraries that streamline and simplify adding hardware to your C# .NET Meadow IoT applications.

For more information on developing for Meadow, visit [developer.wildernesslabs.co](http://developer.wildernesslabs.co/).

To view all Wilderness Labs open-source projects, including samples, visit [github.com/wildernesslabs](https://github.com/wildernesslabs/).

## Installation

You can install the library from within Visual studio using the the NuGet Package Manager or from the command line using the .NET CLI:

`dotnet add package Meadow.Foundation.FeatherWings.CanBusWing`
## Usage

```csharp
private CanBusWing wing;

public override Task Initialize()
{
Console.WriteLine("Initialize...");

wing = new CanBusWing(Device);

return Task.CompletedTask;
}

public override async Task Run()
{
var bus = wing.CreateCanBus(CanBitrate.Can_250kbps);

Console.WriteLine($"Listening for CAN data...");

var tick = 0;

while (true)
{
var frame = bus.ReadFrame();
if (frame != null)
{
if (frame is StandardDataFrame sdf)
{
Console.WriteLine($"Standard Frame: {sdf.ID:X3} {BitConverter.ToString(sdf.Payload)}");
}
else if (frame is ExtendedDataFrame edf)
{
Console.WriteLine($"Extended Frame: {edf.ID:X8} {BitConverter.ToString(edf.Payload)}");
}
}
else
{
await Task.Delay(100);
}

if (tick++ % 50 == 0)
{
Console.WriteLine($"Sending Standard Frame...");

bus.WriteFrame(new StandardDataFrame
{
ID = 0x700,
Payload = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, (byte)(tick & 0xff) }
});
}
}
}

```
## How to Contribute

- **Found a bug?** [Report an issue](https://github.com/WildernessLabs/Meadow_Issues/issues)
- Have a **feature idea or driver request?** [Open a new feature request](https://github.com/WildernessLabs/Meadow_Issues/issues)
- Want to **contribute code?** Fork the [Meadow.Foundation.Featherwings](https://github.com/WildernessLabs/Meadow.Foundation.Featherwings) repository and submit a pull request against the `develop` branch


## Need Help?

If you have questions or need assistance, please join the Wilderness Labs [community on Slack](http://slackinvite.wildernesslabs.co/).
## About Meadow

Meadow is a complete, IoT platform with defense-grade security that runs full .NET applications on embeddable microcontrollers and Linux single-board computers including Raspberry Pi and NVIDIA Jetson.

### Build

Use the full .NET platform and tooling such as Visual Studio and plug-and-play hardware drivers to painlessly build IoT solutions.

### Connect

Utilize native support for WiFi, Ethernet, and Cellular connectivity to send sensor data to the Cloud and remotely control your peripherals.

### Deploy

Instantly deploy and manage your fleet in the cloud for OtA, health-monitoring, logs, command + control, and enterprise backend integrations.


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="2.0.1.2" />
<ProjectReference Include="..\..\Driver\CanBusWing.csproj" />
</ItemGroup>
</Project>
67 changes: 67 additions & 0 deletions Source/CanBusWing/Samples/CanBusWing_Sample/MeadowApp.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using Meadow;
using Meadow.Devices;
using Meadow.Foundation.FeatherWings;
using Meadow.Hardware;
using System;
using System.Threading.Tasks;

namespace MeadowApp
{
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

private CanBusWing wing;

public override Task Initialize()
{
Console.WriteLine("Initialize...");

wing = new CanBusWing(Device);

return Task.CompletedTask;
}

public override async Task Run()
{
var bus = wing.CreateCanBus(CanBitrate.Can_250kbps);

Console.WriteLine($"Listening for CAN data...");

var tick = 0;

while (true)
{
var frame = bus.ReadFrame();
if (frame != null)
{
if (frame is StandardDataFrame sdf)
{
Console.WriteLine($"Standard Frame: {sdf.ID:X3} {BitConverter.ToString(sdf.Payload)}");
}
else if (frame is ExtendedDataFrame edf)
{
Console.WriteLine($"Extended Frame: {edf.ID:X8} {BitConverter.ToString(edf.Payload)}");
}
}
else
{
await Task.Delay(100);
}

if (tick++ % 50 == 0)
{
Console.WriteLine($"Sending Standard Frame...");

bus.WriteFrame(new StandardDataFrame
{
ID = 0x700,
Payload = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, (byte)(tick & 0xff) }
});
}
}
}

//<!=SNOP=>
}
}
2 changes: 1 addition & 1 deletion Source/CharlieWing/Driver/CharlieWing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.Is31fl3731" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.Is31fl3731" Version="2.0.1.2" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="1.12.0" />
<PackageReference Include="Meadow.F7" Version="2.0.1.2" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="2.0.1.2" />
<ProjectReference Include="..\..\Driver\CharlieWing.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/DotstarWing/Driver/DotstarWing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.Leds.Apa102" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Leds.Apa102" Version="2.0.1.2" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="1.12.0" />
<PackageReference Include="Meadow.F7" Version="2.0.1.2" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="2.0.1.2" />
<ProjectReference Include="..\..\Driver\DotstarWing.csproj" />
</ItemGroup>
</Project>
23 changes: 23 additions & 0 deletions Source/FeatherWings.sln
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OLED128x64Wing", "OLED128x6
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OLED128x64Wing_Sample", "OLED128x64Wing\Sample\OLED128x64Wing_Sample\OLED128x64Wing_Sample.csproj", "{7068B557-1B72-44C1-BF2B-36EFBB8E78D3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CanBusWing", "CanBusWing", "{1F1C8ECF-78B9-499D-9C88-CD15CA67C8C2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CanBusWing", "CanBusWing\Driver\CanBusWing.csproj", "{6C912C2A-2B18-49B5-A87D-C9DC38913F03}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample", "Sample", "{828928C2-ABC1-4565-AEE1-D98550C70552}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CanBusWing_Sample", "CanBusWing\Samples\CanBusWing_Sample\CanBusWing_Sample.csproj", "{3B2AE891-DC5B-44FB-861D-528D9EF16010}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -229,6 +237,18 @@ Global
{7068B557-1B72-44C1-BF2B-36EFBB8E78D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7068B557-1B72-44C1-BF2B-36EFBB8E78D3}.Release|Any CPU.Build.0 = Release|Any CPU
{7068B557-1B72-44C1-BF2B-36EFBB8E78D3}.Release|Any CPU.Deploy.0 = Release|Any CPU
{6C912C2A-2B18-49B5-A87D-C9DC38913F03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6C912C2A-2B18-49B5-A87D-C9DC38913F03}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6C912C2A-2B18-49B5-A87D-C9DC38913F03}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{6C912C2A-2B18-49B5-A87D-C9DC38913F03}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6C912C2A-2B18-49B5-A87D-C9DC38913F03}.Release|Any CPU.Build.0 = Release|Any CPU
{6C912C2A-2B18-49B5-A87D-C9DC38913F03}.Release|Any CPU.Deploy.0 = Release|Any CPU
{3B2AE891-DC5B-44FB-861D-528D9EF16010}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B2AE891-DC5B-44FB-861D-528D9EF16010}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B2AE891-DC5B-44FB-861D-528D9EF16010}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{3B2AE891-DC5B-44FB-861D-528D9EF16010}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B2AE891-DC5B-44FB-861D-528D9EF16010}.Release|Any CPU.Build.0 = Release|Any CPU
{3B2AE891-DC5B-44FB-861D-528D9EF16010}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -267,6 +287,9 @@ Global
{8AEC28BA-BACD-47A5-BFEC-95F7624B0B7F} = {C589E391-452A-4DC1-B260-487014DA27CE}
{E7671E7B-C24D-4C69-865B-56D457C0EF1D} = {C589E391-452A-4DC1-B260-487014DA27CE}
{7068B557-1B72-44C1-BF2B-36EFBB8E78D3} = {8AEC28BA-BACD-47A5-BFEC-95F7624B0B7F}
{6C912C2A-2B18-49B5-A87D-C9DC38913F03} = {1F1C8ECF-78B9-499D-9C88-CD15CA67C8C2}
{828928C2-ABC1-4565-AEE1-D98550C70552} = {1F1C8ECF-78B9-499D-9C88-CD15CA67C8C2}
{3B2AE891-DC5B-44FB-861D-528D9EF16010} = {828928C2-ABC1-4565-AEE1-D98550C70552}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {673CD5FD-E4C7-48D7-85EA-3CB6FAD87939}
Expand Down
2 changes: 1 addition & 1 deletion Source/GPSWing/Driver/GPSWing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.Sensors.Gnss.Mt3339" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Sensors.Gnss.Mt3339" Version="2.0.1.2" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<PackageReference Include="Meadow.F7" Version="2.0.1.2" />
<ProjectReference Include="..\..\Driver\GPSWing.csproj" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions Source/KeyboardWing/Driver/KeyboardWing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.Displays.TftSpi" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Sensors.Hid.Bbq10Keyboard" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Sensors.Hid.Tsc2004" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Displays.TftSpi" Version="2.0.1.2" />
<PackageReference Include="Meadow.Foundation.Sensors.Hid.Bbq10Keyboard" Version="2.0.1.2" />
<PackageReference Include="Meadow.Foundation.Sensors.Hid.Tsc2004" Version="2.0.1.2" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<PackageReference Include="Meadow.F7" Version="2.0.1.2" />
<ProjectReference Include="..\..\Driver\KeyboardWing.csproj" />
</ItemGroup>
</Project>
7 changes: 5 additions & 2 deletions Source/LedMatrix8x16Wing/Driver/LedMatrix8x16Wing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ public void Fill(Color fillColor, bool updateDisplay = false)
{
Fill(0, 0, Width, Height, fillColor);

if (updateDisplay) Show();
if (updateDisplay)
{
Show();
}
}

/// <summary>
Expand All @@ -174,7 +177,7 @@ public void Fill(int x, int y, int width, int height, Color fillColor)
{
for (int j = 0; j < height; j++)
{
DrawPixel(i, j, isColored);
DrawPixel(x + i, y + j, isColored);
}
}
}
Expand Down
Loading

0 comments on commit c200a88

Please sign in to comment.