Skip to main content

Interface IDigitalInterruptPort

Contract for ports that are capable of reading digital inputs and raising events when state changes.

Assembly: Meadow.Contracts.dll​
View Source​
Declaration
public interface IDigitalInterruptPort : IDigitalInputPort, IDigitalPort, IPort<IDigitalChannelInfo>, IDisposable, IObservable<IChangeResult<DigitalState>>

Properties​

InterruptMode​

Gets the interrupt mode used to determine when interrupts are raised.

View Source​
Declaration
InterruptMode InterruptMode { get; }

DebounceDuration​

Gets or sets the debounce duration. Effectively a delay after an event where new inputs are ignored

View Source​
Declaration
TimeSpan DebounceDuration { get; set; }

GlitchDuration​

Gets or sets the glitch duration. This is the minimum amount of time a signal needs to be stable before an event is recognized

View Source​
Declaration
TimeSpan GlitchDuration { get; set; }

Methods​

CreateObserver(Action<IChangeResult<DigitalState>>, Predicate<IChangeResult<DigitalState>>?)​

An IObserver that handles change notifications and has an optional predicate that automatically filters results so only results that match the predicate will reach the subscriber.

View Source​
Declaration
public static FilterableChangeObserver<DigitalState> CreateObserver(Action<IChangeResult<DigitalState>> handler, Predicate<IChangeResult<DigitalState>>? filter = null)
Returns​

Meadow.FilterableChangeObserver<UNIT>

Parameters​
TypeName
System.Action<Meadow.IChangeResult<Meadow.Hardware.DigitalState>>handler
System.Predicate<Meadow.IChangeResult<Meadow.Hardware.DigitalState>>filter

Events​

Changed​

Raised when the state of the digital port is changed / updated.

View Source​
Declaration
event EventHandler<DigitalPortResult> Changed
Event Type​

System.EventHandler<Meadow.Hardware.DigitalPortResult>