GpioController Class

Definition

Represents a general-purpose I/O (GPIO) controller.

public sealed class GpioController : IDisposable
public class GpioController : IDisposable
type GpioController = class
    interface IDisposable
Public NotInheritable Class GpioController
Implements IDisposable
Public Class GpioController
Implements IDisposable
Inheritance
GpioController
Implements

Constructors

GpioController()

Initializes a new instance of the GpioController class that will use the logical pin numbering scheme as default.

GpioController(PinNumberingScheme)

Initializes a new instance of the GpioController class that will use the specified numbering scheme. The controller will default to use the driver that best applies given the platform the program is executing on.

GpioController(PinNumberingScheme, GpioDriver)

Initializes a new instance of the GpioController class that will use the specified numbering scheme and driver.

Properties

NumberingScheme

The numbering scheme used to represent pins provided by the controller.

PinCount

The number of pins provided by the controller.

Methods

ClosePin(Int32)

Closes an open pin. If allowed by the driver, the state of the pin is not changed.

ClosePinCore(Int32)

Closes an open pin.

Dispose()

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

Dispose(Boolean)

Disposes this instance and closes all open pins associated with this controller.

GetLogicalPinNumber(Int32)

Gets the logical pin number in the controller's numbering scheme.

GetPinMode(Int32)

Gets the mode of a pin.

IsPinModeSupported(Int32, PinMode)

Checks if a pin supports a specific mode.

IsPinOpen(Int32)

Checks if a specific pin is open.

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.

OpenPin(Int32, PinMode)

Opens a pin and sets it to a specific mode.

OpenPin(Int32, PinMode, PinValue)

Opens a pin and sets it to a specific mode and value.

OpenPinCore(Int32)

Opens a pin in order for it to be ready to use.

QueryComponentInformation()

Query information about a component and its children.

Read(Int32)

Reads the current value of a pin.

Read(Span<PinValuePair>)

Read the given pins with the given pin numbers.

RegisterCallbackForPinValueChangedEvent(Int32, PinEventTypes, PinChangeEventHandler)

Adds a callback that will be invoked when pinNumber has an event of type eventType.

SetPinMode(Int32, PinMode)

Sets the mode to a pin.

Toggle(Int32)

Toggle the current value of a pin.

UnregisterCallbackForPinValueChangedEvent(Int32, PinChangeEventHandler)

Removes a callback that was being invoked for pin at pinNumber.

WaitForEvent(Int32, PinEventTypes, CancellationToken)

Blocks execution until an event of type eventType is received or a cancellation is requested.

WaitForEvent(Int32, PinEventTypes, TimeSpan)

Blocks execution until an event of type eventType is received or a period of time has expired.

WaitForEventAsync(Int32, PinEventTypes, CancellationToken)

Async call until an event of type eventType is received or a cancellation is requested.

WaitForEventAsync(Int32, PinEventTypes, TimeSpan)

Async call to wait until an event of type eventType is received or a period of time has expired.

Write(Int32, PinValue)

Writes a value to a pin.

Write(ReadOnlySpan<PinValuePair>)

Write the given pins with the given values.

Applies to