WPILibC++  2019.2.1-17-g6992f54
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
SolenoidBase.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2008-2018 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 #include "frc/smartdashboard/SendableBase.h"
12 
13 namespace frc {
14 
19 class SolenoidBase : public ErrorBase, public SendableBase {
20  public:
27  static int GetAll(int module);
28 
34  int GetAll() const;
35 
46  static int GetPCMSolenoidBlackList(int module);
47 
57  int GetPCMSolenoidBlackList() const;
58 
64  static bool GetPCMSolenoidVoltageStickyFault(int module);
65 
71 
77  static bool GetPCMSolenoidVoltageFault(int module);
78 
83  bool GetPCMSolenoidVoltageFault() const;
84 
97  static void ClearAllPCMStickyFaults(int module);
98 
110 
111  protected:
117  explicit SolenoidBase(int pcmID);
118 
119  SolenoidBase(SolenoidBase&&) = default;
120  SolenoidBase& operator=(SolenoidBase&&) = default;
121 
122  static constexpr int m_maxModules = 63;
123  static constexpr int m_maxPorts = 8;
124 
125  int m_moduleNumber; // PCM module number
126 };
127 
128 } // namespace frc
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
bool GetPCMSolenoidVoltageFault() const
SolenoidBase class is the common base class for the Solenoid and DoubleSolenoid classes.
Definition: SolenoidBase.h:19
bool GetPCMSolenoidVoltageStickyFault() const
void ClearAllPCMStickyFaults()
Clear ALL sticky faults inside PCM that Compressor is wired to.
int GetAll() const
Read all 8 solenoids as a single byte.
SolenoidBase(int pcmID)
Constructor.
Base class for most objects.
Definition: ErrorBase.h:74
Definition: SendableBase.h:19
int GetPCMSolenoidBlackList() const
Reads complete solenoid blacklist for all 8 solenoids as a single byte.