WPILibC++  2020.2.2-33-g65eab93
SolenoidBase.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2008-2019 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 #pragma once
9 
10 #include "frc/ErrorBase.h"
11 
12 namespace frc {
13 
18 class SolenoidBase : public ErrorBase {
19  public:
26  static int GetAll(int module);
27 
33  int GetAll() const;
34 
45  static int GetPCMSolenoidBlackList(int module);
46 
56  int GetPCMSolenoidBlackList() const;
57 
63  static bool GetPCMSolenoidVoltageStickyFault(int module);
64 
70 
76  static bool GetPCMSolenoidVoltageFault(int module);
77 
82  bool GetPCMSolenoidVoltageFault() const;
83 
96  static void ClearAllPCMStickyFaults(int module);
97 
109 
110  protected:
116  explicit SolenoidBase(int pcmID);
117 
118  SolenoidBase(SolenoidBase&&) = default;
119  SolenoidBase& operator=(SolenoidBase&&) = default;
120 
121  static constexpr int m_maxModules = 63;
122  static constexpr int m_maxPorts = 8;
123 
124  int m_moduleNumber; // PCM module number
125 };
126 
127 } // namespace frc
frc::SolenoidBase::GetPCMSolenoidVoltageFault
bool GetPCMSolenoidVoltageFault() const
frc::SolenoidBase::GetPCMSolenoidVoltageStickyFault
bool GetPCMSolenoidVoltageStickyFault() const
frc::SolenoidBase::ClearAllPCMStickyFaults
void ClearAllPCMStickyFaults()
Clear ALL sticky faults inside PCM that Compressor is wired to.
frc::SolenoidBase::GetPCMSolenoidBlackList
int GetPCMSolenoidBlackList() const
Reads complete solenoid blacklist for all 8 solenoids as a single byte.
frc::SolenoidBase::SolenoidBase
SolenoidBase(int pcmID)
Constructor.
frc::ErrorBase
Base class for most objects.
Definition: ErrorBase.h:104
frc::SolenoidBase
SolenoidBase class is the common base class for the Solenoid and DoubleSolenoid classes.
Definition: SolenoidBase.h:18
frc::SolenoidBase::GetAll
int GetAll() const
Read all 8 solenoids as a single byte.
frc
WPILib FRC namespace.
Definition: AnalogOutSim.h:16