blob: e8ce7103cc4ab7147ca19c9ea687487c0985e138 [file] [log] [blame]
Brian Silverman8fce7482020-01-05 13:18:21 -08001/*----------------------------------------------------------------------------*/
Austin Schuh1e69f942020-11-14 15:06:14 -08002/* Copyright (c) 2017-2020 FIRST. All Rights Reserved. */
Brian Silverman8fce7482020-01-05 13:18:21 -08003/* 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" {
Austin Schuh1e69f942020-11-14 15:06:14 -080022double HAL_GetVinVoltage(int32_t* status) { return SimRoboRioData->vInVoltage; }
23double HAL_GetVinCurrent(int32_t* status) { return SimRoboRioData->vInCurrent; }
Brian Silverman8fce7482020-01-05 13:18:21 -080024double HAL_GetUserVoltage6V(int32_t* status) {
Austin Schuh1e69f942020-11-14 15:06:14 -080025 return SimRoboRioData->userVoltage6V;
Brian Silverman8fce7482020-01-05 13:18:21 -080026}
27double HAL_GetUserCurrent6V(int32_t* status) {
Austin Schuh1e69f942020-11-14 15:06:14 -080028 return SimRoboRioData->userCurrent6V;
Brian Silverman8fce7482020-01-05 13:18:21 -080029}
30HAL_Bool HAL_GetUserActive6V(int32_t* status) {
Austin Schuh1e69f942020-11-14 15:06:14 -080031 return SimRoboRioData->userActive6V;
Brian Silverman8fce7482020-01-05 13:18:21 -080032}
33int32_t HAL_GetUserCurrentFaults6V(int32_t* status) {
Austin Schuh1e69f942020-11-14 15:06:14 -080034 return SimRoboRioData->userFaults6V;
Brian Silverman8fce7482020-01-05 13:18:21 -080035}
36double HAL_GetUserVoltage5V(int32_t* status) {
Austin Schuh1e69f942020-11-14 15:06:14 -080037 return SimRoboRioData->userVoltage5V;
Brian Silverman8fce7482020-01-05 13:18:21 -080038}
39double HAL_GetUserCurrent5V(int32_t* status) {
Austin Schuh1e69f942020-11-14 15:06:14 -080040 return SimRoboRioData->userCurrent5V;
Brian Silverman8fce7482020-01-05 13:18:21 -080041}
42HAL_Bool HAL_GetUserActive5V(int32_t* status) {
Austin Schuh1e69f942020-11-14 15:06:14 -080043 return SimRoboRioData->userActive5V;
Brian Silverman8fce7482020-01-05 13:18:21 -080044}
45int32_t HAL_GetUserCurrentFaults5V(int32_t* status) {
Austin Schuh1e69f942020-11-14 15:06:14 -080046 return SimRoboRioData->userFaults5V;
Brian Silverman8fce7482020-01-05 13:18:21 -080047}
48double HAL_GetUserVoltage3V3(int32_t* status) {
Austin Schuh1e69f942020-11-14 15:06:14 -080049 return SimRoboRioData->userVoltage3V3;
Brian Silverman8fce7482020-01-05 13:18:21 -080050}
51double HAL_GetUserCurrent3V3(int32_t* status) {
Austin Schuh1e69f942020-11-14 15:06:14 -080052 return SimRoboRioData->userCurrent3V3;
Brian Silverman8fce7482020-01-05 13:18:21 -080053}
54HAL_Bool HAL_GetUserActive3V3(int32_t* status) {
Austin Schuh1e69f942020-11-14 15:06:14 -080055 return SimRoboRioData->userActive3V3;
Brian Silverman8fce7482020-01-05 13:18:21 -080056}
57int32_t HAL_GetUserCurrentFaults3V3(int32_t* status) {
Austin Schuh1e69f942020-11-14 15:06:14 -080058 return SimRoboRioData->userFaults3V3;
Brian Silverman8fce7482020-01-05 13:18:21 -080059}
60} // extern "C"