2017-08-18 21:35:53 -07:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2018-01-02 09:20:21 -08:00
|
|
|
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
|
2017-08-18 21:35:53 -07:00
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
2018-07-20 00:03:45 -07:00
|
|
|
#include "hal/Power.h"
|
2017-08-18 21:35:53 -07:00
|
|
|
|
2018-07-20 00:03:45 -07:00
|
|
|
#include "mockdata/RoboRioDataInternal.h"
|
2017-08-18 21:35:53 -07:00
|
|
|
|
|
|
|
|
using namespace hal;
|
|
|
|
|
|
2017-12-10 19:38:53 -08:00
|
|
|
namespace hal {
|
|
|
|
|
namespace init {
|
|
|
|
|
void InitializePower() {}
|
|
|
|
|
} // namespace init
|
|
|
|
|
} // namespace hal
|
|
|
|
|
|
2017-08-18 21:35:53 -07:00
|
|
|
// TODO: Fix the naming in here
|
|
|
|
|
extern "C" {
|
|
|
|
|
double HAL_GetVinVoltage(int32_t* status) {
|
2018-09-03 16:08:07 -07:00
|
|
|
return SimRoboRioData[0].vInVoltage;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
double HAL_GetVinCurrent(int32_t* status) {
|
2018-09-03 16:08:07 -07:00
|
|
|
return SimRoboRioData[0].vInCurrent;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
double HAL_GetUserVoltage6V(int32_t* status) {
|
2018-09-03 16:08:07 -07:00
|
|
|
return SimRoboRioData[0].userVoltage6V;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
double HAL_GetUserCurrent6V(int32_t* status) {
|
2018-09-03 16:08:07 -07:00
|
|
|
return SimRoboRioData[0].userCurrent6V;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
HAL_Bool HAL_GetUserActive6V(int32_t* status) {
|
2018-09-03 16:08:07 -07:00
|
|
|
return SimRoboRioData[0].userActive6V;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
int32_t HAL_GetUserCurrentFaults6V(int32_t* status) {
|
2018-09-03 16:08:07 -07:00
|
|
|
return SimRoboRioData[0].userFaults6V;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
double HAL_GetUserVoltage5V(int32_t* status) {
|
2018-09-03 16:08:07 -07:00
|
|
|
return SimRoboRioData[0].userVoltage5V;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
double HAL_GetUserCurrent5V(int32_t* status) {
|
2018-09-03 16:08:07 -07:00
|
|
|
return SimRoboRioData[0].userCurrent5V;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
HAL_Bool HAL_GetUserActive5V(int32_t* status) {
|
2018-09-03 16:08:07 -07:00
|
|
|
return SimRoboRioData[0].userActive5V;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
int32_t HAL_GetUserCurrentFaults5V(int32_t* status) {
|
2018-09-03 16:08:07 -07:00
|
|
|
return SimRoboRioData[0].userFaults5V;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
double HAL_GetUserVoltage3V3(int32_t* status) {
|
2018-09-03 16:08:07 -07:00
|
|
|
return SimRoboRioData[0].userVoltage3V3;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
double HAL_GetUserCurrent3V3(int32_t* status) {
|
2018-09-03 16:08:07 -07:00
|
|
|
return SimRoboRioData[0].userCurrent3V3;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
HAL_Bool HAL_GetUserActive3V3(int32_t* status) {
|
2018-09-03 16:08:07 -07:00
|
|
|
return SimRoboRioData[0].userActive3V3;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
int32_t HAL_GetUserCurrentFaults3V3(int32_t* status) {
|
2018-09-03 16:08:07 -07:00
|
|
|
return SimRoboRioData[0].userFaults3V3;
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
|
|
|
|
} // extern "C"
|