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.

Namespace:  Microsoft.SPOT.Hardware
Assembly:  Microsoft.SPOT.Hardware (in Microsoft.SPOT.Hardware.dll)

public sealed class InterruptPort : InputPort

The InterruptPort type exposes the following members.

Public methodInterruptPortInitializes a new instance of the InterruptPort class.

Public propertyGlitchFilterGets or sets the state of the input port's glitch filter. (Inherited from InputPort.)
Public propertyIdGets the indentifier (ID) for a port. (Inherited from Port.)
Public propertyInterruptGets or sets the interrupt mode of the interrupt port.
Public propertyResistorGets or sets the resistor mode of the input port. You set the initial resistor mode value in the InputPort constructor. (Inherited from InputPort.)

Public methodClearInterruptClears the current interrupt on the interrupt port.
Public methodDisableInterruptDisables the interrupt on this InterruptPort object (Overrides NativeEventDispatcher..::..DisableInterrupt()()()().)
Public methodDispose()()()()Releases resources used by this NativeEventDispatcher object. (Inherited from NativeEventDispatcher.)
Public methodEnableInterruptEnables the interrupt on this InterruptPort object. (Overrides NativeEventDispatcher..::..EnableInterrupt()()()().)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodReadReads a Boolean value at the port input. (Inherited from Port.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

Public eventOnInterruptAdds 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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.