Class GpioOutputSegment
- Namespace
- Iot.Device.Multiplexing
- Assembly
- Iot.Device.Multiplexing.dll
IOutputSegment implementation that uses GpioController.
public class GpioOutputSegment : IOutputSegment
- Inheritance
-
GpioOutputSegment
- Implements
Constructors
GpioOutputSegment(int[], GpioController?, bool)
IOutputSegment implementation that uses GpioController.
public GpioOutputSegment(int[] pins, GpioController? gpioController = null, bool shouldDispose = true)
Parameters
pinsint[]The GPIO pins that should be used and are connected.
gpioControllerGpioControllerThe GpioController to use. If one isn't provided, one will be created.
shouldDisposeboolThe policy to use (true, by default) for disposing the GPIO controller when disposing this instance.
Properties
this[int]
Segment values.
public PinValue this[int index] { get; set; }
Parameters
indexint
Property Value
Length
The length of the segment; the number of GPIO pins it exposes.
public int Length { get; }
Property Value
Methods
Display(CancellationToken)
Displays current state of segment. Segment is displayed at least until token receives a cancellation signal, possibly due to a specified duration expiring.
public void Display(CancellationToken token)
Parameters
tokenCancellationToken
Dispose()
Disposes the underlying GpioController.
public void Dispose()
TurnOffAll()
Writes a byte to the underlying GpioController.
public void TurnOffAll()
Write(byte)
Writes discrete underlying bits to a virtual segment. Writes each bit, left to right. Least significant bit will written to index 0. Does not display output.
public void Write(byte value)
Parameters
valuebyte
Write(int, PinValue)
Writes a PinValue to a virtual segment. Does not display output.
public void Write(int pin, PinValue value)
Parameters
Write(SpanByte)
Writes discrete underlying bits to a virtual segment. Writes each byte, left to right. Least significant bit will written to index 0. Does not display output.
public void Write(SpanByte value)
Parameters
valueSpanByte