Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 1 | /*----------------------------------------------------------------------------*/ |
| 2 | /* Copyright (c) FIRST 2014-2017. 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 | #pragma once |
| 9 | |
| 10 | #include <memory> |
| 11 | #include <string> |
| 12 | |
James Kuszmaul | 26a6d2b | 2019-12-18 21:16:57 -0800 | [diff] [blame^] | 13 | #include <hal/Types.h> |
| 14 | |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 15 | #include "frc971/wpilib/ahal/SensorBase.h" |
| 16 | |
| 17 | namespace frc { |
| 18 | |
| 19 | /** |
| 20 | * Class for getting voltage, current, temperature, power and energy from the |
| 21 | * CAN PDP. |
| 22 | */ |
| 23 | class PowerDistributionPanel { |
| 24 | public: |
| 25 | PowerDistributionPanel(); |
| 26 | explicit PowerDistributionPanel(int module); |
| 27 | |
| 28 | double GetVoltage() const; |
| 29 | double GetTemperature() const; |
| 30 | double GetCurrent(int channel) const; |
| 31 | double GetTotalCurrent() const; |
| 32 | double GetTotalPower() const; |
| 33 | double GetTotalEnergy() const; |
| 34 | void ResetTotalEnergy(); |
| 35 | void ClearStickyFaults(); |
| 36 | |
| 37 | private: |
James Kuszmaul | 26a6d2b | 2019-12-18 21:16:57 -0800 | [diff] [blame^] | 38 | hal::Handle<HAL_PDPHandle> m_handle; |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | } // namespace frc |