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 DIOJNI extends JNIWrapper {
008  public static native int initializeDIOPort(int halPortHandle, boolean input);
009
010  public static native boolean checkDIOChannel(int channel);
011
012  public static native void freeDIOPort(int dioPortHandle);
013
014  public static native void setDIOSimDevice(int handle, int device);
015
016  public static native void setDIO(int dioPortHandle, boolean value);
017
018  public static native void setDIODirection(int dioPortHandle, boolean input);
019
020  public static native boolean getDIO(int dioPortHandle);
021
022  public static native boolean getDIODirection(int dioPortHandle);
023
024  public static native void pulse(int dioPortHandle, double pulseLengthSeconds);
025
026  public static native void pulseMultiple(long channelMask, double pulseLengthSeconds);
027
028  public static native boolean isPulsing(int dioPortHandle);
029
030  public static native boolean isAnyPulsing();
031
032  public static native short getLoopTiming();
033
034  public static native int allocateDigitalPWM();
035
036  public static native void freeDigitalPWM(int pwmGenerator);
037
038  public static native void setDigitalPWMRate(double rate);
039
040  public static native void setDigitalPWMDutyCycle(int pwmGenerator, double dutyCycle);
041
042  public static native void setDigitalPWMPPS(int pwmGenerator, double dutyCycle);
043
044  public static native void setDigitalPWMOutputChannel(int pwmGenerator, int channel);
045}