Skip to main content

Class BiDirectionalInterruptPort

Represents a port that is capable of reading and writing digital input and output.

Assembly: Meadow.dll
View Source
public class BiDirectionalInterruptPort : BiDirectionalInterruptPortBase, 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 -> Meadow.Hardware.BiDirectionalInterruptPortBase

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

IOController

Gets or sets the port's IOController

View Source
protected IMeadowIOController IOController { get; }

LastEventTime

Gets or sets the last event time for the port.

View Source
protected DateTime LastEventTime { get; set; }

Direction

Gets or sets the current direction of the port

View Source
public override PortDirectionType Direction { get; set; }

State

Gets or sets the current state of the port

View Source
public override bool State { get; set; }

DebounceDuration

Gets or sets the debounce duration of the port

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

GlitchDuration

Gets or sets the glitch filter duration of the port

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

Methods

From(IPin, IMeadowIOController, bool, InterruptMode, ResistorMode, PortDirectionType)

Creates a new instance of Meadow.Hardware.BiDirectionalInterruptPort with default debounce and glitch durations.

View Source
public static BiDirectionalInterruptPort From(IPin pin, IMeadowIOController ioController, bool initialState = false, InterruptMode interruptMode = InterruptMode.None, ResistorMode resistorMode = ResistorMode.Disabled, PortDirectionType initialDirection = PortDirectionType.Input)
Returns

Meadow.Hardware.BiDirectionalInterruptPort: A new instance of Meadow.Hardware.BiDirectionalInterruptPort.

Parameters
TypeNameDescription
Meadow.Hardware.IPinpinThe pin associated with the bi-directional interrupt port.
Meadow.Hardware.IMeadowIOControllerioControllerThe Meadow I/O controller.
System.BooleaninitialStateThe initial state of the port.
Meadow.Hardware.InterruptModeinterruptModeThe interrupt mode for the port.
Meadow.Hardware.ResistorModeresistorModeThe resistor mode for the port.
Meadow.Hardware.PortDirectionTypeinitialDirectionThe initial direction of the port.

From(IPin, IMeadowIOController, bool, InterruptMode, ResistorMode, PortDirectionType, TimeSpan, TimeSpan, OutputType)

Creates a new instance of Meadow.Hardware.BiDirectionalInterruptPort.

View Source
public static BiDirectionalInterruptPort From(IPin pin, IMeadowIOController ioController, bool initialState, InterruptMode interruptMode, ResistorMode resistorMode, PortDirectionType initialDirection, TimeSpan debounceDuration, TimeSpan glitchDuration, OutputType outputType)
Returns

Meadow.Hardware.BiDirectionalInterruptPort: A new instance of Meadow.Hardware.BiDirectionalInterruptPort.

Parameters
TypeNameDescription
Meadow.Hardware.IPinpinThe pin associated with the bi-directional interrupt port.
Meadow.Hardware.IMeadowIOControllerioControllerThe Meadow I/O controller.
System.BooleaninitialStateThe initial state of the port.
Meadow.Hardware.InterruptModeinterruptModeThe interrupt mode for the port.
Meadow.Hardware.ResistorModeresistorModeThe resistor mode for the port.
Meadow.Hardware.PortDirectionTypeinitialDirectionThe initial direction of the port.
System.TimeSpandebounceDurationThe debounce duration for the port.
System.TimeSpanglitchDurationThe glitch duration for the port.
Meadow.Hardware.OutputTypeoutputTypeThe output type for the port.

~BiDirectionalInterruptPort()

Finalizes the Port instance

View Source
protected ~BiDirectionalInterruptPort()

Dispose(bool)

Releases allocated port resources

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

Implements