Share via


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.

Inheritance Hierarchy

System. . :: . .Object
  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)

Syntax

'Declaration
Public NotInheritable Class InterruptPort _
    Inherits InputPort
public sealed class InterruptPort : InputPort
public ref class InterruptPort sealed : public InputPort
[<Sealed>]
type InterruptPort =  
    class
        inherit InputPort
    end
public final class InterruptPort extends InputPort

The InterruptPort type exposes the following members.

Constructors

  Name Description
Public method InterruptPort Initializes a new instance of the InterruptPort class.

Top

Properties

  Name Description
Public property GlitchFilter Gets or sets the state of the input port's glitch filter. (Inherited from InputPort.)
Public property Id Gets the indentifier (ID) for a port. (Inherited from Port.)
Public property Interrupt Gets or sets the interrupt mode of the interrupt port.
Public property 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.)

Top

Methods

  Name Description
Public method ClearInterrupt Clears the current interrupt on the interrupt port.
Public method DisableInterrupt Disables the interrupt on this InterruptPort object (Overrides NativeEventDispatcher. . :: . .DisableInterrupt() () () ().)
Public method Dispose() () () () Releases resources used by this NativeEventDispatcher object. (Inherited from NativeEventDispatcher.)
Public method EnableInterrupt Enables the interrupt on this InterruptPort object. (Overrides NativeEventDispatcher. . :: . .EnableInterrupt() () () ().)
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Read Reads a Boolean value at the port input. (Inherited from Port.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Events

  Name Description
Public event OnInterrupt Adds or removes callback methods for native events. (Inherited from NativeEventDispatcher.)

Top

Remarks

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.

Thread Safety

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

See Also

Reference

Microsoft.SPOT.Hardware Namespace