[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

@@ -8,6 +8,7 @@
#include <string>
#include <units/temperature.h>
#include <units/voltage.h>
namespace frc {
@@ -136,9 +137,16 @@ class RobotController {
static double GetCurrent3V3();
/**
* 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.
* Enables or disables the 3.3V rail.
*
* @param enabled whether to enable the 3.3V rail.
*/
static void SetEnabled3V3(bool enabled);
/**
* Get the enabled state of the 3.3V rail. The rail may be disabled due to
* calling SetEnabled3V3(), a controller brownout, a short circuit on the
* rail, or controller over-voltage.
*
* @return The controller 3.3V rail enabled value. True for enabled.
*/
@@ -167,9 +175,16 @@ class RobotController {
static double GetCurrent5V();
/**
* 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.
* Enables or disables the 5V rail.
*
* @param enabled whether to enable the 5V rail.
*/
static void SetEnabled5V(bool enabled);
/**
* Get the enabled state of the 5V rail. The rail may be disabled due to
* calling SetEnabled5V(), a controller brownout, a short circuit on the rail,
* or controller over-voltage.
*
* @return The controller 5V rail enabled value. True for enabled.
*/
@@ -198,9 +213,16 @@ class RobotController {
static double GetCurrent6V();
/**
* 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.
* Enables or disables the 6V rail.
*
* @param enabled whether to enable the 6V rail.
*/
static void SetEnabled6V(bool enabled);
/**
* Get the enabled state of the 6V rail. The rail may be disabled due to
* calling SetEnabled6V(), a controller brownout, a short circuit on the rail,
* or controller over-voltage.
*
* @return The controller 6V rail enabled value. True for enabled.
*/
@@ -231,6 +253,13 @@ class RobotController {
*/
static void SetBrownoutVoltage(units::volt_t brownoutVoltage);
/**
* Get the current CPU temperature.
*
* @return current CPU temperature
*/
static units::celsius_t GetCPUTemp();
/**
* Get the current status of the CAN bus.
*