edu.wpi.first.wpilibj.hal

## Class CounterJNI

- java.lang.Object
- - edu.wpi.first.wpilibj.hal.JNIWrapper
  - - edu.wpi.first.wpilibj.hal.CounterJNI

-     public class CounterJNI
      extends JNIWrapper

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CounterJNI()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `clearCounterDownSource(int counterHandle)`
    `static void` | `clearCounterUpSource(int counterHandle)`
    `static void` | `freeCounter(int counterHandle)`
    `static int` | `getCounter(int counterHandle)`
    `static boolean` | `getCounterDirection(int counterHandle)`
    `static double` | `getCounterPeriod(int counterHandle)`
    `static int` | `getCounterSamplesToAverage(int counterHandle)`
    `static boolean` | `getCounterStopped(int counterHandle)`
    `static int` | `initializeCounter(int mode, java.nio.IntBuffer index)`
    `static void` | `resetCounter(int counterHandle)`
    `static void` | `setCounterAverageSize(int counterHandle, int size)`
    `static void` | `setCounterDownSource(int counterHandle, int digitalSourceHandle, int analogTriggerType)`
    `static void` | `setCounterDownSourceEdge(int counterHandle, boolean risingEdge, boolean fallingEdge)`
    `static void` | `setCounterExternalDirectionMode(int counterHandle)`
    `static void` | `setCounterMaxPeriod(int counterHandle, double maxPeriod)`
    `static void` | `setCounterPulseLengthMode(int counterHandle, double threshold)`
    `static void` | `setCounterReverseDirection(int counterHandle, boolean reverseDirection)`
    `static void` | `setCounterSamplesToAverage(int counterHandle, int samplesToAverage)`
    `static void` | `setCounterSemiPeriodMode(int counterHandle, boolean highSemiPeriod)`
    `static void` | `setCounterUpdateWhenEmpty(int counterHandle, boolean enabled)`
    `static void` | `setCounterUpDownMode(int counterHandle)`
    `static void` | `setCounterUpSource(int counterHandle, int digitalSourceHandle, int analogTriggerType)`
    `static void` | `setCounterUpSourceEdge(int counterHandle, boolean risingEdge, boolean fallingEdge)`

    - ### Methods inherited from class edu.wpi.first.wpilibj.hal.JNIWrapper

      `getPort, getPortWithModule`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CounterJNI

          public CounterJNI()

  - ### Method Detail

    - #### initializeCounter

          public static int initializeCounter(int mode,
                                              java.nio.IntBuffer index)

    - #### freeCounter

          public static void freeCounter(int counterHandle)

    - #### setCounterAverageSize

          public static void setCounterAverageSize(int counterHandle,
                                                   int size)

    - #### setCounterUpSource

          public static void setCounterUpSource(int counterHandle,
                                                int digitalSourceHandle,
                                                int analogTriggerType)

    - #### setCounterUpSourceEdge

          public static void setCounterUpSourceEdge(int counterHandle,
                                                    boolean risingEdge,
                                                    boolean fallingEdge)

    - #### clearCounterUpSource

          public static void clearCounterUpSource(int counterHandle)

    - #### setCounterDownSource

          public static void setCounterDownSource(int counterHandle,
                                                  int digitalSourceHandle,
                                                  int analogTriggerType)

    - #### setCounterDownSourceEdge

          public static void setCounterDownSourceEdge(int counterHandle,
                                                      boolean risingEdge,
                                                      boolean fallingEdge)

    - #### clearCounterDownSource

          public static void clearCounterDownSource(int counterHandle)

    - #### setCounterUpDownMode

          public static void setCounterUpDownMode(int counterHandle)

    - #### setCounterExternalDirectionMode

          public static void setCounterExternalDirectionMode(int counterHandle)

    - #### setCounterSemiPeriodMode

          public static void setCounterSemiPeriodMode(int counterHandle,
                                                      boolean highSemiPeriod)

    - #### setCounterPulseLengthMode

          public static void setCounterPulseLengthMode(int counterHandle,
                                                       double threshold)

    - #### getCounterSamplesToAverage

          public static int getCounterSamplesToAverage(int counterHandle)

    - #### setCounterSamplesToAverage

          public static void setCounterSamplesToAverage(int counterHandle,
                                                        int samplesToAverage)

    - #### resetCounter

          public static void resetCounter(int counterHandle)

    - #### getCounter

          public static int getCounter(int counterHandle)

    - #### getCounterPeriod

          public static double getCounterPeriod(int counterHandle)

    - #### setCounterMaxPeriod

          public static void setCounterMaxPeriod(int counterHandle,
                                                 double maxPeriod)

    - #### setCounterUpdateWhenEmpty

          public static void setCounterUpdateWhenEmpty(int counterHandle,
                                                       boolean enabled)

    - #### getCounterStopped

          public static boolean getCounterStopped(int counterHandle)

    - #### getCounterDirection

          public static boolean getCounterDirection(int counterHandle)

    - #### setCounterReverseDirection

          public static void setCounterReverseDirection(int counterHandle,
                                                        boolean reverseDirection)