Files
allwpilib/hal/src/main/native/sim/Power.cpp

47 lines
1.4 KiB
C++
Raw Normal View History

// 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.
2025-11-07 19:56:21 -05:00
#include "wpi/hal/Power.h"
#include "mockdata/RoboRioDataInternal.h"
2025-11-07 20:00:05 -05:00
using namespace wpi::hal;
2025-11-07 20:00:05 -05:00
namespace wpi::hal::init {
void InitializePower() {}
2025-11-07 20:00:05 -05:00
} // namespace wpi::hal::init
// TODO: Fix the naming in here
extern "C" {
double HAL_GetVinVoltage(int32_t* status) {
return SimRoboRioData->vInVoltage;
}
void HAL_SetUserRailEnabled5V(HAL_Bool enabled, int32_t* status) {}
double HAL_GetUserVoltage3V3(int32_t* status) {
return SimRoboRioData->userVoltage3V3;
}
double HAL_GetUserCurrent3V3(int32_t* status) {
return SimRoboRioData->userCurrent3V3;
}
HAL_Bool HAL_GetUserActive3V3(int32_t* status) {
return SimRoboRioData->userActive3V3;
}
int32_t HAL_GetUserCurrentFaults3V3(int32_t* status) {
return SimRoboRioData->userFaults3V3;
}
void HAL_SetUserRailEnabled3V3(HAL_Bool enabled, int32_t* status) {}
void HAL_ResetUserCurrentFaults(int32_t* status) {
SimRoboRioData->userFaults3V3 = 0;
}
void HAL_SetBrownoutVoltage(double voltage, int32_t* status) {
SimRoboRioData->brownoutVoltage = voltage;
}
double HAL_GetBrownoutVoltage(int32_t* status) {
return SimRoboRioData->brownoutVoltage;
}
double HAL_GetCPUTemp(int32_t* status) {
return SimRoboRioData->cpuTemp;
}
} // extern "C"