提交 4926bfe8 编写于 作者: G Greg Ingram 提交者: Jose Perez Rodriguez

Added PwmController interface (#456)

上级 9b7dc248
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace System.Device.Pwm
{
public interface IPwmController : IDisposable
{
/// <summary>
/// Opens a channel in order for it to be ready to use.
/// </summary>
/// <param name="pwmChip">The PWM chip.</param>
/// <param name="pwmChannel">The PWM channel.</param>
void OpenChannel(int pwmChip, int pwmChannel);
/// <summary>
/// Closes an open channel.
/// </summary>
/// <param name="pwmChip">The PWM chip.</param>
/// <param name="pwmChannel">The PWM channel.</param>
void CloseChannel(int pwmChip, int pwmChannel);
/// <summary>
/// Changes the duty cycle for an open channel.
/// </summary>
/// <param name="pwmChip">The PWM chip.</param>
/// <param name="pwmChannel">The PWM channel.</param>
/// <param name="dutyCyclePercentage">The duty cycle percentage to change.</param>
void ChangeDutyCycle(int pwmChip, int pwmChannel, double dutyCyclePercentage);
/// <summary>
/// Starts writing to an open channel.
/// </summary>
/// <param name="pwmChip">The PWM chip.</param>
/// <param name="pwmChannel">The PWM channel.</param>
/// <param name="frequencyInHertz">The frequency in hertz to write.</param>
/// <param name="dutyCyclePercentage">The duty cycle percentage to write.</param>
void StartWriting(int pwmChip, int pwmChannel, double frequencyInHertz, double dutyCyclePercentage);
/// <summary>
/// Stops writing to an open channel.
/// </summary>
/// <param name="pwmChip">The PWM chip.</param>
/// <param name="pwmChannel">The PWM channel.</param>
void StopWriting(int pwmChip, int pwmChannel);
}
}
......@@ -3,11 +3,10 @@
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using System.Linq;
namespace System.Device.Pwm
{
public sealed partial class PwmController : IDisposable
public sealed partial class PwmController : IPwmController
{
private readonly PwmDriver _driver;
/// <summary>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册