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
Declaration
public class BiDirectionalInterruptPort : BiDirectionalInterruptPortBase, IBiDirectionalPort, IBiDirectionalInterruptPort, IDigitalInterruptPort, IDigitalInputPort, IObservable<IChangeResult<DigitalState>>, IDigitalOutputPort, IDigitalPort, IPort<IDigitalChannelInfo>, IDisposable

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

Implements:

Expand

Properties

IOController

Gets or sets the port's IOController

View Source
Declaration
protected IMeadowIOController IOController { get; }

LastEventTime

Gets or sets the last event time for the port.

View Source
Declaration
protected int LastEventTime { get; set; }

Direction

Gets or sets the current direction of the port

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

State

Gets or sets the current state of the port

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

DebounceDuration

Gets or sets the debounce duration of the port

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

GlitchDuration

Gets or sets the glitch filter duration of the port

View Source
Declaration
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
Declaration
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.

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
Declaration
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.

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
Declaration
protected ~BiDirectionalInterruptPort()

Dispose(bool)

Releases allocated port resources

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

Implements