KeyboardGpioDriver Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A GPIO Driver for testing on Windows This driver uses the keyboard for simulating GPIO pins. Pins 0-2 are output only and represent the keyboard LEDs (Caps lock, Scroll Lock and Num Lock). Setting a value to any of these pins toggles the LEDs on the keyboard (if they're physically present). Pins above 8 are input only and represent the keyboard keys. To get the pin number, cast the corresponding ConsoleKey to int, e.g. int pinNumber = (int)ConsoleKey.A
public class KeyboardGpioDriver : System.Device.Gpio.GpioDriver
type KeyboardGpioDriver = class
inherit GpioDriver
Public Class KeyboardGpioDriver
Inherits GpioDriver
- Inheritance
Constructors
KeyboardGpioDriver() |
Creates an instance of the KeyboardGpioDriver |
Properties
PinCount |
The number of pins provided by the driver. |
Methods
AddCallbackForPinValueChangedEvent(Int32, PinEventTypes, PinChangeEventHandler) |
Adds a handler for a pin value changed event. |
ClosePin(Int32) |
Closes an open pin. |
ConvertPinNumberToLogicalNumberingScheme(Int32) |
Converts a board pin number to the driver's logical numbering scheme. |
Dispose() |
Disposes this instance, closing all open pins (Inherited from GpioDriver) |
Dispose(Boolean) |
Disposes this instance (Inherited from GpioDriver) |
GetPinMode(Int32) |
Gets the mode of a pin. |
IsPinModeSupported(Int32, PinMode) |
Checks if a pin supports a specific mode. |
OpenPin(Int32) |
Opens a pin in order for it to be ready to use. The driver attempts to open the pin without changing its mode or value. |
QueryComponentInformation() |
Query information about a component and its children. (Inherited from GpioDriver) |
Read(Int32) |
Reads the current value of a pin. |
RemoveCallbackForPinValueChangedEvent(Int32, PinChangeEventHandler) |
Removes a handler for a pin value changed event. |
SetPinMode(Int32, PinMode, PinValue) |
Sets the mode to a pin and sets an initial value for an output pin. (Inherited from GpioDriver) |
SetPinMode(Int32, PinMode) |
Sets the mode to a pin. |
Toggle(Int32) |
Toggle the current value of a pin. |
WaitForEvent(Int32, PinEventTypes, CancellationToken) |
Blocks execution until an event of type eventType is received or a cancellation is requested. |
WaitForEventAsync(Int32, PinEventTypes, CancellationToken) |
Async call until an event of type eventType is received or a cancellation is requested. (Inherited from GpioDriver) |
Write(Int32, PinValue) |
Writes a value to a pin. |