Brian Silverman | 41cdd3e | 2019-01-19 19:48:58 -0800 | [diff] [blame] | 1 | /*----------------------------------------------------------------------------*/ |
| 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 | |
| 12 | using namespace hal; |
| 13 | |
| 14 | namespace hal { |
| 15 | namespace init { |
| 16 | void InitializePower() {} |
| 17 | } // namespace init |
| 18 | } // namespace hal |
| 19 | |
| 20 | // TODO: Fix the naming in here |
| 21 | extern "C" { |
| 22 | double HAL_GetVinVoltage(int32_t* status) { |
| 23 | return SimRoboRioData[0].vInVoltage; |
| 24 | } |
| 25 | double HAL_GetVinCurrent(int32_t* status) { |
| 26 | return SimRoboRioData[0].vInCurrent; |
| 27 | } |
| 28 | double HAL_GetUserVoltage6V(int32_t* status) { |
| 29 | return SimRoboRioData[0].userVoltage6V; |
| 30 | } |
| 31 | double HAL_GetUserCurrent6V(int32_t* status) { |
| 32 | return SimRoboRioData[0].userCurrent6V; |
| 33 | } |
| 34 | HAL_Bool HAL_GetUserActive6V(int32_t* status) { |
| 35 | return SimRoboRioData[0].userActive6V; |
| 36 | } |
| 37 | int32_t HAL_GetUserCurrentFaults6V(int32_t* status) { |
| 38 | return SimRoboRioData[0].userFaults6V; |
| 39 | } |
| 40 | double HAL_GetUserVoltage5V(int32_t* status) { |
| 41 | return SimRoboRioData[0].userVoltage5V; |
| 42 | } |
| 43 | double HAL_GetUserCurrent5V(int32_t* status) { |
| 44 | return SimRoboRioData[0].userCurrent5V; |
| 45 | } |
| 46 | HAL_Bool HAL_GetUserActive5V(int32_t* status) { |
| 47 | return SimRoboRioData[0].userActive5V; |
| 48 | } |
| 49 | int32_t HAL_GetUserCurrentFaults5V(int32_t* status) { |
| 50 | return SimRoboRioData[0].userFaults5V; |
| 51 | } |
| 52 | double HAL_GetUserVoltage3V3(int32_t* status) { |
| 53 | return SimRoboRioData[0].userVoltage3V3; |
| 54 | } |
| 55 | double HAL_GetUserCurrent3V3(int32_t* status) { |
| 56 | return SimRoboRioData[0].userCurrent3V3; |
| 57 | } |
| 58 | HAL_Bool HAL_GetUserActive3V3(int32_t* status) { |
| 59 | return SimRoboRioData[0].userActive3V3; |
| 60 | } |
| 61 | int32_t HAL_GetUserCurrentFaults3V3(int32_t* status) { |
| 62 | return SimRoboRioData[0].userFaults3V3; |
| 63 | } |
| 64 | } // extern "C" |