mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[hal] Expose power rail disable and cpu temp functionality (#5477)
This commit is contained in:
@@ -148,6 +148,15 @@ public final class RobotController {
|
||||
return PowerJNI.getUserCurrent3V3();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the 3.3V rail.
|
||||
*
|
||||
* @param enabled whether to enable the 3.3V rail.
|
||||
*/
|
||||
public static void setEnabled3V3(boolean enabled) {
|
||||
PowerJNI.setUserEnabled3V3(enabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the enabled state of the 3.3V rail. The rail may be disabled due to a controller brownout,
|
||||
* a short circuit on the rail, or controller over-voltage.
|
||||
@@ -185,6 +194,15 @@ public final class RobotController {
|
||||
return PowerJNI.getUserCurrent5V();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the 5V rail.
|
||||
*
|
||||
* @param enabled whether to enable the 5V rail.
|
||||
*/
|
||||
public static void setEnabled5V(boolean enabled) {
|
||||
PowerJNI.setUserEnabled5V(enabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the enabled state of the 5V rail. The rail may be disabled due to a controller brownout, a
|
||||
* short circuit on the rail, or controller over-voltage.
|
||||
@@ -222,6 +240,15 @@ public final class RobotController {
|
||||
return PowerJNI.getUserCurrent6V();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the 6V rail.
|
||||
*
|
||||
* @param enabled whether to enable the 6V rail.
|
||||
*/
|
||||
public static void setEnabled6V(boolean enabled) {
|
||||
PowerJNI.setUserEnabled6V(enabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the enabled state of the 6V rail. The rail may be disabled due to a controller brownout, a
|
||||
* short circuit on the rail, or controller over-voltage.
|
||||
@@ -261,6 +288,15 @@ public final class RobotController {
|
||||
PowerJNI.setBrownoutVoltage(brownoutVoltage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current CPU temperature in degrees Celsius.
|
||||
*
|
||||
* @return current CPU temperature in degrees Celsius
|
||||
*/
|
||||
public static double getCPUTemp() {
|
||||
return PowerJNI.getCPUTemp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current status of the CAN bus.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user