mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[hal] Add a unified PCM object (#3331)
This commit is contained in:
52
hal/src/main/java/edu/wpi/first/hal/CTREPCMJNI.java
Normal file
52
hal/src/main/java/edu/wpi/first/hal/CTREPCMJNI.java
Normal file
@@ -0,0 +1,52 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class CTREPCMJNI extends JNIWrapper {
|
||||
public static native int initialize(int module);
|
||||
|
||||
public static native void free(int handle);
|
||||
|
||||
public static native boolean checkSolenoidChannel(int channel);
|
||||
|
||||
public static native boolean getCompressor(int handle);
|
||||
|
||||
public static native void setClosedLoopControl(int handle, boolean enabled);
|
||||
|
||||
public static native boolean getClosedLoopControl(int handle);
|
||||
|
||||
public static native boolean getPressureSwitch(int handle);
|
||||
|
||||
public static native double getCompressorCurrent(int handle);
|
||||
|
||||
public static native boolean getCompressorCurrentTooHighFault(int handle);
|
||||
|
||||
public static native boolean getCompressorCurrentTooHighStickyFault(int handle);
|
||||
|
||||
public static native boolean getCompressorShortedFault(int handle);
|
||||
|
||||
public static native boolean getCompressorShortedStickyFault(int handle);
|
||||
|
||||
public static native boolean getCompressorNotConnectedFault(int handle);
|
||||
|
||||
public static native boolean getCompressorNotConnectedStickyFault(int handle);
|
||||
|
||||
public static native int getSolenoids(int handle);
|
||||
|
||||
public static native void setSolenoids(int handle, int mask, int values);
|
||||
|
||||
public static native int getSolenoidDisabledList(int handle);
|
||||
|
||||
public static native boolean getSolenoidVoltageFault(int handle);
|
||||
|
||||
public static native boolean getSolenoidVoltageStickyFault(int handle);
|
||||
|
||||
public static native void clearAllStickyFaults(int handle);
|
||||
|
||||
public static native void fireOneShot(int handle, int index);
|
||||
|
||||
public static native void setOneShotDuration(int handle, int index, int durMs);
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
public class CompressorJNI extends JNIWrapper {
|
||||
public static native int initializeCompressor(byte module);
|
||||
|
||||
public static native boolean checkCompressorModule(byte module);
|
||||
|
||||
public static native boolean getCompressor(int compressorHandle);
|
||||
|
||||
public static native void setCompressorClosedLoopControl(int compressorHandle, boolean value);
|
||||
|
||||
public static native boolean getCompressorClosedLoopControl(int compressorHandle);
|
||||
|
||||
public static native boolean getCompressorPressureSwitch(int compressorHandle);
|
||||
|
||||
public static native double getCompressorCurrent(int compressorHandle);
|
||||
|
||||
public static native boolean getCompressorCurrentTooHighFault(int compressorHandle);
|
||||
|
||||
public static native boolean getCompressorCurrentTooHighStickyFault(int compressorHandle);
|
||||
|
||||
public static native boolean getCompressorShortedStickyFault(int compressorHandle);
|
||||
|
||||
public static native boolean getCompressorShortedFault(int compressorHandle);
|
||||
|
||||
public static native boolean getCompressorNotConnectedStickyFault(int compressorHandle);
|
||||
|
||||
public static native boolean getCompressorNotConnectedFault(int compressorHandle);
|
||||
|
||||
public static native void clearAllPCMStickyFaults(byte compressorModule);
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
public class SolenoidJNI extends JNIWrapper {
|
||||
public static native int initializeSolenoidPort(int halPortHandle);
|
||||
|
||||
public static native boolean checkSolenoidModule(int module);
|
||||
|
||||
public static native boolean checkSolenoidChannel(int channel);
|
||||
|
||||
public static native void freeSolenoidPort(int portHandle);
|
||||
|
||||
public static native void setSolenoid(int portHandle, boolean on);
|
||||
|
||||
public static native boolean getSolenoid(int portHandle);
|
||||
|
||||
public static native int getAllSolenoids(int module);
|
||||
|
||||
public static native int getPCMSolenoidBlackList(int module);
|
||||
|
||||
public static native boolean getPCMSolenoidVoltageStickyFault(int module);
|
||||
|
||||
public static native boolean getPCMSolenoidVoltageFault(int module);
|
||||
|
||||
public static native void clearAllPCMStickyFaults(int module);
|
||||
|
||||
public static native void setOneShotDuration(int portHandle, long durationMS);
|
||||
|
||||
public static native void fireOneShot(int portHandle);
|
||||
}
|
||||
@@ -6,16 +6,16 @@ package edu.wpi.first.hal.simulation;
|
||||
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
public class PCMDataJNI extends JNIWrapper {
|
||||
public static native int registerSolenoidInitializedCallback(
|
||||
int index, int channel, NotifyCallback callback, boolean initialNotify);
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class CTREPCMDataJNI extends JNIWrapper {
|
||||
public static native int registerInitializedCallback(
|
||||
int index, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
public static native void cancelSolenoidInitializedCallback(int index, int channel, int uid);
|
||||
public static native void cancelInitializedCallback(int index, int uid);
|
||||
|
||||
public static native boolean getSolenoidInitialized(int index, int channel);
|
||||
public static native boolean getInitialized(int index);
|
||||
|
||||
public static native void setSolenoidInitialized(
|
||||
int index, int channel, boolean solenoidInitialized);
|
||||
public static native void setInitialized(int index, boolean initialized);
|
||||
|
||||
public static native int registerSolenoidOutputCallback(
|
||||
int index, int channel, NotifyCallback callback, boolean initialNotify);
|
||||
@@ -26,15 +26,6 @@ public class PCMDataJNI extends JNIWrapper {
|
||||
|
||||
public static native void setSolenoidOutput(int index, int channel, boolean solenoidOutput);
|
||||
|
||||
public static native int registerCompressorInitializedCallback(
|
||||
int index, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
public static native void cancelCompressorInitializedCallback(int index, int uid);
|
||||
|
||||
public static native boolean getCompressorInitialized(int index);
|
||||
|
||||
public static native void setCompressorInitialized(int index, boolean compressorInitialized);
|
||||
|
||||
public static native int registerCompressorOnCallback(
|
||||
int index, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
Reference in New Issue
Block a user