Table of Contents

Class Contact<TLine>

Namespace
Pamoja.Gpio
Assembly
Pamoja.Gpio.dll

A two-state input over any line, with its polarity said once: a button, a float switch, a reed switch, a limit switch. IsAsserted() answers whether it is closed, pressed, or tripped, whatever level that takes on the wire.

public sealed class Contact<TLine> where TLine : IInputLine

Type Parameters

TLine

The line the part is wired to.

Inheritance
Contact<TLine>
Inherited Members

Constructors

Contact(TLine, PinPolarity)

Wraps a line.

public Contact(TLine line, PinPolarity polarity)

Parameters

line TLine

The line the part is wired to.

polarity PinPolarity

How the part is wired.

Properties

Polarity

How the part is wired.

public PinPolarity Polarity { get; }

Property Value

PinPolarity

Methods

IsAsserted()

Reads the line and reports whether the part is asserted.

public bool IsAsserted()

Returns

bool

Whether it is closed, pressed, or tripped.

Exceptions

Exception

Whatever the line throws when it cannot be read.

Level()

Reads the raw level on the line.

public PinLevel Level()

Returns

PinLevel

The level.

Exceptions

Exception

Whatever the line throws when it cannot be read.

Release()

Hands the line back.

public TLine Release()

Returns

TLine

The line.