Skip to main content

Class BiDirectionalInterruptPortBase

A base class for IBiDirectionalInterruptPort implementations

Assembly: Meadow.Contracts.dll
View Source
public abstract class BiDirectionalInterruptPortBase : BiDirectionalPortBase, IBiDirectionalPort, IBiDirectionalInterruptPort, IDigitalInterruptPort, IDigitalInputPort, IObservable<IChangeResult<DigitalState>>, IDigitalOutputPort, IDigitalPort, IPort<IDigitalChannelInfo>, IDisposable

Inheritance: System.Object -> Meadow.Hardware.PortBase<C> -> Meadow.Hardware.DigitalPortBase -> Meadow.Hardware.BiDirectionalPortBase

Derived:
Meadow.Hardware.BiDirectionalInterruptPort

Implements:

Expand

Meadow.Hardware.IBiDirectionalPort, Meadow.Hardware.IBiDirectionalInterruptPort, Meadow.Hardware.IDigitalInterruptPort, Meadow.Hardware.IDigitalInputPort, System.IObservable<Meadow.IChangeResult<Meadow.Hardware.DigitalState>>, Meadow.Hardware.IDigitalOutputPort, Meadow.Hardware.IDigitalPort, Meadow.Hardware.IPort<C>, System.IDisposable

Properties

Observers

Gets a list of port State observers

View Source
protected List<IObserver<IChangeResult<DigitalState>>> Observers { get; }

DebounceDuration

Gets or sets the debounce duration of the port

View Source
public abstract TimeSpan DebounceDuration { get; set; }

GlitchDuration

Gets or sets the glitch filter duration of the port

View Source
public abstract TimeSpan GlitchDuration { get; set; }

InterruptMode

Gets or sets a value indicating the type of interrupt monitoring this input.

View Source
public InterruptMode InterruptMode { get; protected set; }

Methods

RaiseChangedAndNotify(DigitalPortResult)

Raises the Changed event and notifies all observers of a state change

View Source
protected void RaiseChangedAndNotify(DigitalPortResult changeResult)
Parameters
TypeName
Meadow.Hardware.DigitalPortResultchangeResult

Subscribe(IObserver<IChangeResult<DigitalState>>)

Adds a state observer to the port

View Source
public IDisposable Subscribe(IObserver<IChangeResult<DigitalState>> observer)
Returns

System.IDisposable

Parameters
TypeName
System.IObserver<Meadow.IChangeResult<Meadow.Hardware.DigitalState>>observer

Dispose(bool)

Releases allocated port resources

View Source
protected override void Dispose(bool disposing)
Parameters
TypeName
System.Booleandisposing

Events

Changed

Event raised when the port value changes

View Source
public event EventHandler<DigitalPortResult> Changed
Event Type

System.EventHandler<Meadow.Hardware.DigitalPortResult>

Implements