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 REVPHJNI extends JNIWrapper {
008  public static final int COMPRESSOR_CONFIG_TYPE_DISABLED = 0;
009  public static final int COMPRESSOR_CONFIG_TYPE_DIGITAL = 1;
010  public static final int COMPRESSOR_CONFIG_TYPE_ANALOG = 2;
011  public static final int COMPRESSOR_CONFIG_TYPE_HYBRID = 3;
012
013  public static native int initialize(int module);
014
015  public static native void free(int handle);
016
017  public static native boolean checkSolenoidChannel(int channel);
018
019  public static native boolean getCompressor(int handle);
020
021  public static native void setCompressorConfig(
022      int handle,
023      double minAnalogVoltage,
024      double maxAnalogVoltage,
025      boolean forceDisable,
026      boolean useDigital);
027
028  public static native void setClosedLoopControlDisabled(int handle);
029
030  public static native void setClosedLoopControlDigital(int handle);
031
032  public static native void setClosedLoopControlAnalog(
033      int handle, double minAnalogVoltage, double maxAnalogVoltage);
034
035  public static native void setClosedLoopControlHybrid(
036      int handle, double minAnalogVoltage, double maxAnalogVoltage);
037
038  public static native int getCompressorConfig(int handle);
039
040  public static native boolean getPressureSwitch(int handle);
041
042  public static native double getAnalogVoltage(int handle, int channel);
043
044  public static native double getCompressorCurrent(int handle);
045
046  public static native int getSolenoids(int handle);
047
048  public static native void setSolenoids(int handle, int mask, int values);
049
050  public static native void fireOneShot(int handle, int index, int durMs);
051
052  public static native void clearStickyFaults(int handle);
053
054  public static native double getInputVoltage(int handle);
055
056  public static native double get5VVoltage(int handle);
057
058  public static native double getSolenoidCurrent(int handle);
059
060  public static native double getSolenoidVoltage(int handle);
061
062  public static native int getStickyFaultsNative(int handle);
063
064  public static REVPHStickyFaults getStickyFaults(int handle) {
065    return new REVPHStickyFaults(getStickyFaultsNative(handle));
066  }
067
068  public static native int getFaultsNative(int handle);
069
070  public static REVPHFaults getFaults(int handle) {
071    return new REVPHFaults(getFaultsNative(handle));
072  }
073
074  public static native REVPHVersion getVersion(int handle);
075}