Table of Contents

Struct PinValue

Namespace
System.Device.Gpio
Assembly
System.Device.Gpio.dll

Represents a value for a pin.

public readonly struct PinValue
Inherited Members

Properties

High

The value of the pin is high.

public static PinValue High { get; }

Property Value

PinValue

Low

The value of the pin is low.

public static PinValue Low { get; }

Property Value

PinValue

Methods

Equals(PinValue)

Returns true if the other instance represents the same PinValue than this.

public bool Equals(PinValue other)

Parameters

other PinValue

Returns

bool

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

ToString()

Returns "Low" for Low and "High" for High

public override string ToString()

Returns

string

Operators

operator ==(PinValue, PinValue)

Equality operator

public static bool operator ==(PinValue a, PinValue b)

Parameters

a PinValue
b PinValue

Returns

bool

explicit operator bool(PinValue)

Conversion to byte. Returns true on High, false on Low

public static explicit operator bool(PinValue value)

Parameters

value PinValue

PinValue to convert

Returns

bool

explicit operator byte(PinValue)

Conversion to byte. Returns 1 on High, 0 on Low

public static explicit operator byte(PinValue value)

Parameters

value PinValue

PinValue to convert

Returns

byte

explicit operator int(PinValue)

Conversion to int. Returns 1 on High, 0 on Low

public static explicit operator int(PinValue value)

Parameters

value PinValue

PinValue to convert

Returns

int

implicit operator PinValue(bool)

Implicit conversion from bool. false means Low, true means High

public static implicit operator PinValue(bool value)

Parameters

value bool

Value to set

Returns

PinValue

implicit operator PinValue(int)

Implicit conversion from int. 0 means Low, everything else means High.

public static implicit operator PinValue(int value)

Parameters

value int

Value to set

Returns

PinValue

operator !=(PinValue, PinValue)

Inequality operator

public static bool operator !=(PinValue a, PinValue b)

Parameters

a PinValue
b PinValue

Returns

bool