001package edu.wpi.first.wpilibj.hal; 002 003import java.nio.IntBuffer; 004import java.nio.ByteBuffer; 005 006public class CounterJNI extends JNIWrapper { 007 public static native ByteBuffer initializeCounter(int mode, IntBuffer index, IntBuffer status); 008 public static native void freeCounter(ByteBuffer counter_pointer, IntBuffer status); 009 public static native void setCounterAverageSize(ByteBuffer counter_pointer, int size, IntBuffer status); 010 public static native void setCounterUpSource(ByteBuffer counter_pointer, int pin, byte analogTrigger, IntBuffer status); 011 public static native void setCounterUpSourceEdge(ByteBuffer counter_pointer, byte risingEdge, byte fallingEdge, IntBuffer status); 012 public static native void clearCounterUpSource(ByteBuffer counter_pointer, IntBuffer status); 013 public static native void setCounterDownSource(ByteBuffer counter_pointer, int pin, byte analogTrigger, IntBuffer status); 014 public static native void setCounterDownSourceEdge(ByteBuffer counter_pointer, byte risingEdge, byte fallingEdge, IntBuffer status); 015 public static native void clearCounterDownSource(ByteBuffer counter_pointer, IntBuffer status); 016 public static native void setCounterUpDownMode(ByteBuffer counter_pointer, IntBuffer status); 017 public static native void setCounterExternalDirectionMode(ByteBuffer counter_pointer, IntBuffer status); 018 public static native void setCounterSemiPeriodMode(ByteBuffer counter_pointer, byte highSemiPeriod, IntBuffer status); 019 public static native void setCounterPulseLengthMode(ByteBuffer counter_pointer, double threshold, IntBuffer status); 020 public static native int getCounterSamplesToAverage(ByteBuffer counter_pointer, IntBuffer status); 021 public static native void setCounterSamplesToAverage(ByteBuffer counter_pointer, int samplesToAverage, IntBuffer status); 022 public static native void resetCounter(ByteBuffer counter_pointer, IntBuffer status); 023 public static native int getCounter(ByteBuffer counter_pointer, IntBuffer status); 024 public static native double getCounterPeriod(ByteBuffer counter_pointer, IntBuffer status); 025 public static native void setCounterMaxPeriod(ByteBuffer counter_pointer, double maxPeriod, IntBuffer status); 026 public static native void setCounterUpdateWhenEmpty(ByteBuffer counter_pointer, byte enabled, IntBuffer status); 027 public static native byte getCounterStopped(ByteBuffer counter_pointer, IntBuffer status); 028 public static native byte getCounterDirection(ByteBuffer counter_pointer, IntBuffer status); 029 public static native void setCounterReverseDirection(ByteBuffer counter_pointer, byte reverseDirection, IntBuffer status); 030}