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 int waitForInterrupt(
015      int interruptHandle, double timeout, boolean ignorePrevious);
016
017  public static native long readInterruptRisingTimestamp(int interruptHandle);
018
019  public static native long readInterruptFallingTimestamp(int interruptHandle);
020
021  public static native void requestInterrupts(
022      int interruptHandle, int digitalSourceHandle, int analogTriggerType);
023
024  public static native void setInterruptUpSourceEdge(
025      int interruptHandle, boolean risingEdge, boolean fallingEdge);
026
027  public static native void releaseWaitingInterrupt(int interruptHandle);
028}