[hal] [wpilib] Add initial support for the REV PDH (#3503)

This commit is contained in:
Thad House
2021-08-14 11:44:56 -07:00
committed by GitHub
parent 5d9ae3cdb4
commit 10cc8b89c4
44 changed files with 6697 additions and 287 deletions

View File

@@ -4,6 +4,7 @@
package edu.wpi.first.hal;
@SuppressWarnings("AbbreviationAsWordInName")
public class PortsJNI extends JNIWrapper {
public static native int getNumAccumulators();
@@ -33,11 +34,15 @@ public class PortsJNI extends JNIWrapper {
public static native int getNumRelayHeaders();
public static native int getNumPCMModules();
public static native int getNumCTREPCMModules();
public static native int getNumSolenoidChannels();
public static native int getNumCTRESolenoidChannels();
public static native int getNumPDPModules();
public static native int getNumCTREPDPModules();
public static native int getNumPDPChannels();
public static native int getNumCTREPDPChannels();
public static native int getNumREVPDHModules();
public static native int getNumREVPDHChannels();
}

View File

@@ -6,19 +6,30 @@ package edu.wpi.first.hal;
@SuppressWarnings("AbbreviationAsWordInName")
public class PowerDistributionJNI extends JNIWrapper {
public static final int AUTOMATIC_TYPE = 0;
public static final int CTRE_TYPE = 1;
public static final int REV_TYPE = 2;
public static final int DEFAULT_MODULE = -1;
public static native int initialize(int module, int type);
public static native void free(int handle);
public static native int getModuleNumber(int handle);
public static native boolean checkModule(int module, int type);
public static native boolean checkChannel(int handle, int channel);
public static native int getType(int handle);
public static native int getNumChannels(int handle);
public static native double getTemperature(int handle);
public static native double getVoltage(int handle);
public static native double getChannelCurrent(byte channel, int handle);
public static native double getChannelCurrent(int handle, int channel);
public static native void getAllCurrents(int handle, double[] currents);
@@ -31,4 +42,8 @@ public class PowerDistributionJNI extends JNIWrapper {
public static native void resetTotalEnergy(int handle);
public static native void clearStickyFaults(int handle);
public static native boolean getSwitchableChannel(int handle);
public static native void setSwitchableChannel(int handle, boolean enabled);
}