mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[hal, wpilib] Add brownout voltage configuration (#3632)
This commit is contained in:
@@ -188,6 +188,28 @@ class RobotController {
|
||||
*/
|
||||
static int GetFaultCount6V();
|
||||
|
||||
/**
|
||||
* Get the current brownout voltage seting.
|
||||
*
|
||||
* @return The brownout voltage
|
||||
*/
|
||||
static units::volt_t GetBrownoutVoltage();
|
||||
|
||||
/**
|
||||
* Set the voltage the roborio will brownout and disable all outputs.
|
||||
*
|
||||
* Note that this only does anything on the roboRIO 2.
|
||||
* On the roboRIO it is a no-op.
|
||||
*
|
||||
* @param brownoutVoltage The brownout voltage
|
||||
*/
|
||||
static void SetBrownoutVoltage(units::volt_t brownoutVoltage);
|
||||
|
||||
/**
|
||||
* Get the current status of the CAN bus.
|
||||
*
|
||||
* @return The status of the CAN bus
|
||||
*/
|
||||
static CANStatus GetCANStatus();
|
||||
};
|
||||
|
||||
|
||||
@@ -394,6 +394,30 @@ class RoboRioSim {
|
||||
*/
|
||||
static void SetUserFaults3V3(int userFaults3V3);
|
||||
|
||||
/**
|
||||
* Register a callback to be run whenever the brownout voltage changes.
|
||||
*
|
||||
* @param callback the callback
|
||||
* @param initialNotify whether to call the callback with the initial state
|
||||
* @return the CallbackStore object associated with this callback
|
||||
*/
|
||||
[[nodiscard]] static std::unique_ptr<CallbackStore>
|
||||
RegisterBrownoutVoltageCallback(NotifyCallback callback, bool initialNotify);
|
||||
|
||||
/**
|
||||
* Measure the brownout voltage.
|
||||
*
|
||||
* @return the brownout voltage
|
||||
*/
|
||||
static units::volt_t GetBrownoutVoltage();
|
||||
|
||||
/**
|
||||
* Define the brownout voltage.
|
||||
*
|
||||
* @param vInVoltage the new voltage
|
||||
*/
|
||||
static void SetBrownoutVoltage(units::volt_t brownoutVoltage);
|
||||
|
||||
/**
|
||||
* Reset all simulation data.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user