diff --git a/.gitignore b/.gitignore index d7dec62f..79e57d7c 100644 --- a/.gitignore +++ b/.gitignore @@ -331,3 +331,6 @@ ASALocalRun/ #SoundCloud *.sonarqube/ + +#VSCode +*.vscode/ diff --git a/M5StackCommon/Console.cs b/M5StackCommon/Console.cs index 119d2419..50092815 100644 --- a/M5StackCommon/Console.cs +++ b/M5StackCommon/Console.cs @@ -3,9 +3,8 @@ using nanoFramework.Presentation.Media; using nanoFramework.UI; -using System; -namespace nanoFramework +namespace nanoFramework.M5Stack { /// /// Console class to display text on screens diff --git a/M5StackCommon/ScreenBase.cs b/M5StackCommon/ScreenBase.cs index b08b8f87..5539abf6 100644 --- a/M5StackCommon/ScreenBase.cs +++ b/M5StackCommon/ScreenBase.cs @@ -3,7 +3,6 @@ using nanoFramework.Presentation.Media; using nanoFramework.UI; -using System; using System.Device.Gpio; namespace nanoFramework.M5Stack diff --git a/README.md b/README.md index d0ac5089..009982d2 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ ----- -# Welcome to the .NET **nanoFramework** M5Stack Library repository +# Welcome to the .NET **nanoFramework** M5Stack Libraries repository ## Build status | Component | Build Status | NuGet Package | |:-|---|---| -| nanoFramework.M5Stack | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.M5Stack/_apis/build/status/nanoFramework.M5Stack?repoName=nanoframework%2FnanoFramework.M5Stack&branchName=main)](https://dev.azure.com/nanoframework/nanoFramework.M5Stack/_build/latest?definitionId=52&repoName=nanoframework%2FnanoFramework.M5Stack&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.M5Stack.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.M5Stack/) | -| nanoFramework.M5Stack (preview) | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.M5Stack/_apis/build/status/nanoFramework.M5Stack?repoName=nanoframework%2FnanoFramework.M5Stack&branchName=develop)](https://dev.azure.com/nanoframework/nanoFramework.M5Stack/_build/latest?definitionId=52&repoName=nanoframework%2FnanoFramework.M5Stack&branchName=develop) | [![NuGet](https://img.shields.io/nuget/vpre/nanoFramework.M5Stack.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.M5Stack/) | +| nanoFramework.M5Core | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.M5Stack/_apis/build/status/nanoFramework.M5Stack?repoName=nanoframework%2FnanoFramework.M5Stack&branchName=main)](https://dev.azure.com/nanoframework/nanoFramework.M5Stack/_build/latest?definitionId=52&repoName=nanoframework%2FnanoFramework.M5Stack&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.M5Core.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.M5Stack/) | +| nanoFramework.M5Core (preview) | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.M5Stack/_apis/build/status/nanoFramework.M5Stack?repoName=nanoframework%2FnanoFramework.M5Stack&branchName=develop)](https://dev.azure.com/nanoframework/nanoFramework.M5Stack/_build/latest?definitionId=52&repoName=nanoframework%2FnanoFramework.M5Stack&branchName=develop) | [![NuGet](https://img.shields.io/nuget/vpre/nanoFramework.M5Core.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.M5Stack/) | | nanoFramework.M5Stick | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.M5Stack/_apis/build/status/nanoFramework.M5Stack?repoName=nanoframework%2FnanoFramework.M5Stack&branchName=main)](https://dev.azure.com/nanoframework/nanoFramework.M5Stack/_build/latest?definitionId=52&repoName=nanoframework%2FnanoFramework.M5Stack&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.M5StickC.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.M5StickC/) | | nanoFramework.M5Stick (preview) | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.M5Stack/_apis/build/status/nanoFramework.M5Stack?repoName=nanoframework%2FnanoFramework.M5Stack&branchName=develop)](https://dev.azure.com/nanoframework/nanoFramework.M5Stack/_build/latest?definitionId=52&repoName=nanoframework%2FnanoFramework.M5Stack&branchName=develop) | [![NuGet](https://img.shields.io/nuget/vpre/nanoFramework.M5StickC.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.M5StickC/) | | nanoFramework.M5StickCPlus | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.M5Stack/_apis/build/status/nanoFramework.M5Stack?repoName=nanoframework%2FnanoFramework.M5Stack&branchName=main)](https://dev.azure.com/nanoframework/nanoFramework.M5Stack/_build/latest?definitionId=52&repoName=nanoframework%2FnanoFramework.M5Stack&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.M5StickCPlus.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.M5StickCPlus/) | @@ -21,38 +21,52 @@ ## Usage -These NuGet packages provide a support for M5Stack products: -- [Core (gray)](https://docs.m5stack.com/en/products?id=core) +These NuGet packages provide a support for M5Stack products: + +- [Core (gray) and Basic](https://docs.m5stack.com/en/products?id=core) - [M5StickC](https://docs.m5stack.com/en/core/m5stickc) -- [M5StickCPlus](https://docs.m5stack.com/en/core/m5stickc_plus) -- [M5Core2](https://docs.m5stack.com/en/core/core2). +- [M5StickCPlus](https://docs.m5stack.com/en/core/m5stickc_plus) +- [M5Core2](https://docs.m5stack.com/en/core/core2) -IMPORTANT: The M5Stack NuGet Package must only be used for application targeting the M5 Stack's Core (gray); the other 3 NuGets must be used individually depending on your target according its name. NOTE1: Before trying to add NuGet packages to your projects and/or before flashing the devices (see next section) using MS Visual Studio (VS), open VS > Tools > Options > NuGet Package Manager > Package Sources and make sure that it contains an entry pointing to https://api.nuget.org/v3/index.json , otherwise add it. NOTE2: When invoking VS > Project > Manage NuGet Packages make sure that in the Package source drop-down menu (right upper corner) "nuget.org" is selected. Also if you're using preview version the "include prerelease" checkbox should be clicked/selected as well. -The NuGets bring support for the screens as well and require to be flashed with the proper image (using dotnet CLI): +The NuGets bring support for the screens as well and require to be flashed with the proper image (using [`nanoff`](https://github.com/nanoframework/nanoFirmwareFlasher) dotnet CLI). +On the examples below replace `COM3` with the appropriate number of the COM port to which your device is connected. (on Windows you can check this in the Device Manager). + +For the M5Core: + +```shell +nanoff --target M5Core --update --preview --serialport COM3 +``` + +For the M5StickC: ```shell -# Replace `COM3` with the appropriate number of the COM port to which your device is connected. (on Windows you can check this in the Device Manager). -# For the M5Stack: -nanoff --target M5Stack --update --preview --serialport COM3 -# For the M5StickC: nanoff --target M5StickC --update --preview --serialport COM3 --baud 115200 -# For the M5StickCPlus: -nanoff --target M5StickCPlus --update --preview --serialport COM3 --baud 115200 -# For the M5Core2: +``` + +For the M5StickCPlus: + +```shell +nanoff --target M5StickCPlus --update --preview --serialport COM3 +``` + +For the M5Core2: + +```shell nanoff --target M5Core2 --update --preview --serialport COM3 ``` -NOTE3: If the nanoff commands fails, make sure you have followed instruction from NOTE1 above. -Once you have the nugets, you can then enjoy accessing the screen, the accelerometer, get a Grove I2C connecter, add events on the buttons. And you don't even need to think about anything, all is done for you in the most transparent way! +NOTE3: If the `nanoff` commands fails, make sure you have followed instruction from NOTE1 above. + +Once you have the NuGets, you can then enjoy accessing the screen, the accelerometer, get a Grove I2C connecter, add events on the buttons. And you don't even need to think about anything, all is done for you in the most transparent way! > Note: All the classes that you'll have access are all using the Lazy pattern to be instantiated including the screen. This have the advantage to use as little memory and setup time as possible. -In the samples below, we'll use either M5Stack, either M5Stick as examples, they are all working in a very similar way. +In the samples below, we'll use either M5Core or M5Stick as examples, they are all working in a very similar way. -### namespaces +### Namespaces Make sure you add the proper namespaces reference to your C# program header e.g. using nanoFramework; @@ -64,7 +78,7 @@ The only thing you need to do to access the screen is to initialize it (please n For Core: ```csharp -M5Stack.InitializeScreen(); +M5Core.InitializeScreen(); ``` For StickCPlus: @@ -75,7 +89,7 @@ M5StickCPlus.InitializeScreen(); Once you've initialized it, you can access both a `Screen` static class and a `Console` static class. -THe `Screen` one brings primitives to write directly on the screen points or scare of colors as well as writing a text. +THe `Screen` one brings primitives to write directly on the screen points or scare of colours as well as writing a text. For example, you can write a blue square of 10x10 at the position 0, 0 like this: @@ -148,17 +162,17 @@ M5StickC.M5Button.Holding += (sender, e) => ### Power management -The M5Stack (Core) and M5StickC/CPlus are exposing their power management elements. It is not recommended to change any default value except if you know what you are doing. +The M5Core and M5StickC/CPlus are exposing their power management elements. It is not recommended to change any default value except if you know what you are doing. -Please refer to the detailed examples for the [AXP192](https://github.com/nanoframework/nanoFramework.IoT.Device/blob/develop/devices/Axp192/README.md) used in the M5StickC/CPlus; M5Core2 and [IP5306](https://github.com/nanoframework/nanoFramework.IoT.Device/blob/develop/devices/Ip5306/README.md) for the M5Stack. +Please refer to the detailed examples for the [AXP192](https://github.com/nanoframework/nanoFramework.IoT.Device/blob/develop/devices/Axp192/README.md) used in the M5StickC/CPlus; M5Core2 and [IP5306](https://github.com/nanoframework/nanoFramework.IoT.Device/blob/develop/devices/Ip5306/README.md) for the M5Core. ### Accelerometer and Gyroscope You can get access to the Accelerometer and Gyroscope like this: ```csharp -var ag = M5Stack.AccelerometerGyroscope; -// Do not move the M5Stack/M5Stick during the calibration +var ag = M5Core.AccelerometerGyroscope; +// Do not move the M5Core/M5Stick during the calibration ag.Calibrate(100); var acc = ag.GetAccelerometer(); var gyr = ag.GetGyroscope(); @@ -170,12 +184,12 @@ Refer to the [MPU6886 documentation](https://github.com/nanoframework/nanoFramew ### Magnetometer -The M5Stack has a magnetometer, you can access it as well: +The M5Core has a magnetometer, you can access it as well: ```csharp -var mag = M5Stack.Magnetometer; +var mag = M5Core.Magnetometer; // It is more than strongly recommended to calibrate the magnetometer. -// Move the M5Stack in all directions to have a proper calibration. +// Move the M5Core in all directions to have a proper calibration. mag.CalibrateMagnetometer(100); var magVal = mag.ReadMagnetometer(); Console.WriteLine($"x={magVal.X:N2} "); @@ -187,24 +201,24 @@ Console.WriteLine($"h={headDir:N2} "); ### SerialPort -The M5Stack and M5Core2 can provide a Serial Port, just get it like this: +The M5Core and M5Core2 can provide a Serial Port, just get it like this: ```csharp // You can access any of the Serial Port feature -M5Stack.SerialPort.Open(115200); +M5Core.SerialPort.Open(115200); // Do anything else you need -M5Stack.SerialPort.Close(); +M5Core.SerialPort.Close(); ``` Refer to the [SerialPort documentation](https://github.com/nanoframework/System.IO.Ports) for more information. ### ADC Channels -ADC Channels are pre setup on the M5Stack, access them like this: +ADC Channels are pre setup on the M5Core, access them like this: ```csharp // This will give you the ADC1 channel 7 which is on pin 35 -AdcChannel myChannel = M5Stack.GetAdcGpio(35); +AdcChannel myChannel = M5Core.GetAdcGpio(35); ``` Refer to the M5Stack documentation to have the mapping of the ADC channels and the pins. @@ -215,22 +229,22 @@ You can get an I2cDevice/Grove like this: ```csharp // In this example, the I2C address of the device is 0x42: -I2cDevice myDevice = M5Stack.GetGrove(0x42); +I2cDevice myDevice = M5Core.GetGrove(0x42); // replacing GetGrove by GetI2cDevice will have the same impact ``` ### SPI Device -The M5Stack provides as well an SPiDevice: +The M5Core provides as well an SpiDevice: ```csharp // In this case GPIO5 will be used as chip select: -SpiDevice mySpi = M5Stack.GetSpiDevice(5); +SpiDevice mySpi = M5Core.GetSpiDevice(5); ``` ### GPIO Controller -Similar as previously, you can get the `GpioController` on any of the M5Stack, M5Core2 and M5StickC/CPlus: +Similar as previously, you can get the `GpioController` on any of the M5Core, M5Core2 and M5StickC/CPlus: ```csharp // This will open the GPIO 36 as output @@ -239,7 +253,7 @@ var pin5 = M5StickC.GpioController.OpenPin(36, PinMode.Output); ### DAC -The M5Stack exposes 2 DAC and you can access them thru the `Dac1` and `Dac2` properties. Refer to the [DAC documentation](https://github.com/nanoframework/System.Device.Dac) for more information. +The M5Core exposes 2 DAC and you can access them thru the `Dac1` and `Dac2` properties. Refer to the [DAC documentation](https://github.com/nanoframework/System.Device.Dac) for more information. ### Led diff --git a/Tests/M5StackTestApp/M5StackTestApp.nfproj b/Tests/M5CoreTestApp/M5CoreTestApp.nfproj similarity index 80% rename from Tests/M5StackTestApp/M5StackTestApp.nfproj rename to Tests/M5CoreTestApp/M5CoreTestApp.nfproj index 640140c4..859fbe93 100644 --- a/Tests/M5StackTestApp/M5StackTestApp.nfproj +++ b/Tests/M5CoreTestApp/M5CoreTestApp.nfproj @@ -71,16 +71,36 @@ ..\..\packages\nanoFramework.System.Buffers.Binary.BinaryPrimitives.1.0.259\lib\System.Buffers.Binary.BinaryPrimitives.dll True + + ..\packages\nanoFramework.System.Device.Adc.1.0.1\lib\System.Device.Adc.dll + True + + + ..\packages\nanoFramework.System.Device.Dac.1.4.2\lib\System.Device.Dac.dll + True + - ..\..\packages\nanoFramework.System.Device.Gpio.1.0.2\lib\System.Device.Gpio.dll + ..\packages\nanoFramework.System.Device.Gpio.1.0.2\lib\System.Device.Gpio.dll + True + + + ..\packages\nanoFramework.System.IO.Ports.1.0.2\lib\System.IO.Ports.dll True - ..\..\packages\nanoFramework.System.Device.I2c.1.0.2\lib\System.Device.I2c.dll + ..\packages\nanoFramework.System.Device.I2c.1.0.2\lib\System.Device.I2c.dll True - ..\..\packages\nanoFramework.System.Device.Model.1.0.259\lib\System.Device.Model.dll + ..\packages\nanoFramework.System.Device.Model.1.0.259\lib\System.Device.Model.dll + True + + + ..\packages\nanoFramework.System.Device.Pwm.1.0.0\lib\System.Device.Pwm.dll + True + + + ..\packages\nanoFramework.System.Device.Spi.1.0.2\lib\System.Device.Spi.dll True @@ -108,15 +128,15 @@ - - - nFResXFileCodeGenerator Resources.Designer.cs + + + diff --git a/Tests/M5StackTestApp/Program.cs b/Tests/M5CoreTestApp/Program.cs similarity index 89% rename from Tests/M5StackTestApp/Program.cs rename to Tests/M5CoreTestApp/Program.cs index 00f42297..077e7779 100644 --- a/Tests/M5StackTestApp/Program.cs +++ b/Tests/M5CoreTestApp/Program.cs @@ -1,21 +1,17 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Device.Gpio; -using System.Diagnostics; -using System.Threading; -using M5StackTestApp; using nanoFramework.M5Stack; -using nanoFramework.UI; using nanoFramework.Presentation.Media; -using nanoFramework; +using System; +using System.Diagnostics; using System.Numerics; -using Console = nanoFramework.Console; +using System.Threading; +using Console = nanoFramework.M5Stack.Console; Debug.WriteLine("Hello from nanoFramework!"); -M5Stack.InitializeScreen(); +M5Core.InitializeScreen(); Console.Clear(); // Test the console display @@ -32,7 +28,7 @@ Console.WriteLine("1 line empty before"); Console.WriteLine("Press left button to continue"); -while (!M5Stack.ButtonLeft.IsPressed) +while (!M5Core.ButtonLeft.IsPressed) { Thread.Sleep(10); } @@ -40,14 +36,14 @@ Console.Clear(); Console.WriteLine("Calibrating the accelerator, do not touch it!"); -var acc = M5Stack.AccelerometerGyroscope; +var acc = M5Core.AccelerometerGyroscope; acc.Calibrate(100); Console.WriteLine(""); Console.WriteLine("Calibrating the magnetometer, please move it all around"); -var mag = M5Stack.Magnetometer; +var mag = M5Core.Magnetometer; mag.CalibrateMagnetometer(100); -M5Stack.ButtonLeft.Press += (sender, e) => +M5Core.ButtonLeft.Press += (sender, e) => { Console.ForegroundColor = Color.Yellow; Console.CursorLeft = 0; @@ -55,7 +51,7 @@ Console.Write($"Left Pressed "); }; -M5Stack.ButtonCenter.Press += (sender, e) => +M5Core.ButtonCenter.Press += (sender, e) => { Console.ForegroundColor = Color.Yellow; Console.CursorLeft = 0; @@ -63,7 +59,7 @@ Console.Write($"Center Pressed"); }; -M5Stack.ButtonRight.Press += (sender, e) => +M5Core.ButtonRight.Press += (sender, e) => { Console.ForegroundColor = Color.Yellow; Console.CursorLeft = 0; @@ -73,7 +69,7 @@ Console.Clear(); -var power = M5Stack.Power; +var power = M5Core.Power; Vector3 accVal; Vector3 gyroVal; Vector3 magVal; diff --git a/Tests/M5StackTestApp/Properties/AssemblyInfo.cs b/Tests/M5CoreTestApp/Properties/AssemblyInfo.cs similarity index 100% rename from Tests/M5StackTestApp/Properties/AssemblyInfo.cs rename to Tests/M5CoreTestApp/Properties/AssemblyInfo.cs diff --git a/Tests/M5StackTestApp/Resources.Designer.cs b/Tests/M5CoreTestApp/Resources.Designer.cs similarity index 100% rename from Tests/M5StackTestApp/Resources.Designer.cs rename to Tests/M5CoreTestApp/Resources.Designer.cs diff --git a/Tests/M5StackTestApp/Resources.resx b/Tests/M5CoreTestApp/Resources.resx similarity index 100% rename from Tests/M5StackTestApp/Resources.resx rename to Tests/M5CoreTestApp/Resources.resx diff --git a/Tests/M5StackTestApp/Resources/segoeuiregular12.tinyfnt b/Tests/M5CoreTestApp/Resources/segoeuiregular12.tinyfnt similarity index 100% rename from Tests/M5StackTestApp/Resources/segoeuiregular12.tinyfnt rename to Tests/M5CoreTestApp/Resources/segoeuiregular12.tinyfnt diff --git a/Tests/M5StackTestApp/packages.config b/Tests/M5CoreTestApp/packages.config similarity index 80% rename from Tests/M5StackTestApp/packages.config rename to Tests/M5CoreTestApp/packages.config index 75349e6d..39f18cb4 100644 --- a/Tests/M5StackTestApp/packages.config +++ b/Tests/M5CoreTestApp/packages.config @@ -11,10 +11,15 @@ + + + + + diff --git a/Tests/M5StickTestApp/Program.cs b/Tests/M5StickTestApp/Program.cs index ce5a0fab..87fde578 100644 --- a/Tests/M5StickTestApp/Program.cs +++ b/Tests/M5StickTestApp/Program.cs @@ -1,13 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using nanoFramework; -using nanoFramework.M5Stick; +using nanoFramework.M5Stack; using nanoFramework.Presentation.Media; using System; using System.Diagnostics; using System.Threading; -using Console = nanoFramework.Console; +using Console = nanoFramework.M5Stack.Console; Debug.WriteLine("Hello M5Stick from nanoFramework!"); diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 45734425..5bce43a4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,7 +26,7 @@ variables: solution: 'nanoFramework.M5Stack.sln' buildPlatform: 'Any CPU' buildConfiguration: 'Release' - nugetPackageName: 'nanoFramework.M5Stack' + nugetPackageName: 'nanoFramework.M5Core' steps: @@ -39,7 +39,7 @@ steps: # package steps - template: azure-pipelines-templates/class-lib-package.yml@templates parameters: - nugetPackageName: 'nanoFramework.M5Stack' + nugetPackageName: 'nanoFramework.M5Core' - template: azure-pipelines-templates/class-lib-package.yml@templates parameters: @@ -65,7 +65,7 @@ steps: tag: v$(MY_NUGET_VERSION) title: '$(nugetPackageName) Library v$(MY_NUGET_VERSION)' releaseNotesSource: inline - releaseNotesInline: 'Check the [changelog]($(Build.Repository.Uri)/blob/$(Build.SourceBranchName)/CHANGELOG.md).

Install from NuGet


The following NuGet packages are available for download from this release:
:package: [.NET](https://www.nuget.org/packages/$(nugetPackageName)/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION).
:package: [M5StickC](https://www.nuget.org/packages/nanoFramework.M5StickC/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)
:package: [M5StickCPlus](https://www.nuget.org/packages/nanoFramework.M5StickCPlus/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)' + releaseNotesInline: 'Check the [changelog]($(Build.Repository.Uri)/blob/$(Build.SourceBranchName)/CHANGELOG.md).

Install from NuGet


The following NuGet packages are available for download from this release:
:package: [M5Core](https://www.nuget.org/packages/M5Core/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION).
package: [M5Core2](https://www.nuget.org/packages/M5Core2/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION).
:package: [M5StickC](https://www.nuget.org/packages/nanoFramework.M5StickC/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)
:package: [M5StickCPlus](https://www.nuget.org/packages/nanoFramework.M5StickCPlus/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)' assets: '$(Build.ArtifactStagingDirectory)/$(nugetPackageName).$(MY_NUGET_VERSION).nupkg' assetUploadMode: replace isPreRelease: true @@ -82,7 +82,7 @@ steps: tag: v$(MY_NUGET_VERSION) title: '$(nugetPackageName) Library v$(MY_NUGET_VERSION)' releaseNotesSource: inline - releaseNotesInline: 'Check the [changelog]($(Build.Repository.Uri)/blob/$(Build.SourceBranchName)/CHANGELOG.md).

Install from NuGet


The following NuGet packages are available for download from this release:
:package: [.NET](https://www.nuget.org/packages/$(nugetPackageName)/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION).
:package: [M5StickC](https://www.nuget.org/packages/nanoFramework.M5StickC/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)
:package: [M5StickCPlus](https://www.nuget.org/packages/nanoFramework.M5StickCPlus/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)' + releaseNotesInline: 'Check the [changelog]($(Build.Repository.Uri)/blob/$(Build.SourceBranchName)/CHANGELOG.md).

Install from NuGet


The following NuGet packages are available for download from this release:
:package: [M5Core](https://www.nuget.org/packages/M5Core/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION).
:package: [M5Core2](https://www.nuget.org/packages/M5Core2/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION).
:package: [M5StickC](https://www.nuget.org/packages/nanoFramework.M5StickC/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)
:package: [M5StickCPlus](https://www.nuget.org/packages/nanoFramework.M5StickCPlus/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)' assets: '$(Build.ArtifactStagingDirectory)/$(nugetPackageName).$(MY_NUGET_VERSION).nupkg' assetUploadMode: replace isPreRelease: false diff --git a/nanoFramework.M5Stack.nuspec b/nanoFramework.M5Core.nuspec similarity index 78% rename from nanoFramework.M5Stack.nuspec rename to nanoFramework.M5Core.nuspec index 5185e816..9a4db55b 100644 --- a/nanoFramework.M5Stack.nuspec +++ b/nanoFramework.M5Core.nuspec @@ -1,9 +1,9 @@  - nanoFramework.M5Stack + nanoFramework.M5Core $version$ - nanoFramework.M5Stack + nanoFramework.M5Core nanoFramework project contributors nanoFramework,dotnetfoundation false @@ -16,8 +16,8 @@ images\nf-logo.png Copyright (c) .NET Foundation and Contributors - This package includes the nanoFramework.M5Stack assembly for .NET nanoFramework C# projects. - nanoFramework C# csharp netmf netnf nanoFramework.M5Stack + This package includes the nanoFramework.M5Core assembly for .NET nanoFramework C# projects. + nanoFramework C# csharp netmf netnf nanoFramework.M5Core @@ -49,11 +49,11 @@ - - - - - + + + + + diff --git a/nanoFramework.M5Stack/M5Stack.cs b/nanoFramework.M5Core/M5Core.cs similarity index 96% rename from nanoFramework.M5Stack/M5Stack.cs rename to nanoFramework.M5Core/M5Core.cs index 9307818a..abe923e2 100644 --- a/nanoFramework.M5Stack/M5Stack.cs +++ b/nanoFramework.M5Core/M5Core.cs @@ -4,25 +4,18 @@ using Iot.Device.Button; using Iot.Device.Buzzer; using Iot.Device.Ip5306; -using Iot.Device.Magnetometer; -using Iot.Device.Mpu6886; using nanoFramework.Hardware.Esp32; -using nanoFramework.UI; using System; -using System.Device.Dac; -using System.Device.Gpio; +using System.Device.Adc; using System.Device.I2c; -using System.Device.Spi; -using System.IO.Ports; using UnitsNet; -using System.Device.Adc; namespace nanoFramework.M5Stack { /// /// M5Stack board /// - public static partial class M5Stack + public static partial class M5Core { private static Ip5306 _power; private static Buzzer _buzzer; @@ -122,7 +115,7 @@ public static void InitializeScreen() #endregion - static M5Stack() + static M5Core() { // Setup first the I2C bus Configuration.SetPinFunction(22, DeviceFunction.I2C1_CLOCK); diff --git a/nanoFramework.M5Stack/Properties/AssemblyInfo.cs b/nanoFramework.M5Core/Properties/AssemblyInfo.cs similarity index 100% rename from nanoFramework.M5Stack/Properties/AssemblyInfo.cs rename to nanoFramework.M5Core/Properties/AssemblyInfo.cs diff --git a/nanoFramework.M5Stack/Resource.Designer.cs b/nanoFramework.M5Core/Resource.Designer.cs similarity index 100% rename from nanoFramework.M5Stack/Resource.Designer.cs rename to nanoFramework.M5Core/Resource.Designer.cs diff --git a/nanoFramework.M5Stack/Resource.resx b/nanoFramework.M5Core/Resource.resx similarity index 100% rename from nanoFramework.M5Stack/Resource.resx rename to nanoFramework.M5Core/Resource.resx diff --git a/nanoFramework.M5Stack/Resources/consolas_regular_16.tinyfnt b/nanoFramework.M5Core/Resources/consolas_regular_16.tinyfnt similarity index 100% rename from nanoFramework.M5Stack/Resources/consolas_regular_16.tinyfnt rename to nanoFramework.M5Core/Resources/consolas_regular_16.tinyfnt diff --git a/nanoFramework.M5Stack/Screen.cs b/nanoFramework.M5Core/Screen.cs similarity index 100% rename from nanoFramework.M5Stack/Screen.cs rename to nanoFramework.M5Core/Screen.cs diff --git a/nanoFramework.M5Stack/key.snk b/nanoFramework.M5Core/key.snk similarity index 100% rename from nanoFramework.M5Stack/key.snk rename to nanoFramework.M5Core/key.snk diff --git a/nanoFramework.M5Stack/nanoFramework.M5Stack.nfproj b/nanoFramework.M5Core/nanoFramework.M5Core.nfproj similarity index 96% rename from nanoFramework.M5Stack/nanoFramework.M5Stack.nfproj rename to nanoFramework.M5Core/nanoFramework.M5Core.nfproj index 1770f646..46510498 100644 --- a/nanoFramework.M5Stack/nanoFramework.M5Stack.nfproj +++ b/nanoFramework.M5Core/nanoFramework.M5Core.nfproj @@ -11,11 +11,11 @@ {2c78d035-dbda-4c38-ab58-8adc22d763c3} Library 512 - nanoFramework.M5Stack - nanoFramework.M5Stack + nanoFramework.M5Core + nanoFramework.M5Core v1.0 True - bin\$(Configuration)\nanoFramework.M5Stack.xml + bin\$(Configuration)\nanoFramework.M5Core.xml true @@ -33,7 +33,7 @@ - + True @@ -163,9 +163,6 @@ Resource.Designer.cs - - - diff --git a/nanoFramework.M5Stack/packages.config b/nanoFramework.M5Core/packages.config similarity index 100% rename from nanoFramework.M5Stack/packages.config rename to nanoFramework.M5Core/packages.config diff --git a/nanoFramework.M5Core2/Screen.cs b/nanoFramework.M5Core2/Screen.cs index 223d24b0..65a7d35d 100644 --- a/nanoFramework.M5Core2/Screen.cs +++ b/nanoFramework.M5Core2/Screen.cs @@ -8,7 +8,7 @@ using System.Threading; using UnitsNet; -namespace nanoFramework.M5Core2 +namespace nanoFramework.M5Stack { /// /// M5Core2 screen class diff --git a/nanoFramework.M5Core2/nanoFramework.M5Core2.nfproj b/nanoFramework.M5Core2/nanoFramework.M5Core2.nfproj index b9d348c4..2e181256 100644 --- a/nanoFramework.M5Core2/nanoFramework.M5Core2.nfproj +++ b/nanoFramework.M5Core2/nanoFramework.M5Core2.nfproj @@ -15,7 +15,7 @@ nanoFramework.M5Core2 nanoFramework.M5Core2 v1.0 - $(DefineConstants);M5CORE + $(DefineConstants);M5CORE2 bin\$(Configuration)\nanoFramework.M5Core2.xml diff --git a/nanoFramework.M5Stack.sln b/nanoFramework.M5Stack.sln index fd7e9d04..6ec2bd96 100644 --- a/nanoFramework.M5Stack.sln +++ b/nanoFramework.M5Stack.sln @@ -1,20 +1,20 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31729.503 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32014.148 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "nanoFramework.M5Stack", "nanoFramework.M5Stack\nanoFramework.M5Stack.nfproj", "{2C78D035-DBDA-4C38-AB58-8ADC22D763C3}" +Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "nanoFramework.M5Core", "nanoFramework.M5Core\nanoFramework.M5Core.nfproj", "{2C78D035-DBDA-4C38-AB58-8ADC22D763C3}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0A689EB3-86E0-448E-99F4-3D644EC3D8C5}" ProjectSection(SolutionItems) = preProject + nanoFramework.M5Core.nuspec = nanoFramework.M5Core.nuspec nanoFramework.M5Core2.nuspec = nanoFramework.M5Core2.nuspec - nanoFramework.M5Stack.nuspec = nanoFramework.M5Stack.nuspec nanoFramework.M5StickC.nuspec = nanoFramework.M5StickC.nuspec nanoFramework.M5StickCPlus.nuspec = nanoFramework.M5StickCPlus.nuspec NuGet.Config = NuGet.Config version.json = version.json EndProjectSection EndProject -Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "M5StackTestApp", "Tests\M5StackTestApp\M5StackTestApp.nfproj", "{90A94170-2C6B-4B22-BAA5-8212AC22219B}" +Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "M5CoreTestApp", "Tests\M5CoreTestApp\M5CoreTestApp.nfproj", "{90A94170-2C6B-4B22-BAA5-8212AC22219B}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{5972CDE6-43B4-42F0-9276-6B70B7EF6437}" EndProject @@ -30,15 +30,15 @@ Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "M5StickTestApp", "Tests\M5S EndProject Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "nanoFramework.M5Core2", "nanoFramework.M5Core2\nanoFramework.M5Core2.nfproj", "{08C2EFD2-2812-456E-9D27-606AE88B3C1B}" EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "nanoFramework.M5StackCore", "nanoFramework.M5StackCore\nanoFramework.M5StackCore.shproj", "{11C92E50-70F6-473B-91F8-488AC7E4C39D}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared projects", "Shared projects", "{FFF3F871-7600-480E-B378-95AD0F9FC0F1}" EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "nanoFramework.M5StackCore", "nanoFramework.M5StackCore\nanoFramework.M5StackCore.shproj", "{E2A94F3C-EE7F-4075-A98A-A19CABE82C0F}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution M5StackCommon\M5StackCommon.projitems*{00e23322-2401-4087-abae-24f90c8a0422}*SharedItemsImports = 13 - nanoFramework.M5StackCore\nanoFramework.M5StackCore.projitems*{11c92e50-70f6-473b-91f8-488ac7e4c39d}*SharedItemsImports = 13 nanoFramework.M5StickCommon\nanoFramework.M5StickCommon.projitems*{1f49b255-573d-4d02-87da-08c4a95744b0}*SharedItemsImports = 13 + nanoFramework.M5StackCore\nanoFramework.M5StackCore.projitems*{e2a94f3c-ee7f-4075-a98a-a19cabe82c0f}*SharedItemsImports = 13 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -90,7 +90,7 @@ Global {00E23322-2401-4087-ABAE-24F90C8A0422} = {FFF3F871-7600-480E-B378-95AD0F9FC0F1} {1F49B255-573D-4D02-87DA-08C4A95744B0} = {FFF3F871-7600-480E-B378-95AD0F9FC0F1} {48E3FD52-1D13-422D-AF3F-B6AEA2C72800} = {5972CDE6-43B4-42F0-9276-6B70B7EF6437} - {11C92E50-70F6-473B-91F8-488AC7E4C39D} = {FFF3F871-7600-480E-B378-95AD0F9FC0F1} + {E2A94F3C-EE7F-4075-A98A-A19CABE82C0F} = {FFF3F871-7600-480E-B378-95AD0F9FC0F1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {DD82D7FF-B798-48A4-8506-2FBA0001D32F} diff --git a/nanoFramework.M5StackCore/M5StackBase.cs b/nanoFramework.M5StackCore/M5CoreBase.cs similarity index 97% rename from nanoFramework.M5StackCore/M5StackBase.cs rename to nanoFramework.M5StackCore/M5CoreBase.cs index 57fa2093..61733d38 100644 --- a/nanoFramework.M5StackCore/M5StackBase.cs +++ b/nanoFramework.M5StackCore/M5CoreBase.cs @@ -1,18 +1,18 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Iot.Device.Magnetometer; +using Iot.Device.Mpu6886; using System.Device.Adc; using System.Device.Dac; using System.Device.Gpio; using System.Device.I2c; using System.Device.Spi; using System.IO.Ports; -using Iot.Device.Magnetometer; -using Iot.Device.Mpu6886; namespace nanoFramework.M5Stack { -#if M5CORE +#if M5CORE2 /// /// M5Core2 board /// @@ -21,7 +21,7 @@ public static partial class M5Core2 /// /// M5Stack board /// - public static partial class M5Stack + public static partial class M5Core #endif { private static Bmm150 _bmm150; @@ -29,8 +29,8 @@ public static partial class M5Stack private static GpioController _gpio; private static DacChannel _dac1; private static DacChannel _dac2; -#if M5CORE - private static nanoFramework.M5Core2.Screen _screen; +#if M5CORE2 + private static nanoFramework.M5Stack.Screen _screen; #else private static nanoFramework.M5Stack.Screen _screen; #endif diff --git a/nanoFramework.M5StackCore/nanoFramework.M5StackCore.projitems b/nanoFramework.M5StackCore/nanoFramework.M5StackCore.projitems index 473608c8..ea096b96 100644 --- a/nanoFramework.M5StackCore/nanoFramework.M5StackCore.projitems +++ b/nanoFramework.M5StackCore/nanoFramework.M5StackCore.projitems @@ -9,6 +9,6 @@ nanoFramework.M5StackCore - + \ No newline at end of file diff --git a/nanoFramework.M5StackCore/nanoFramework.M5StackCore.shproj b/nanoFramework.M5StackCore/nanoFramework.M5StackCore.shproj index 52733168..a496ce4b 100644 --- a/nanoFramework.M5StackCore/nanoFramework.M5StackCore.shproj +++ b/nanoFramework.M5StackCore/nanoFramework.M5StackCore.shproj @@ -1,7 +1,7 @@ - 11c92e50-70f6-473b-91f8-488ac7e4c39d + {E2A94F3C-EE7F-4075-A98A-A19CABE82C0F} 14.0 @@ -10,4 +10,4 @@ - + \ No newline at end of file diff --git a/nanoFramework.M5StickC/M5StickC.cs b/nanoFramework.M5StickC/M5StickC.cs index 47a3b23f..8e490ecd 100644 --- a/nanoFramework.M5StickC/M5StickC.cs +++ b/nanoFramework.M5StickC/M5StickC.cs @@ -1,9 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; - -namespace nanoFramework.M5Stick +namespace nanoFramework.M5Stack { public static partial class M5StickC { diff --git a/nanoFramework.M5StickCPlus/M5StickCPlus.cs b/nanoFramework.M5StickCPlus/M5StickCPlus.cs index b803fd08..e2e3b82e 100644 --- a/nanoFramework.M5StickCPlus/M5StickCPlus.cs +++ b/nanoFramework.M5StickCPlus/M5StickCPlus.cs @@ -3,9 +3,8 @@ using Iot.Device.Buzzer; using nanoFramework.Hardware.Esp32; -using System; -namespace nanoFramework.M5Stick +namespace nanoFramework.M5Stack { public static partial class M5StickCPlus { diff --git a/nanoFramework.M5StickCommon/M5StickCBase.cs b/nanoFramework.M5StickCommon/M5StickCBase.cs index eb1e0156..0de77c7e 100644 --- a/nanoFramework.M5StickCommon/M5StickCBase.cs +++ b/nanoFramework.M5StickCommon/M5StickCBase.cs @@ -17,7 +17,7 @@ #else using nanoFramework.M5StickCPlus; #endif -namespace nanoFramework.M5Stick +namespace nanoFramework.M5Stack { /// /// The base class for both M5STickC and M5StickCPlus diff --git a/nanoFramework.M5StickCommon/Screen.cs b/nanoFramework.M5StickCommon/Screen.cs index 1ba22a2e..37b7e039 100644 --- a/nanoFramework.M5StickCommon/Screen.cs +++ b/nanoFramework.M5StickCommon/Screen.cs @@ -4,11 +4,9 @@ using Iot.Device.Axp192; using nanoFramework.M5Stack; using nanoFramework.UI; -using System; -using System.Device.Gpio; using UnitsNet; -namespace nanoFramework.M5Stick +namespace nanoFramework.M5Stack { /// /// M5 Stack screen class