InterruptPort Class
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Represents an interrupt port.
Microsoft.SPOT.Hardware..::..NativeEventDispatcher
Microsoft.SPOT.Hardware..::..Port
Microsoft.SPOT.Hardware..::..InputPort
Microsoft.SPOT.Hardware..::..InterruptPort
Namespace: Microsoft.SPOT.Hardware
Assembly: Microsoft.SPOT.Hardware (in Microsoft.SPOT.Hardware.dll)
The InterruptPort type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | GlitchFilter | Gets or sets the state of the input port's glitch filter. (Inherited from InputPort.) |
![]() | Id | Gets the indentifier (ID) for a port. (Inherited from Port.) |
![]() | Interrupt | Gets or sets the interrupt mode of the interrupt port. |
![]() | Resistor | Gets or sets the resistor mode of the input port. You set the initial resistor mode value in the InputPort constructor. (Inherited from InputPort.) |
| Name | Description | |
|---|---|---|
![]() | ClearInterrupt | Clears the current interrupt on the interrupt port. |
![]() | DisableInterrupt | Disables the interrupt on this InterruptPort object (Overrides NativeEventDispatcher..::..DisableInterrupt()()()().) |
![]() | Dispose()()()() | Releases resources used by this NativeEventDispatcher object. (Inherited from NativeEventDispatcher.) |
![]() | EnableInterrupt | Enables the interrupt on this InterruptPort object. (Overrides NativeEventDispatcher..::..EnableInterrupt()()()().) |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | Read | Reads a Boolean value at the port input. (Inherited from Port.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | OnInterrupt | Adds or removes callback methods for native events. (Inherited from NativeEventDispatcher.) |
This class cannot be inherited.
When configuring an interrupt port, note the differences between level and nonlevel interrupts. Level interrupts, which are either InterruptEdgeLevelHigh or InterruptEdgeLevelLow interrupts, are dispatched when the value on a pin matches the specified high value or low value, respectively. The system dispatches only the first occurrence of a level interrupt until it is cleared by means of the ClearInterrupt method. With nonlevel interrupts, every specified edge is dispatched, and the ClearInterrupt method throws an InvalidOperationException.
In practice, it is best to use level interrupts when the interrupt condition needs to be checked only periodically.
It is possible to configure an InterruptPort object into an invalid state. In such cases, your program may not generate an exception until it actually uses the InterruptPort object. For example, suppose you create an InterruptPort object with its resistor mode set to PullUp, the interrupt mode set to InterruptEdgeLevelHigh, and the glitch filter set to true. This configuration does not generate an exception when you instantiate an InterruptPort object. If you then add an interrupt handler, the .NET Micro Framework throws an exception.
