Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 1 | /*----------------------------------------------------------------------------*/ |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 2 | /* Copyright (c) 2017-2020 FIRST. All Rights Reserved. */ |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 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" { |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 22 | double HAL_GetVinVoltage(int32_t* status) { return SimRoboRioData->vInVoltage; } |
| 23 | double HAL_GetVinCurrent(int32_t* status) { return SimRoboRioData->vInCurrent; } |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 24 | double HAL_GetUserVoltage6V(int32_t* status) { |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 25 | return SimRoboRioData->userVoltage6V; |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 26 | } |
| 27 | double HAL_GetUserCurrent6V(int32_t* status) { |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 28 | return SimRoboRioData->userCurrent6V; |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 29 | } |
| 30 | HAL_Bool HAL_GetUserActive6V(int32_t* status) { |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 31 | return SimRoboRioData->userActive6V; |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 32 | } |
| 33 | int32_t HAL_GetUserCurrentFaults6V(int32_t* status) { |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 34 | return SimRoboRioData->userFaults6V; |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 35 | } |
| 36 | double HAL_GetUserVoltage5V(int32_t* status) { |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 37 | return SimRoboRioData->userVoltage5V; |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 38 | } |
| 39 | double HAL_GetUserCurrent5V(int32_t* status) { |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 40 | return SimRoboRioData->userCurrent5V; |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 41 | } |
| 42 | HAL_Bool HAL_GetUserActive5V(int32_t* status) { |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 43 | return SimRoboRioData->userActive5V; |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 44 | } |
| 45 | int32_t HAL_GetUserCurrentFaults5V(int32_t* status) { |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 46 | return SimRoboRioData->userFaults5V; |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 47 | } |
| 48 | double HAL_GetUserVoltage3V3(int32_t* status) { |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 49 | return SimRoboRioData->userVoltage3V3; |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 50 | } |
| 51 | double HAL_GetUserCurrent3V3(int32_t* status) { |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 52 | return SimRoboRioData->userCurrent3V3; |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 53 | } |
| 54 | HAL_Bool HAL_GetUserActive3V3(int32_t* status) { |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 55 | return SimRoboRioData->userActive3V3; |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 56 | } |
| 57 | int32_t HAL_GetUserCurrentFaults3V3(int32_t* status) { |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 58 | return SimRoboRioData->userFaults3V3; |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 59 | } |
| 60 | } // extern "C" |