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
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin | pin | The pin associated with the bi-directional port. |
Meadow.Hardware.IMeadowIOController | ioController | The Meadow I/O controller. |
System.Boolean | initialState | The initial state of the port. |
Meadow.Hardware.ResistorMode | resistorMode | The resistor mode for the port. |
Meadow.Hardware.PortDirectionType | initialDirection | The 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
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin | pin | The pin associated with the bi-directional port. |
Meadow.Hardware.IMeadowIOController | ioController | The Meadow I/O controller. |
System.Boolean | initialState | The initial state of the port. |
Meadow.Hardware.ResistorMode | resistorMode | The resistor mode for the port. |
Meadow.Hardware.PortDirectionType | initialDirection | The initial direction of the port. |
Meadow.Hardware.OutputType | outputType | The 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
Type | Name | Description |
---|---|---|
System.Boolean | disposing | A boolean value indicating whether the port is being disposed. |