Class GpioPinInterruptService
Provides Interrupt Service Routine callback services on the GPIO pin.
Inherited Members
Namespace: Unosquare.PiGpio.ManagedModel
Syntax
public sealed class GpioPinInterruptService : GpioPinServiceBase
Properties
EdgeDetection
Gets or sets the edge detection strategy.
Declaration
public EdgeDetection EdgeDetection { get; set; }
Property Value
Type | Description |
---|---|
EdgeDetection |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | EdgeDetection cannot be set when callbacks have started. |
TimeoutMilliseconds
Gets or sets the ISR 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
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(PiGpioIsrDelegate)
Starts the hardware ISR callbacks.
Declaration
public void Start(PiGpioIsrDelegate callback)
Parameters
Type | Name | Description |
---|---|---|
PiGpioIsrDelegate | 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. |
Start(PiGpioIsrDelegate, EdgeDetection, Int32)
Starts the hardware ISR callbacks.
Declaration
public void Start(PiGpioIsrDelegate callback, EdgeDetection edgeDetection, int timeoutMilliseconds)
Parameters
Type | Name | Description |
---|---|---|
PiGpioIsrDelegate | callback | The callback. |
EdgeDetection | edgeDetection | The edge detection. |
Int32 | timeoutMilliseconds | The timeout milliseconds. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | callback - Use Stop first. |
ArgumentException | A callback is already registered. Clear the current callback before registering a new one. - callback. |
Stop()
Stops the hardware ISR callbacks.
Declaration
public void Stop()