Class DigitalInterruptPort
Represents a port that is capable of reading digital input.
Assembly: Meadow.dll
View Source
public class DigitalInterruptPort : DigitalInterruptPortBase, IDigitalInterruptPort, IDigitalInputPort, IDigitalPort, IPort<IDigitalChannelInfo>, IDisposable, IObservable<IChangeResult<DigitalState>>
Inheritance: System.Object
-> Meadow.Hardware.PortBase<C> -> Meadow.Hardware.DigitalPortBase -> Meadow.Hardware.DigitalInputPortBase -> Meadow.Hardware.DigitalInterruptPortBase
Implements:
Meadow.Hardware.IDigitalInterruptPort, Meadow.Hardware.IDigitalInputPort, Meadow.Hardware.IDigitalPort, Meadow.Hardware.IPort<C>, System.IDisposable
, System.IObservable<Meadow.IChangeResult<Meadow.Hardware.DigitalState>>
Properties
IOController
View Source
protected IMeadowIOController IOController { get; set; }
Resistor
Gets or Sets the internal resistor mode for the input
View Source
public override ResistorMode Resistor { get; set; }
State
Gets the current State of the input (True == high, False == low)
View Source
public override bool State { get; }
DebounceDuration
Gets or Sets the interrupt debounce duration
View Source
public override TimeSpan DebounceDuration { get; set; }
GlitchDuration
Gets or Sets the interrupt glitch filter duration
View Source
public override TimeSpan GlitchDuration { get; set; }
Methods
From(IPin, IMeadowIOController, InterruptMode, ResistorMode, TimeSpan, TimeSpan)
Creates a DigitalInterruptPort with the specified parameters
View Source
public static DigitalInterruptPort From(IPin pin, IMeadowIOController ioController, InterruptMode interruptMode, ResistorMode resistorMode, TimeSpan debounceDuration, TimeSpan glitchDuration)
Returns
Meadow.Hardware.DigitalInterruptPort
Parameters
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin | pin | The IPin the port is on |
Meadow.Hardware.IMeadowIOController | ioController | The IIoController used to control the IPin |
Meadow.Hardware.InterruptMode | interruptMode | The interrupt mode for the port |
Meadow.Hardware.ResistorMode | resistorMode | The resistor mode for the port |
System.TimeSpan | debounceDuration | The debounce duration used for interrupts |
System.TimeSpan | glitchDuration | The glitch filter duration used for interrupts |
Dispose(bool)
Releases Port resources
View Source
protected override void Dispose(bool disposing)
Parameters
Type | Name |
---|---|
System.Boolean | disposing |
~DigitalInterruptPort()
Finalizes the Port instance
View Source
protected ~DigitalInterruptPort()
Implements
- Meadow.Hardware.IDigitalInterruptPort
- Meadow.Hardware.IDigitalInputPort
- Meadow.Hardware.IDigitalPort
- Meadow.Hardware.IPort<C>
System.IDisposable
System.IObservable<Meadow.IChangeResult<Meadow.Hardware.DigitalState>>