Share via


GpioChangeReader.Polarity Property

Definition

Gets or sets the polarity of transitions that will be recorded. The polarity may only be changed when pin change recording is not started.

public:
 property GpioChangePolarity Polarity { GpioChangePolarity get(); void set(GpioChangePolarity value); };
GpioChangePolarity Polarity();

void Polarity(GpioChangePolarity value);
public GpioChangePolarity Polarity { get; set; }
var gpioChangePolarity = gpioChangeReader.polarity;
gpioChangeReader.polarity = gpioChangePolarity;
Public Property Polarity As GpioChangePolarity

Property Value

Rising or Falling. The default polarity value is Falling.

Remarks

Listening to a single edge (Falling or Rising) can be considerably more efficient than listening to both edges.

The following exceptions can be thrown when setting the polarity:

  • E_INVALIDARG - value is not a valid GpioChangePolarity value.
  • HRESULT_FROM_WIN32(ERROR_BAD_COMMAND) - change recording is currently active. Polarity can only be set before calling Start() or after calling Stop().

Applies to