GpioController 类

定义

表示常规用途 I/O (GPIO) 控制器。

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
继承
GpioController
实现

构造函数

GpioController()

初始化 类的新实例,该类 GpioController 将使用逻辑引脚编号方案作为默认方案。

GpioController(PinNumberingScheme)

初始化将使用指定编号方案的 类的新实例 GpioController 。 控制器将默认使用最适用的驱动程序,因为给定程序正在执行的平台。

GpioController(PinNumberingScheme, GpioDriver)

初始化将使用指定编号方案和驱动程序的 类的新实例 GpioController

属性

NumberingScheme

用于表示控制器提供的引脚的编号方案。

PinCount

控制器提供的引脚数。

方法

ClosePin(Int32)

关闭打开的固定。 如果驱动程序允许,则引脚的状态不会更改。

ClosePinCore(Int32)

关闭打开的固定。

Dispose()

表示常规用途 I/O (GPIO) 控制器。

Dispose(Boolean)

释放此实例并关闭与此控制器关联的所有打开的引脚。

GetLogicalPinNumber(Int32)

获取控制器编号方案中的逻辑引脚编号。

GetPinMode(Int32)

获取图钉的模式。

IsPinModeSupported(Int32, PinMode)

检查引脚是否支持特定模式。

IsPinOpen(Int32)

检查特定引脚是否已打开。

OpenPin(Int32)

打开一个固定,以便它可供使用。 驱动程序尝试在不更改其模式或值的情况下打开引脚。

OpenPin(Int32, PinMode)

打开固定并将其设置为特定模式。

OpenPin(Int32, PinMode, PinValue)

打开图钉并将其设置为特定模式和值。

OpenPinCore(Int32)

打开一个固定,以便它可供使用。

QueryComponentInformation()

查询有关组件及其子级的信息。

Read(Int32)

读取图钉的当前值。

Read(Span<PinValuePair>)

读取具有给定引脚编号的给定引脚。

RegisterCallbackForPinValueChangedEvent(Int32, PinEventTypes, PinChangeEventHandler)

添加当 pinNumber 具有 eventType 类型的事件时将调用的回调。

SetPinMode(Int32, PinMode)

将模式设置为固定。

Toggle(Int32)

切换图钉的当前值。

UnregisterCallbackForPinValueChangedEvent(Int32, PinChangeEventHandler)

删除正在为 pinNumber 处的 pin 调用的回调。

WaitForEvent(Int32, PinEventTypes, CancellationToken)

阻止执行,直到收到 eventType 类型的事件或请求取消。

WaitForEvent(Int32, PinEventTypes, TimeSpan)

阻止执行,直到收到 eventType 类型的事件或一段时间已过期。

WaitForEventAsync(Int32, PinEventTypes, CancellationToken)

异步调用,直到收到 eventType 类型的事件或请求取消。

WaitForEventAsync(Int32, PinEventTypes, TimeSpan)

异步调用以等待,直到收到 eventType 类型的事件或一段时间已过期。

Write(Int32, PinValue)

将值写入图钉。

Write(ReadOnlySpan<PinValuePair>)

使用给定值编写给定引脚。

适用于