[hal] Expose power rail disable and cpu temp functionality (#5477)

This commit is contained in:
Ryan Blue
2023-08-04 02:48:29 -04:00
committed by GitHub
parent 3ad5d2e42d
commit e2d17a24a6
12 changed files with 255 additions and 9 deletions

View File

@@ -42,6 +42,13 @@ public class PowerJNI extends JNIWrapper {
*/
public static native double getUserCurrent6V();
/**
* Enables or disables the 6V rail.
*
* @param enabled whether the rail should be enabled
*/
public static native void setUserEnabled6V(boolean enabled);
/**
* Gets the active state of the 6V rail.
*
@@ -74,6 +81,13 @@ public class PowerJNI extends JNIWrapper {
*/
public static native double getUserCurrent5V();
/**
* Enables or disables the 5V rail.
*
* @param enabled whether the rail should be enabled
*/
public static native void setUserEnabled5V(boolean enabled);
/**
* Gets the active state of the 5V rail.
*
@@ -106,6 +120,13 @@ public class PowerJNI extends JNIWrapper {
*/
public static native double getUserCurrent3V3();
/**
* Enables or disables the 3V3 rail.
*
* @param enabled whether the rail should be enabled
*/
public static native void setUserEnabled3V3(boolean enabled);
/**
* Gets the active state of the 3V3 rail.
*
@@ -139,4 +160,11 @@ public class PowerJNI extends JNIWrapper {
* @see "HAL_GetBrownoutVoltage"
*/
public static native double getBrownoutVoltage();
/**
* Get the current CPU temperature in degrees Celsius.
*
* @return current CPU temperature in degrees Celsius
*/
public static native double getCPUTemp();
}