blob: 95bb3dd05a25a39cfb0fe764fc812b1133ef9831 [file] [log] [blame]
Brian Silverman41cdd3e2019-01-19 19:48:58 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
3/* Open Source Software - may be modified and shared by FRC teams. The code */
4/* must be accompanied by the FIRST BSD license file in the root directory of */
5/* the project. */
6/*----------------------------------------------------------------------------*/
7
8#include "hal/Power.h"
9
10#include "mockdata/RoboRioDataInternal.h"
11
12using namespace hal;
13
14namespace hal {
15namespace init {
16void InitializePower() {}
17} // namespace init
18} // namespace hal
19
20// TODO: Fix the naming in here
21extern "C" {
22double HAL_GetVinVoltage(int32_t* status) {
23 return SimRoboRioData[0].vInVoltage;
24}
25double HAL_GetVinCurrent(int32_t* status) {
26 return SimRoboRioData[0].vInCurrent;
27}
28double HAL_GetUserVoltage6V(int32_t* status) {
29 return SimRoboRioData[0].userVoltage6V;
30}
31double HAL_GetUserCurrent6V(int32_t* status) {
32 return SimRoboRioData[0].userCurrent6V;
33}
34HAL_Bool HAL_GetUserActive6V(int32_t* status) {
35 return SimRoboRioData[0].userActive6V;
36}
37int32_t HAL_GetUserCurrentFaults6V(int32_t* status) {
38 return SimRoboRioData[0].userFaults6V;
39}
40double HAL_GetUserVoltage5V(int32_t* status) {
41 return SimRoboRioData[0].userVoltage5V;
42}
43double HAL_GetUserCurrent5V(int32_t* status) {
44 return SimRoboRioData[0].userCurrent5V;
45}
46HAL_Bool HAL_GetUserActive5V(int32_t* status) {
47 return SimRoboRioData[0].userActive5V;
48}
49int32_t HAL_GetUserCurrentFaults5V(int32_t* status) {
50 return SimRoboRioData[0].userFaults5V;
51}
52double HAL_GetUserVoltage3V3(int32_t* status) {
53 return SimRoboRioData[0].userVoltage3V3;
54}
55double HAL_GetUserCurrent3V3(int32_t* status) {
56 return SimRoboRioData[0].userCurrent3V3;
57}
58HAL_Bool HAL_GetUserActive3V3(int32_t* status) {
59 return SimRoboRioData[0].userActive3V3;
60}
61int32_t HAL_GetUserCurrentFaults3V3(int32_t* status) {
62 return SimRoboRioData[0].userFaults3V3;
63}
64} // extern "C"