Class GpioPinAlertService
Provides GPIO pin functionality to report on alerts based on sampling of 5 microseconds approximately.
Inherited Members
Namespace: Unosquare.PiGpio.ManagedModel
Syntax
public sealed class GpioPinAlertService : GpioPinServiceBase
Properties
GlitchFilterSteadyMicros
Gets the glitch filter steady microseconds. Use ApplyGlitchFilter(Int32) to set.
Declaration
public int GlitchFilterSteadyMicros { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
NoiseFilterActiveMicros
Gets the noise filter active microseconds. Use ApplyNoiseFilter(Int32, Int32) to set.
Declaration
public int NoiseFilterActiveMicros { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
NoiseFilterSteadyMicros
Gets the noise filter steady microseconds. Use ApplyNoiseFilter(Int32, Int32) to set.
Declaration
public int NoiseFilterSteadyMicros { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
TimeoutMilliseconds
Gets or sets the watchdog timeout milliseconds. When no changes are detected for this amount of time, the callback returns with a no level change.
Declaration
public int TimeoutMilliseconds { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 | The timeout in milliseconds. |
Methods
ApplyGlitchFilter(Int32)
Applies a glitch filter to alert triggering. Prevents reporting signals that are not steady for at least the given number of microseconds.
Declaration
public void ApplyGlitchFilter(int steadyMicroseconds)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | steadyMicroseconds | The steady microseconds. |
ApplyNoiseFilter(Int32, Int32)
Applies a noise filter to alert triggering.
Level changes on the GPIO are ignored until a level which has
been stable for steadyMicroseconds microseconds is detected. Level changes
on the GPIO are then reported for activeMicroseconds microseconds after
which the process repeats.
Declaration
public void ApplyNoiseFilter(int steadyMicroseconds, int activeMicroseconds)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | steadyMicroseconds | The steady microseconds. |
| Int32 | activeMicroseconds | The active microseconds. |
ResetGlitchFilter()
Resets the glitch filter.
Declaration
public void ResetGlitchFilter()
ResetNoiseFilter()
Resets the noise filter.
Declaration
public void ResetNoiseFilter()
ResolveAvailable()
Resolves the availability of this service for the associated pin.
Declaration
protected override bool ResolveAvailable()
Returns
| Type | Description |
|---|---|
| Boolean | True when the service is deemed as available. |
Overrides
Start(PiGpioAlertDelegate)
Start the alert callbacks.
Declaration
public void Start(PiGpioAlertDelegate callback)
Parameters
| Type | Name | Description |
|---|---|---|
| PiGpioAlertDelegate | callback | The callback. |
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException | IsUserGpio is false. |
| ArgumentNullException | callback - ClearAlertCallback. |
| ArgumentException | A callback is already registered. Clear the current callback before registering a new one. - callback. |
Stop()
Clears the alert callback and stops reporting changes.
Declaration
public void Stop()
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException | IsUserGpio is false. |