Initial version
This commit is contained in:
Коммит
8941118c7b
|
@ -0,0 +1,13 @@
|
|||
user=nanoframework
|
||||
project=lib-System.Device.Pwm
|
||||
issues=true
|
||||
add_issues_wo_labels=false
|
||||
add_pr_wo_labels=false
|
||||
add_issues_wo_labels=false
|
||||
filter_issues_by_milestone=false
|
||||
exclude_labels=Area: Config-and-Build,Area: Infrastructure-and-Organization,reverted
|
||||
enhancement_labels=Type: enhancement
|
||||
bug_labels=Type: bug
|
||||
merge_prefix=**Documentation and other chores:**
|
||||
unreleased_label=**Changes available only in 'Preview' NuGet packages:**
|
||||
author=false
|
|
@ -0,0 +1,255 @@
|
|||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
|
||||
# Visual Studio 2015 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# DNX
|
||||
project.lock.json
|
||||
artifacts/
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/packages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/packages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/packages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignoreable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
node_modules/
|
||||
orleans.codegen.cs
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# JetBrains Rider
|
||||
.idea/
|
||||
*.sln.iml
|
||||
|
||||
#SoundCloud
|
||||
*.sonarqube/
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) .NET Foundation and Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="NuGet" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||
<add key="Azure Artifacts nanoFramework dev" value="https://pkgs.dev.azure.com/nanoframework/feed/_packaging/sandbox/nuget/v3/index.json" protocolVersion="3" />
|
||||
</packageSources>
|
||||
</configuration>
|
|
@ -0,0 +1,37 @@
|
|||
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_lib-System.Device.Pwm&metric=alert_status)](https://sonarcloud.io/dashboard?id=nanoframework_lib-System.Device.Pwm) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_lib-System.Device.Pwm&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=nanoframework_lib-System.Device.Pwm) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![NuGet](https://img.shields.io/nuget/dt/nanoFramework.System.Device.Pwm.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.Device.Pwm/) [![#yourfirstpr](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/nanoframework/Home/blob/master/CONTRIBUTING.md) [![Discord](https://img.shields.io/discord/478725473862549535.svg?logo=discord&logoColor=white&label=Discord&color=7289DA)](https://discord.gg/gCyBu8T)
|
||||
|
||||
![nanoFramework logo](https://github.com/nanoframework/Home/blob/master/resources/logo/nanoFramework-repo-logo.png)
|
||||
|
||||
-----
|
||||
|
||||
### Welcome to the **nanoFramework** System.Device.Pwm Library repository!
|
||||
|
||||
## Build status
|
||||
|
||||
| Component | Build Status | NuGet Package |
|
||||
|:-|---|---|
|
||||
| System.Device.Pwm | [![Build Status](https://dev.azure.com/nanoframework/System.Device.Pwm/_apis/build/status/nanoframework.lib-System.Device.Pwm?branchName=develop)](https://dev.azure.com/nanoframework/System.Device.Pwm/_build/latest?definitionId=8?branchName=master) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.System.Device.Pwm.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.System.Device.Pwm/) |
|
||||
| System.Device.Pwm (preview) | [![Build Status](https://dev.azure.com/nanoframework/System.Device.Pwm/_apis/build/status/nanoframework.lib-System.Device.Pwm?branchName=develop)](https://dev.azure.com/nanoframework/System.Device.Pwm/_build/latest?definitionId=8?branchName=develop) | [![](https://badgen.net/badge/NuGet/preview/D7B023?icon=https://simpleicons.now.sh/azuredevops/fff)](https://dev.azure.com/nanoframework/feed/_packaging?_a=package&feed=sandbox&package=nanoFramework.System.Device.Pwm&protocolType=NuGet&view=overview) |
|
||||
|
||||
## Feedback and documentation
|
||||
|
||||
For documentation, providing feedback, issues and finding out how to contribute please refer to the [Home repo](https://github.com/nanoframework/Home).
|
||||
|
||||
Join our Discord community [here](https://discord.gg/gCyBu8T).
|
||||
|
||||
## Credits
|
||||
|
||||
The list of contributors to this project can be found at [CONTRIBUTORS](https://github.com/nanoframework/Home/blob/master/CONTRIBUTORS.md).
|
||||
|
||||
## License
|
||||
|
||||
The **nanoFramework** Class Libraries are licensed under the [MIT license](LICENSE.md).
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
|
||||
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
|
||||
|
||||
### .NET Foundation
|
||||
|
||||
This project is supported by the [.NET Foundation](https://dotnetfoundation.org).
|
|
@ -0,0 +1,25 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("System.Device.Pwm")]
|
||||
[assembly: AssemblyCompany("nanoFramework Contributors")]
|
||||
[assembly: AssemblyProduct("System.Device.Pwm")]
|
||||
[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")]
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// This attribute is mandatory when building Interop libraries //
|
||||
// update this whenever the native assembly signature changes //
|
||||
[assembly: AssemblyNativeVersion("100.1.0.4")]
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,186 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace System.Device.Pwm
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a single PWM channel.
|
||||
/// </summary>
|
||||
public sealed class PwmChannel : IDisposable
|
||||
{
|
||||
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
|
||||
private int _frequency;
|
||||
|
||||
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
|
||||
private double _dutyCyclePercentage;
|
||||
|
||||
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
|
||||
private uint _dutyCycle;
|
||||
|
||||
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
|
||||
private PwmPulsePolarity _polarity;
|
||||
|
||||
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
|
||||
private int _pinNumber;
|
||||
|
||||
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
|
||||
private int _pwmTimer;
|
||||
|
||||
/// <summary>
|
||||
/// The frequency in hertz.
|
||||
/// </summary>
|
||||
public int Frequency
|
||||
{
|
||||
get => _frequency;
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(value), "Value must not be negative.");
|
||||
}
|
||||
|
||||
var actualFrequencey = NativeSetDesiredFrequency((uint)value);
|
||||
_frequency = (int)actualFrequencey;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The duty cycle represented as a value between 0.0 and 1.0.
|
||||
/// </summary>
|
||||
public double DutyCycle
|
||||
{
|
||||
get => _dutyCyclePercentage;
|
||||
set
|
||||
{
|
||||
if (value < 0.0 || value > 1.0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(value), "Value must be between 0.0 and 1.0.");
|
||||
}
|
||||
|
||||
SetActiveDutyCyclePercentage(value);
|
||||
_dutyCyclePercentage = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts the PWM channel.
|
||||
/// </summary>
|
||||
public void Start()
|
||||
{
|
||||
NativeStart();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops the PWM channel.
|
||||
/// </summary>
|
||||
public void Stop()
|
||||
{
|
||||
NativeStop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="PwmChannel"/> running on the current platform. (Windows 10 IoT or Unix/Raspbian)
|
||||
/// </summary>
|
||||
/// <param name="chip">The PWM chip number.</param>
|
||||
/// <param name="channel">The PWM channel number.</param>
|
||||
/// <param name="frequency">The frequency in hertz.</param>
|
||||
/// <param name="dutyCyclePercentage">The duty cycle percentage represented as a value between 0.0 and 1.0.</param>
|
||||
/// <returns>A PWM channel</returns>
|
||||
public static PwmChannel Create(
|
||||
int chip,
|
||||
int channel,
|
||||
int frequency = 400,
|
||||
double dutyCyclePercentage = 0.5)
|
||||
{
|
||||
var pwmChannel = new PwmChannel(chip, channel, frequency, dutyCyclePercentage);
|
||||
return pwmChannel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="PwmChannel"/> running on the current platform. (Windows 10 IoT or Unix/Raspbian)
|
||||
/// </summary>
|
||||
/// <param name="chip">The PWM chip number.</param>
|
||||
/// <param name="channel">The PWM channel number.</param>
|
||||
/// <param name="frequency">The frequency in hertz.</param>
|
||||
/// <param name="dutyCyclePercentage">The duty cycle percentage represented as a value between 0.0 and 1.0.</param>
|
||||
/// <returns>A PWM channel</returns>
|
||||
public PwmChannel(
|
||||
int chip,
|
||||
int channel,
|
||||
int frequency = 400,
|
||||
double dutyCyclePercentage = 0.5)
|
||||
|
||||
{
|
||||
_pwmTimer = chip;
|
||||
_pinNumber = channel;
|
||||
_polarity = PwmPulsePolarity.ActiveHigh;
|
||||
Frequency = frequency;
|
||||
NativeInit();
|
||||
DutyCycle = dutyCyclePercentage;
|
||||
}
|
||||
|
||||
|
||||
private void SetActiveDutyCyclePercentage(double dutyCyclePercentage)
|
||||
{
|
||||
_dutyCycle = (uint)(dutyCyclePercentage * 10000);
|
||||
NativeSetActiveDutyCyclePercentage(_dutyCycle);
|
||||
}
|
||||
|
||||
#region IDisposable Support
|
||||
|
||||
private bool _disposedValue;
|
||||
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (!_disposedValue)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
// TODO: dispose managed state (managed objects)
|
||||
}
|
||||
|
||||
DisposeNative();
|
||||
|
||||
_disposedValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
// // TODO: override finalizer only if 'Dispose(bool disposing)' has code to free unmanaged resources
|
||||
// ~PwmChannel()
|
||||
// {
|
||||
// // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
|
||||
// Dispose(disposing: false);
|
||||
// }
|
||||
|
||||
/// <inheritdoc cref="IDisposable.Dispose"/>
|
||||
public void Dispose()
|
||||
{
|
||||
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
|
||||
Dispose(disposing: true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region external calls to native implementations
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern bool NativeInit();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern uint NativeSetDesiredFrequency(uint desiredFrequency);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern void NativeSetActiveDutyCyclePercentage(uint dutyCyclePercentage);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern void NativeStart();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern void NativeStop();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern void DisposeNative();
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
//
|
||||
// Copyright (c) .NET Foundation and Contributors
|
||||
// See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace System.Device.Pwm
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes which polarity the PWM signal should start in.
|
||||
/// </summary>
|
||||
public enum PwmPulsePolarity
|
||||
{
|
||||
/// <summary>
|
||||
/// Configures the PWM signal to start in the active high state.
|
||||
/// </summary>
|
||||
ActiveHigh,
|
||||
/// <summary>
|
||||
/// Configures the PWM signal to start in the active low state.
|
||||
/// </summary>
|
||||
ActiveLow
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Globals">
|
||||
<NanoFrameworkProjectSystemPath>$(MSBuildToolsPath)..\..\..\nanoFramework\v1.0\</NanoFrameworkProjectSystemPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.Default.props" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.Default.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectTypeGuids>{11A8DD76-328B-46DF-9F39-F559912D0360};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<ProjectGuid>63476bb7-c9fe-444a-bf4d-5d255f852f0d</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<RootNamespace>System.Device.Pwm</RootNamespace>
|
||||
<AssemblyName>System.Device.Pwm</AssemblyName>
|
||||
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
|
||||
<NF_IsCoreLibrary>True</NF_IsCoreLibrary>
|
||||
<DocumentationFile>bin\$(Configuration)\System.Device.Pwm.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<DelaySign>false</DelaySign>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- override default options for MetaDataProcessor -->
|
||||
<NF_GenerateStubsDirectory>bin\$(Configuration)\Stubs</NF_GenerateStubsDirectory>
|
||||
<NF_GenerateSkeletonProjectName>sys_dev_pwm_native</NF_GenerateSkeletonProjectName>
|
||||
<Name>System.Device.Pwm</Name>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<NFMDP_PE_ExcludeClassByName Include="ThisAssembly">
|
||||
<InProject>false</InProject>
|
||||
</NFMDP_PE_ExcludeClassByName>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<NFMDP_PE_LoadHints Include="..\packages\nanoFramework.CoreLibrary.1.10.4-preview.4\lib\mscorlib.dll">
|
||||
<InProject>false</InProject>
|
||||
</NFMDP_PE_LoadHints>
|
||||
</ItemGroup>
|
||||
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.props" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.props')" />
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="PwmChannel.cs" />
|
||||
<Compile Include="PwmPulsePolarity.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="key.snk" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="mscorlib, Version=1.10.4.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
|
||||
<HintPath>..\packages\nanoFramework.CoreLibrary.1.10.4-preview.4\lib\mscorlib.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<SpecificVersion>True</SpecificVersion>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
|
||||
<ProjectExtensions>
|
||||
<ProjectCapabilities>
|
||||
<ProjectConfigurationsDeclaredAsItems />
|
||||
</ProjectCapabilities>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
Двоичный файл не отображается.
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="nanoFramework.CoreLibrary" version="1.10.4-preview.4" targetFramework="netnanoframework10" />
|
||||
<package id="Nerdbank.GitVersioning" version="3.4.194" targetFramework="netnanoframework10" developmentDependency="true" />
|
||||
</packages>
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 4.0 KiB |
|
@ -0,0 +1,21 @@
|
|||
_____ _
|
||||
_ __ __ _ _ __ ___ | ___| __ __ _ _ __ ___ _____ _____ _ __| | __
|
||||
| '_ \ / _` | '_ \ / _ \| |_ | '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ /
|
||||
| | | | (_| | | | | (_) | _|| | | (_| | | | | | | __/\ V V / (_) | | | <
|
||||
|_| |_|\__,_|_| |_|\___/|_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\
|
||||
|
||||
===================================================================================
|
||||
|
||||
API docs: https://docs.nanoframework.net/api
|
||||
|
||||
Browse our samples repository: https://github.com/nanoframework/samples
|
||||
|
||||
Check our documentation online: https://docs.nanoframework.net
|
||||
|
||||
Join our lively Discord community: https://discord.gg/gCyBu8T
|
||||
|
||||
Report issues: https://github.com/nanoframework/Home/issues
|
||||
|
||||
Follow us on Twitter: https://twitter.com/nanoframework
|
||||
|
||||
Follow our YouTube channel: https://www.youtube.com/c/nanoFramework
|
|
@ -0,0 +1,45 @@
|
|||
trigger:
|
||||
branches:
|
||||
include: [main, develop, "release-*" ]
|
||||
paths:
|
||||
exclude: ["*.md", .gitignore]
|
||||
tags:
|
||||
include: ["v*"]
|
||||
|
||||
# PR always trigger build
|
||||
|
||||
# add nf-tools repo to resources (for Azure Pipelines templates)
|
||||
resources:
|
||||
repositories:
|
||||
- repository: templates
|
||||
type: github
|
||||
name: nanoframework/nf-tools
|
||||
endpoint: nanoframework
|
||||
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
|
||||
variables:
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
||||
solution: '**/*.sln'
|
||||
buildPlatform: 'Any CPU'
|
||||
buildConfiguration: 'Release'
|
||||
classLibName: 'System.Device.Pwm'
|
||||
nugetPackageName: 'nanoFramework.System.Device.Pwm'
|
||||
repoName: 'System.Device.Pwm'
|
||||
|
||||
steps:
|
||||
|
||||
# step from template @ nf-tools repo
|
||||
# all build, update and publish steps
|
||||
- template: azure-pipelines-templates/class-lib-build.yml@templates
|
||||
parameters:
|
||||
sonarCloudProject: 'nanoframework_lib-System.Device.Pwm'
|
||||
|
||||
# step from template @ nf-tools repo
|
||||
# report error
|
||||
- template: azure-pipelines-templates/discord-webhook-task.yml@templates
|
||||
parameters:
|
||||
status: 'failure'
|
||||
webhookUrl: '$(DiscordWebhook)'
|
||||
message: ''
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"SignClient": {
|
||||
"AzureAd": {
|
||||
"AADInstance": "https://login.microsoftonline.com/",
|
||||
"ClientId": "c248d68a-ba6f-4aa9-8a68-71fe872063f8",
|
||||
"TenantId": "16076fdc-fcc1-4a15-b1ca-32c9a255900e"
|
||||
},
|
||||
"Service": {
|
||||
"Url": "https://codesign.dotnetfoundation.org/",
|
||||
"ResourceId": "https://SignService/3c30251f-36f3-490b-a955-520addb85001"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
**/System.Device.Pwm.*
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31229.75
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "System.Device.Pwm", "System.Device.Pwm\System.Device.Pwm.nfproj", "{63476BB7-C9FE-444A-BF4D-5D255F852F0D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{63476BB7-C9FE-444A-BF4D-5D255F852F0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{63476BB7-C9FE-444A-BF4D-5D255F852F0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{63476BB7-C9FE-444A-BF4D-5D255F852F0D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{63476BB7-C9FE-444A-BF4D-5D255F852F0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{63476BB7-C9FE-444A-BF4D-5D255F852F0D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{63476BB7-C9FE-444A-BF4D-5D255F852F0D}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {09A31FC3-06F2-461A-AD59-8F49F95CD0FE}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,74 @@
|
|||
<UserSettings>
|
||||
<ApplicationIdentity version="12.0"/>
|
||||
<ToolsOptions>
|
||||
<ToolsOptionsCategory name="TextEditor" RegisteredName="TextEditor">
|
||||
<ToolsOptionsSubCategory name="AllLanguages" RegisteredName="AllLanguages" PackageName="Text Management Package"/>
|
||||
<ToolsOptionsSubCategory name="CSharp" RegisteredName="CSharp" PackageName="Text Management Package">
|
||||
<PropertyValue name="TabSize">4</PropertyValue>
|
||||
<PropertyValue name="InsertTabs">false</PropertyValue>
|
||||
<PropertyValue name="IndentSize">4</PropertyValue>
|
||||
<PropertyValue name="BraceCompletion">true</PropertyValue>
|
||||
</ToolsOptionsSubCategory>
|
||||
<ToolsOptionsSubCategory name="CSharp-Specific" RegisteredName="CSharp-Specific" PackageName="Visual C# Language Service Package">
|
||||
<PropertyValue name="NewLines_QueryExpression_EachClause">1</PropertyValue>
|
||||
<PropertyValue name="Space_Normalize">0</PropertyValue>
|
||||
<PropertyValue name="Space_AroundBinaryOperator">1</PropertyValue>
|
||||
<PropertyValue name="Formatting_TriggerOnPaste">1</PropertyValue>
|
||||
<PropertyValue name="NewLines_Braces_Method">1</PropertyValue>
|
||||
<PropertyValue name="Indent_CaseLabels">1</PropertyValue>
|
||||
<PropertyValue name="Formatting_TriggerOnBlockCompletion">1</PropertyValue>
|
||||
<PropertyValue name="CodeDefinitionWindow_DocumentationComment_IndentOffset">2</PropertyValue>
|
||||
<PropertyValue name="NewLines_Braces_ControlFlow">1</PropertyValue>
|
||||
<PropertyValue name="NewLines_Braces_AnonymousMethod">0</PropertyValue>
|
||||
<PropertyValue name="Space_WithinOtherParentheses">0</PropertyValue>
|
||||
<PropertyValue name="Wrapping_KeepStatementsOnSingleLine">1</PropertyValue>
|
||||
<PropertyValue name="Space_AfterBasesColon">1</PropertyValue>
|
||||
<PropertyValue name="Indent_Braces">0</PropertyValue>
|
||||
<PropertyValue name="Wrapping_IgnoreSpacesAroundVariableDeclaration">0</PropertyValue>
|
||||
<PropertyValue name="Space_WithinMethodCallParentheses">0</PropertyValue>
|
||||
<PropertyValue name="Space_AfterCast">0</PropertyValue>
|
||||
<PropertyValue name="NewLines_Braces_CollectionInitializer">0</PropertyValue>
|
||||
<PropertyValue name="NewLines_AnonymousTypeInitializer_EachMember">1</PropertyValue>
|
||||
<PropertyValue name="NewLines_Keywords_Catch">1</PropertyValue>
|
||||
<PropertyValue name="NewLines_Braces_ObjectInitializer">0</PropertyValue>
|
||||
<PropertyValue name="NewLines_Braces_ArrayInitializer">0</PropertyValue>
|
||||
<PropertyValue name="Space_WithinExpressionParentheses">0</PropertyValue>
|
||||
<PropertyValue name="Space_InControlFlowConstruct">1</PropertyValue>
|
||||
<PropertyValue name="Formatting_TriggerOnStatementCompletion">0</PropertyValue>
|
||||
<PropertyValue name="NewLines_Keywords_Finally">1</PropertyValue>
|
||||
<PropertyValue name="Space_BetweenEmptyMethodDeclarationParentheses">0</PropertyValue>
|
||||
<PropertyValue name="Indent_UnindentLabels">0</PropertyValue>
|
||||
<PropertyValue name="NewLines_ObjectInitializer_EachMember">1</PropertyValue>
|
||||
<PropertyValue name="NewLines_Keywords_Else">1</PropertyValue>
|
||||
<PropertyValue name="Space_WithinMethodDeclarationParentheses">0</PropertyValue>
|
||||
<PropertyValue name="Space_BetweenEmptyMethodCallParentheses">0</PropertyValue>
|
||||
<PropertyValue name="Space_BeforeSemicolonsInForStatement">0</PropertyValue>
|
||||
<PropertyValue name="Space_BeforeComma">0</PropertyValue>
|
||||
<PropertyValue name="Space_AfterMethodCallName">0</PropertyValue>
|
||||
<PropertyValue name="Space_AfterComma">1</PropertyValue>
|
||||
<PropertyValue name="Wrapping_IgnoreSpacesAroundBinaryOperators">0</PropertyValue>
|
||||
<PropertyValue name="Space_BeforeBasesColon">1</PropertyValue>
|
||||
<PropertyValue name="Space_AfterMethodDeclarationName">0</PropertyValue>
|
||||
<PropertyValue name="Space_AfterDot">0</PropertyValue>
|
||||
<PropertyValue name="NewLines_Braces_Type">1</PropertyValue>
|
||||
<PropertyValue name="Space_AfterLambdaArrow">1</PropertyValue>
|
||||
<PropertyValue name="NewLines_Braces_LambdaExpressionBody">0</PropertyValue>
|
||||
<PropertyValue name="Space_WithinSquares">0</PropertyValue>
|
||||
<PropertyValue name="Space_BeforeLambdaArrow">1</PropertyValue>
|
||||
<PropertyValue name="NewLines_Braces_AnonymousTypeInitializer">0</PropertyValue>
|
||||
<PropertyValue name="Space_WithinCastParentheses">0</PropertyValue>
|
||||
<PropertyValue name="Space_AfterSemicolonsInForStatement">1</PropertyValue>
|
||||
<PropertyValue name="Indent_CaseContents">0</PropertyValue>
|
||||
<PropertyValue name="Indent_FlushLabelsLeft">1</PropertyValue>
|
||||
<PropertyValue name="Wrapping_PreserveSingleLine">1</PropertyValue>
|
||||
<PropertyValue name="Space_BetweenEmptySquares">0</PropertyValue>
|
||||
<PropertyValue name="Space_BeforeOpenSquare">0</PropertyValue>
|
||||
<PropertyValue name="Space_BeforeDot">0</PropertyValue>
|
||||
<PropertyValue name="Indent_BlockContents">1</PropertyValue>
|
||||
<PropertyValue name="SortUsings_PlaceSystemFirst">1</PropertyValue>
|
||||
<PropertyValue name="SortUsings">1</PropertyValue>
|
||||
<PropertyValue name="RemoveUnusedUsings">1</PropertyValue>
|
||||
</ToolsOptionsSubCategory>
|
||||
</ToolsOptionsCategory>
|
||||
</ToolsOptions>
|
||||
</UserSettings>
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
|
||||
"version": "1.6.0-preview.{height}",
|
||||
"assemblyVersion": {
|
||||
"precision": "revision"
|
||||
},
|
||||
"semVer1NumericIdentifierPadding": 3,
|
||||
"nuGetPackageVersion": {
|
||||
"semVer": 2.0
|
||||
},
|
||||
"publicReleaseRefSpec": [
|
||||
"^refs/heads/develop$",
|
||||
"^refs/heads/main$",
|
||||
"^refs/heads/v\\d+(?:\\.\\d+)?$"
|
||||
],
|
||||
"cloudBuild": {
|
||||
"setAllVariables": true,
|
||||
"buildNumber": null
|
||||
},
|
||||
"release": {
|
||||
"branchName": "release-v{version}",
|
||||
"firstUnstableTag": "preview",
|
||||
"versionIncrement": "build"
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче