Table of Contents

Class PinScript

Namespace
Pamoja.Gpio
Assembly
Pamoja.Gpio.dll

A line for running with nothing plugged in: it answers the reads it was given, in order, and records every level it is driven to. It is what the examples and tests put under a switch or a contact, and the one thing a real node replaces with its board's pin library.

public sealed class PinScript : IOutputLine, IInputLine
Inheritance
PinScript
Implements
Inherited Members

Remarks

It behaves as pamoja_hal::script::PinScript does in Rust: it starts released, high, and once its reads run out a read answers the level it was last driven to.

Constructors

PinScript(params PinLevel[])

Creates a released line.

public PinScript(params PinLevel[] inputs)

Parameters

inputs PinLevel[]

The levels to answer reads with, in order.

Properties

Driven

Every level the line was driven to, oldest first.

public IReadOnlyList<PinLevel> Driven { get; }

Property Value

IReadOnlyList<PinLevel>

Level

The level the line was last driven to, high while it has never been driven.

public PinLevel Level { get; }

Property Value

PinLevel

Remaining

How many scripted reads are left.

public int Remaining { get; }

Property Value

int

Methods

Drive(PinLevel)

Records a driven level.

public void Drive(PinLevel level)

Parameters

level PinLevel

The level driven.

Read()

Answers the next scripted level, or the driven level once the script runs out.

public PinLevel Read()

Returns

PinLevel

The level.