GpioPin GpioPin GpioPin GpioPin GpioPin Class

Definition

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

public : sealed class GpioPin : IClosable
struct winrt::Windows::Devices::Gpio::GpioPin : IClosable
public sealed class GpioPin : IDisposable
Public NotInheritable Class GpioPin Implements IDisposable
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows IoT Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Devices.DevicesLowLevelContract (introduced v1)

Remarks

To get a GpioPin object, use the GpioController.OpenPin or GpioController.TryOpenPin method.

Properties

DebounceTimeout DebounceTimeout DebounceTimeout DebounceTimeout DebounceTimeout

Gets or sets the debounce timeout for the general-purpose I/O (GPIO) pin, which is an interval during which changes to the value of the pin are filtered out, and do not generate ValueChanged events.

PinNumber PinNumber PinNumber PinNumber PinNumber

Gets the pin number of the general-purpose I/O (GPIO) pin.

SharingMode SharingMode SharingMode SharingMode SharingMode

Gets the sharing mode in which the general-purpose I/O (GPIO) pin is open.

Methods

Close() Close() Close() Close() Close()

Closes the general-purpose I/O (GPIO) pin and releases the resources associated with it.

Dispose() Dispose() Dispose() Dispose() Dispose()

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

GetDriveMode() GetDriveMode() GetDriveMode() GetDriveMode() GetDriveMode()

Gets the current drive mode for the general-purpose I/O (GPIO) pin. The drive mode specifies whether the pin is configured as an input or an output, and determines how values are driven onto the pin.

IsDriveModeSupported(GpioPinDriveMode) IsDriveModeSupported(GpioPinDriveMode) IsDriveModeSupported(GpioPinDriveMode) IsDriveModeSupported(GpioPinDriveMode) IsDriveModeSupported(GpioPinDriveMode)

Gets whether the general-purpose I/O (GPIO) pin supports the specified drive mode.

Read() Read() Read() Read() Read()

Reads the current value of the general-purpose I/O (GPIO) pin.

SetDriveMode(GpioPinDriveMode) SetDriveMode(GpioPinDriveMode) SetDriveMode(GpioPinDriveMode) SetDriveMode(GpioPinDriveMode) SetDriveMode(GpioPinDriveMode)

Sets the drive mode of the general-purpose I/O (GPIO) pin. The drive mode specifies whether the pin is configured as an input or an output, and determines how values are driven onto the pin.

Write(GpioPinValue) Write(GpioPinValue) Write(GpioPinValue) Write(GpioPinValue) Write(GpioPinValue)

Drives the specified value onto the general purpose I/O (GPIO) pin according to the current drive mode for the pin if the pin is configured as an output, or updates the latched output value for the pin if the pin is configured as an input.

Events

ValueChanged ValueChanged ValueChanged ValueChanged ValueChanged

Occurs when the value of the general-purpose I/O (GPIO) pin changes, either because of an external stimulus when the pin is configured as an input, or when a value is written to the pin when the pin in configured as an output.

See also