提交 0af3a67f 编写于 作者: J Jose Perez Rodriguez 提交者: John Tasler

Adding Api Feedback to PWM classes (#48)

上级 293ce364
// 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 IPwmDriver : IDisposable
{
void OpenChannel(int pwmChannel);
void CloseChannel(int pwmChannel);
void Start(int pwmChannel, double frequency, double dutyCycle);
void Stop(int pwmChannel);
}
}
......@@ -6,14 +6,12 @@ namespace System.Device.Pwm
{
public sealed class PwmController : IDisposable
{
private PwmController() { }
public static PwmController GetController()
public PwmController()
{
throw new NotImplementedException();
}
public static PwmController GetController(IPwmDriver driver)
public PwmController(PwmDriver driver)
{
throw new NotImplementedException();
}
......@@ -33,23 +31,24 @@ namespace System.Device.Pwm
throw new NotImplementedException();
}
public void Start(int pwmChannel, double frequency, double dutyCycle)
public void StartWriting(int pwmChannel, double frequency, double dutyCycle)
{
throw new NotImplementedException();
}
public void Stop(int pwmChannel)
public void StopWriting(int pwmChannel)
{
throw new NotImplementedException();
}
public static bool IsPwmEnabled()
public void Dispose()
{
throw new NotImplementedException();
}
~PwmController() { }
private void Dispose(bool disposing)
{
public void Dispose() { }
}
}
}
// 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 abstract class PwmDriver : IDisposable
{
protected internal abstract void OpenChannel(int pwmChannel);
protected internal abstract void CloseChannel(int pwmChannel);
protected internal abstract void StartWriting(int pwmChannel, double frequency, double dutyCycle);
protected internal abstract void StopWriting(int pwmChannel);
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
// Nothing to do in the base class
}
}
}
......@@ -4,29 +4,24 @@
namespace System.Device.Pwm
{
internal class UnixPwmDriver : IPwmDriver
internal class UnixPwmDriver : PwmDriver
{
public void CloseChannel(int pwmChannel)
protected internal override void CloseChannel(int pwmChannel)
{
throw new NotImplementedException();
}
public void Dispose()
protected internal override void OpenChannel(int pwmChannel)
{
throw new NotImplementedException();
}
public void OpenChannel(int pwmChannel)
protected internal override void StartWriting(int pwmChannel, double frequency, double dutyCycle)
{
throw new NotImplementedException();
}
public void Start(int pwmChannel, double frequency, double dutyCycle)
{
throw new NotImplementedException();
}
public void Stop(int pwmChannel)
protected internal override void StopWriting(int pwmChannel)
{
throw new NotImplementedException();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册