mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[hal, wpilib] Add REV PneumaticsHub (#3600)
This commit is contained in:
@@ -45,4 +45,8 @@ public class PortsJNI extends JNIWrapper {
|
||||
public static native int getNumREVPDHModules();
|
||||
|
||||
public static native int getNumREVPDHChannels();
|
||||
|
||||
public static native int getNumREVPHModules();
|
||||
|
||||
public static native int getNumREVPHChannels();
|
||||
}
|
||||
|
||||
32
hal/src/main/java/edu/wpi/first/hal/REVPHJNI.java
Normal file
32
hal/src/main/java/edu/wpi/first/hal/REVPHJNI.java
Normal file
@@ -0,0 +1,32 @@
|
||||
// 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 REVPHJNI 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 getAnalogPressure(int handle, int channel);
|
||||
|
||||
public static native double getCompressorCurrent(int handle);
|
||||
|
||||
public static native int getSolenoids(int handle);
|
||||
|
||||
public static native void setSolenoids(int handle, int mask, int values);
|
||||
|
||||
public static native void fireOneShot(int handle, int index, int durMs);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// 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.simulation;
|
||||
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
|
||||
@SuppressWarnings("AbbreviationAsWordInName")
|
||||
public class REVPHDataJNI extends JNIWrapper {
|
||||
public static native int registerInitializedCallback(
|
||||
int index, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
public static native void cancelInitializedCallback(int index, int uid);
|
||||
|
||||
public static native boolean getInitialized(int index);
|
||||
|
||||
public static native void setInitialized(int index, boolean initialized);
|
||||
|
||||
public static native int registerSolenoidOutputCallback(
|
||||
int index, int channel, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
public static native void cancelSolenoidOutputCallback(int index, int channel, int uid);
|
||||
|
||||
public static native boolean getSolenoidOutput(int index, int channel);
|
||||
|
||||
public static native void setSolenoidOutput(int index, int channel, boolean solenoidOutput);
|
||||
|
||||
public static native int registerCompressorOnCallback(
|
||||
int index, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
public static native void cancelCompressorOnCallback(int index, int uid);
|
||||
|
||||
public static native boolean getCompressorOn(int index);
|
||||
|
||||
public static native void setCompressorOn(int index, boolean compressorOn);
|
||||
|
||||
public static native int registerClosedLoopEnabledCallback(
|
||||
int index, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
public static native void cancelClosedLoopEnabledCallback(int index, int uid);
|
||||
|
||||
public static native boolean getClosedLoopEnabled(int index);
|
||||
|
||||
public static native void setClosedLoopEnabled(int index, boolean closeLoopEnabled);
|
||||
|
||||
public static native int registerPressureSwitchCallback(
|
||||
int index, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
public static native void cancelPressureSwitchCallback(int index, int uid);
|
||||
|
||||
public static native boolean getPressureSwitch(int index);
|
||||
|
||||
public static native void setPressureSwitch(int index, boolean pressureSwitch);
|
||||
|
||||
public static native int registerCompressorCurrentCallback(
|
||||
int index, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
public static native void cancelCompressorCurrentCallback(int index, int uid);
|
||||
|
||||
public static native double getCompressorCurrent(int index);
|
||||
|
||||
public static native void setCompressorCurrent(int index, double compressorCurrent);
|
||||
|
||||
public static native void registerAllNonSolenoidCallbacks(
|
||||
int index, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
public static native void registerAllSolenoidCallbacks(
|
||||
int index, int channel, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
public static native void resetData(int index);
|
||||
}
|
||||
Reference in New Issue
Block a user