Table of Contents

Class KeyMatrix

Namespace
Iot.Device.KeyMatrix
Assembly
Iot.Device.KeyMatrix.dll

GPIO key matrix Driver

public class KeyMatrix
Inheritance
KeyMatrix

Constructors

KeyMatrix(int[], int[], TimeSpan, GpioController?, bool)

Initialize key matrix

public KeyMatrix(int[] outputPins, int[] inputPins, TimeSpan scanInterval, GpioController? gpioController = null, bool shouldDispose = true)

Parameters

outputPins int[]

Output pins

inputPins int[]

Input pins

scanInterval TimeSpan

Scanning interval in milliseconds

gpioController GpioController

GPIO controller

shouldDispose bool

True to dispose the GpioController

Properties

InputPins

Get input pins

public int[] InputPins { get; }

Property Value

int[]

this[int]

Get buttons' values by output

public SpanPinValue this[int output] { get; }

Parameters

output int

Output index

Property Value

SpanPinValue

OutputPins

Get output pins

public int[] OutputPins { get; }

Property Value

int[]

ScanInterval

Get or set interval in milliseconds

public TimeSpan ScanInterval { get; set; }

Property Value

TimeSpan

Values

Get all buttons' values

public SpanPinValue Values { get; }

Property Value

SpanPinValue

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

ReadKey()

Blocks execution until a key event is received

public KeyMatrixEvent? ReadKey()

Returns

KeyMatrixEvent

StartListeningKeyEvent()

Start listening to key events

public void StartListeningKeyEvent()

StopListeningKeyEvent()

Stop listening to key events

public void StopListeningKeyEvent()

Events

KeyEvent

The raised event

public event KeyMatrix.KeyEventHandler? KeyEvent

Event Type

KeyMatrix.KeyEventHandler