diff --git a/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/Displays.Virtual.csproj b/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/Displays.Virtual.csproj new file mode 100644 index 000000000..bcf9c9512 --- /dev/null +++ b/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/Displays.Virtual.csproj @@ -0,0 +1,27 @@ + + + 1.11.0 + Readme.md + enable + 10.0 + Apache-2.0 + true + icon.png + Wilderness Labs, Inc + netstandard2.1 + Library + VirtualDisplays + Wilderness Labs, Inc + http://developer.wildernesslabs.co/Meadow/Meadow.Foundation/ + Meadow.Foundation.Displays.Virtual + https://github.com/WildernessLabs/Meadow.Foundation + Meadow,Meadow.Foundation,Displays + true + Meadow Desktop virtual displays + + + + + + + diff --git a/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/Epd5in65fVirtual.cs b/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/Epd5in65fVirtual.cs new file mode 100644 index 000000000..385482814 --- /dev/null +++ b/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/Epd5in65fVirtual.cs @@ -0,0 +1,16 @@ +using Meadow.Peripherals.Displays; + +namespace Meadow.Foundation.Displays; + +/// +/// A virtual display instance of the Epd5in65 epaper display. +/// +/// TODO: Move to epapers project when finished. +/// +public class Epd5in65fVirtual : VirtualDisplayBase +{ + public Epd5in65fVirtual() : base(600, 448, RotationType.Normal, ColorMode.Format4bppIndexed) + { + base.SupportedColorModes = ColorMode.Format4bppIndexed; + } +} \ No newline at end of file diff --git a/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/IVirtualDisplay.cs b/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/IVirtualDisplay.cs new file mode 100644 index 000000000..47fa73505 --- /dev/null +++ b/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/IVirtualDisplay.cs @@ -0,0 +1,7 @@ +using Meadow.Peripherals.Displays; + +namespace Meadow.Foundation.Displays; + +public interface IVirtualDisplay : IPixelDisplay +{ +} diff --git a/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/Ili9341Virtual.cs b/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/Ili9341Virtual.cs new file mode 100644 index 000000000..1b17c343d --- /dev/null +++ b/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/Ili9341Virtual.cs @@ -0,0 +1,17 @@ +using Meadow.Peripherals.Displays; + +namespace Meadow.Foundation.Displays; + +/// +/// Sample named virtual display +/// +/// TODO: Move this to the TFT Displays project after we're happy with implementation. Only in here right now for +/// convenience as a WiP. +/// +public class Ili9341Virtual : VirtualDisplayBase +{ + public Ili9341Virtual(RotationType rotationType = RotationType._270Degrees) + : base(240, 320, rotationType) + { + } +} diff --git a/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/Readme.md b/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/Readme.md new file mode 100644 index 000000000..d172c5ee8 --- /dev/null +++ b/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/Readme.md @@ -0,0 +1,86 @@ +# Meadow.Foundation.Displays.Uc1609c + +**Uc1609c SPI monochrome OLED display** + +The **Uc1609c** library is included in the **Meadow.Foundation.Displays.Uc1609c** 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.Displays.Uc1609c` +## Usage + +```csharp +MicroGraphics graphics; + +public override Task Initialize() +{ + Resolver.Log.Info("Initializing..."); + + var uc1609c = new Uc1609c + ( + spiBus: Device.CreateSpiBus(), + chipSelectPin: Device.Pins.A03, + dcPin: Device.Pins.A04, + resetPin: Device.Pins.A05, + width: 192, + height: 64 + ); + + graphics = new MicroGraphics(uc1609c) + { + CurrentFont = new Font8x8() + }; + + return base.Initialize(); +} + +public override Task Run() +{ + graphics.Clear(); + graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false); + graphics.DrawRectangle(20, 15, 40, 20, true); + graphics.DrawText(5, 5, "UC1609C"); + graphics.DrawCircle(96, 32, 16); + graphics.Show(); + + Resolver.Log.Info("Run complete"); + + return base.Run(); +} + +``` +## 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](https://github.com/WildernessLabs/Meadow.Foundation) 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. + + diff --git a/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/VirtualDisplayBase.cs b/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/VirtualDisplayBase.cs new file mode 100644 index 000000000..12841fd2e --- /dev/null +++ b/Source/Meadow.Foundation.Peripherals/Displays.Virtual/Driver/VirtualDisplayBase.cs @@ -0,0 +1,89 @@ +using Meadow.Peripherals.Displays; + +namespace Meadow.Foundation.Displays; + +public class VirtualDisplayBase : IResizablePixelDisplay +{ + public RotationType Rotation { get; } + /// + public ColorMode ColorMode { get; } + /// + public ColorMode SupportedColorModes { get; protected set; } + /// + public int Width { get; } + /// + public int Height { get; } + + protected VirtualDisplayBase( + int width, int height, + RotationType rotationType, + ColorMode colorMode = ColorMode.Format24bppRgb888) + { + Width = width; + Height = height; + Rotation = rotationType; + ColorMode = colorMode; + } + + /// + public IPixelBuffer PixelBuffer => throw new System.NotImplementedException(); + + /// + public void Clear(bool updateDisplay = false) + { + throw new System.NotImplementedException(); + } + + /// + public void DrawPixel(int x, int y, Color color) + { + throw new System.NotImplementedException(); + } + + /// + public void DrawPixel(int x, int y, bool enabled) + { + throw new System.NotImplementedException(); + } + + /// + public void Fill(Color fillColor, bool updateDisplay = false) + { + throw new System.NotImplementedException(); + } + + /// + public void Fill(int x, int y, int width, int height, Color fillColor) + { + throw new System.NotImplementedException(); + } + + /// + public void InvertPixel(int x, int y) + { + throw new System.NotImplementedException(); + } + + /// + public void Show() + { + throw new System.NotImplementedException(); + } + + /// + public void Show(int left, int top, int right, int bottom) + { + throw new System.NotImplementedException(); + } + + /// + public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer) + { + throw new System.NotImplementedException(); + } + + public void Resize(int width, int height, float displayScale = 1) + { + throw new System.NotImplementedException(); + } +} diff --git a/Source/Meadow.Foundation.sln b/Source/Meadow.Foundation.sln index 20a6a49de..9da1ea5e9 100644 --- a/Source/Meadow.Foundation.sln +++ b/Source/Meadow.Foundation.sln @@ -1632,8 +1632,13 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Keller XLine", "Keller XLine", "{2240AB38-3CC6-4800-8556-D3BB5C44B720}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sensors.Environmental.Keller.XLine", "Meadow.Foundation.Peripherals\Sensors.Environmental.Keller.XLine\Driver\Sensors.Environmental.Keller.XLine.csproj", "{729B86E1-49EE-4668-A599-8D7C28842F9E}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Epd2in15g_Sample", "Meadow.Foundation.Peripherals\Displays.ePaperWaveShare\Samples\Epd2in15g_Sample\Epd2in15g_Sample.csproj", "{EA8D8CA1-BB32-49D6-88CF-9EB50ABDC44B}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Virtual", "Virtual", "{B3A7C8DE-0F13-43DF-AEAC-3A545CEABB41}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Displays.Virtual", "Meadow.Foundation.Peripherals\Displays.Virtual\Driver\Displays.Virtual.csproj", "{108AA141-D896-4D9B-8675-89714104B2AB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -3954,6 +3959,12 @@ Global {EA8D8CA1-BB32-49D6-88CF-9EB50ABDC44B}.Release|Any CPU.ActiveCfg = Release|Any CPU {EA8D8CA1-BB32-49D6-88CF-9EB50ABDC44B}.Release|Any CPU.Build.0 = Release|Any CPU {EA8D8CA1-BB32-49D6-88CF-9EB50ABDC44B}.Release|Any CPU.Deploy.0 = Release|Any CPU + {108AA141-D896-4D9B-8675-89714104B2AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {108AA141-D896-4D9B-8675-89714104B2AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {108AA141-D896-4D9B-8675-89714104B2AB}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {108AA141-D896-4D9B-8675-89714104B2AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {108AA141-D896-4D9B-8675-89714104B2AB}.Release|Any CPU.Build.0 = Release|Any CPU + {108AA141-D896-4D9B-8675-89714104B2AB}.Release|Any CPU.Deploy.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -4768,6 +4779,8 @@ Global {2240AB38-3CC6-4800-8556-D3BB5C44B720} = {78E463DA-0FA1-4AAE-A281-D3297C9388C9} {729B86E1-49EE-4668-A599-8D7C28842F9E} = {2240AB38-3CC6-4800-8556-D3BB5C44B720} {EA8D8CA1-BB32-49D6-88CF-9EB50ABDC44B} = {7311794D-7D2F-47E8-A5B0-C216CBD64A13} + {B3A7C8DE-0F13-43DF-AEAC-3A545CEABB41} = {2B794146-DFEE-475A-B919-7D3ED48587B8} + {108AA141-D896-4D9B-8675-89714104B2AB} = {B3A7C8DE-0F13-43DF-AEAC-3A545CEABB41} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {AF7CA16F-8C38-4546-87A2-5DAAF58A1520}