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
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin | pin | The pin associated with the bi-directional interrupt port. |
Meadow.Hardware.IMeadowIOController | ioController | The Meadow I/O controller. |
System.Boolean | initialState | The initial state of the port. |
Meadow.Hardware.InterruptMode | interruptMode | The interrupt mode for 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, 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
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin | pin | The pin associated with the bi-directional interrupt port. |
Meadow.Hardware.IMeadowIOController | ioController | The Meadow I/O controller. |
System.Boolean | initialState | The initial state of the port. |
Meadow.Hardware.InterruptMode | interruptMode | The interrupt mode for the port. |
Meadow.Hardware.ResistorMode | resistorMode | The resistor mode for the port. |
Meadow.Hardware.PortDirectionType | initialDirection | The initial direction of the port. |
System.TimeSpan | debounceDuration | The debounce duration for the port. |
System.TimeSpan | glitchDuration | The glitch duration for the port. |
Meadow.Hardware.OutputType | outputType | The 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
Type | Name |
---|---|
System.Boolean | disposing |
Implements
- 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