blob: dc80158623922d41211015c1149a75b9fa2df04a [file] [log] [blame]
Parker Schuhd3b7a8872018-02-19 16:42:27 -08001/*----------------------------------------------------------------------------*/
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 Kuszmaul26a6d2b2019-12-18 21:16:57 -080013#include <hal/Types.h>
14
Parker Schuhd3b7a8872018-02-19 16:42:27 -080015#include "frc971/wpilib/ahal/SensorBase.h"
16
17namespace frc {
18
19/**
20 * Class for getting voltage, current, temperature, power and energy from the
21 * CAN PDP.
22 */
23class 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 Kuszmaul26a6d2b2019-12-18 21:16:57 -080038 hal::Handle<HAL_PDPHandle> m_handle;
Parker Schuhd3b7a8872018-02-19 16:42:27 -080039};
40
41} // namespace frc