001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.hal;
006
007public class InterruptJNI extends JNIWrapper {
008  public static final int HalInvalidHandle = 0;
009
010  public static native int initializeInterrupts();
011
012  public static native void cleanInterrupts(int interruptHandle);
013
014  public static native long waitForInterrupt(
015      int interruptHandle, double timeout, boolean ignorePrevious);
016
017  public static native long waitForMultipleInterrupts(
018      int interruptHandle, long mask, double timeout, boolean ignorePrevious);
019
020  public static native long readInterruptRisingTimestamp(int interruptHandle);
021
022  public static native long readInterruptFallingTimestamp(int interruptHandle);
023
024  public static native void requestInterrupts(
025      int interruptHandle, int digitalSourceHandle, int analogTriggerType);
026
027  public static native void setInterruptUpSourceEdge(
028      int interruptHandle, boolean risingEdge, boolean fallingEdge);
029
030  public static native void releaseWaitingInterrupt(int interruptHandle);
031}