Skip to main content

Class BiDirectionalPort

Represents a bi-directional port.

Assembly: Meadow.dll
View Source
public class BiDirectionalPort : BiDirectionalPortBase, IBiDirectionalPort, IDigitalInputPort, IDigitalOutputPort, IDigitalPort, IPort<IDigitalChannelInfo>, IDisposable

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

Implements:
Meadow.Hardware.IBiDirectionalPort, Meadow.Hardware.IDigitalInputPort, 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; }

Methods

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

Creates a new instance of Meadow.Hardware.BiDirectionalPort with the specified parameters.

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

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

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

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

Creates a new instance of Meadow.Hardware.BiDirectionalPort with the specified parameters.

View Source
public static BiDirectionalPort From(IPin pin, IMeadowIOController ioController, bool initialState, ResistorMode resistorMode, PortDirectionType initialDirection, OutputType outputType)
Returns

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

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

~BiDirectionalPort()

Finalizes the Port instance

View Source
protected ~BiDirectionalPort()

Dispose(bool)

Releases the resources used by the port.

View Source
protected override void Dispose(bool disposing)
Parameters
TypeNameDescription
System.BooleandisposingA boolean value indicating whether the port is being disposed.

Implements