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