Change Reader Class
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.
Represents a shared circular buffer between kernel mode and user mode into which high-resolution timestamps are placed when a general-purpose I/O (GPIO) pin changes value.
public ref class GpioChangeReader sealed : IClosable
/// [Windows.Foundation.Metadata.Activatable(Windows.Devices.Gpio.IGpioChangeReaderFactory, 196608, "Windows.Devices.DevicesLowLevelContract")] /// [Windows.Foundation.Metadata.ContractVersion(Windows.Devices.DevicesLowLevelContract, 196608)] /// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] class GpioChangeReader final : IClosable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Devices.Gpio.IGpioChangeReaderFactory), 196608, "Windows.Devices.DevicesLowLevelContract")] [Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Devices.DevicesLowLevelContract), 196608)] [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] public sealed class GpioChangeReader : System.IDisposable
function GpioChangeReader(pin, minCapacity)
Public NotInheritable Class GpioChangeReader Implements IDisposable
Windows 10 Creators Update (introduced in 10.0.15063.0)
Windows.Devices.DevicesLowLevelContract (introduced in v3.0)
Kernel mode places a timestamp into the buffer when a pin changes value, and user mode removes items from the buffer. An overflow occurs when there is no longer sufficient room in the buffer to place additional timestamps. Upon overflow, further events are not recorded, and the IsOverflowed property will return true.
This class is not thread-safe. Calling functions of this class concurrently from multiple threads will have unpredictable results.
Creates a new GpioChangeReader associated with the specified pin. Only a single GpioChangeReader may be associated with a pin at any given time.
Creates a new GpioChangeReader associated with the specified pin and with the specified minimum capacity for change records. Only a single GpioChangeReader may be associated with a pin at any given time.
Gets the maximum number of change records that the GpioChangeReader can store at one time.
Gets whether there are currently zero change records in the reader.
Gets whether an attempt to place a change record into the reader's buffer has failed due to the buffer being full.
Gets whether pin change recording is currently active.
Gets the number of records currently in the change reader.
Gets or sets the polarity of transitions that will be recorded. The polarity may only be changed when pin change recording is not started.
Discards all change records from the reader's buffer.
Closes the change reader, releasing the associated memory buffer and disassociating the reader from its pin.
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Removes and returns all items current in the reader's buffer.
Retrieves and removes the earliest inserted change record from the reader's buffer.
Retrieves the earlier inserted change record from the reader's buffer, without removing it.
Starts recording changes in pin polarity. This method may only be called when change recording is not already active.
Stop recording changes in pin polarity. This method may only be called when change recording is currently active.
Waits for the buffer to fill with at least count number of items, at which point the async action will complete. This action is cancelable.