WPILibC++  unspecified
SolenoidBase.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2008-2017 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 "SensorBase.h"
11 
12 namespace frc {
13 
18 class SolenoidBase : public SensorBase {
19  public:
20  virtual ~SolenoidBase() = default;
21  static int GetAll(int module);
22  int GetAll() const;
23 
24  static int GetPCMSolenoidBlackList(int module);
25  int GetPCMSolenoidBlackList() const;
26  static bool GetPCMSolenoidVoltageStickyFault(int module);
28  static bool GetPCMSolenoidVoltageFault(int module);
29  bool GetPCMSolenoidVoltageFault() const;
30  static void ClearAllPCMStickyFaults(int module);
32 
33  protected:
34  explicit SolenoidBase(int pcmID);
35  static const int m_maxModules = 63;
36  static const int m_maxPorts = 8;
37  int m_moduleNumber; // PCM module number
38 };
39 
40 } // namespace frc
Definition: Timer.cpp:18
Base class for all sensors.
Definition: SensorBase.h:20
SolenoidBase class is the common base class for the Solenoid and DoubleSolenoid classes.
Definition: SolenoidBase.h:18
int GetAll() const
Read all 8 solenoids as a single byte.
Definition: SolenoidBase.cpp:41
void ClearAllPCMStickyFaults()
Clear ALL sticky faults inside PCM that Compressor is wired to.
Definition: SolenoidBase.cpp:136
bool GetPCMSolenoidVoltageStickyFault() const
Definition: SolenoidBase.cpp:87
SolenoidBase(int pcmID)
Constructor.
Definition: SolenoidBase.cpp:20
int GetPCMSolenoidBlackList() const
Reads complete solenoid blacklist for all 8 solenoids as a single byte.
Definition: SolenoidBase.cpp:69
bool GetPCMSolenoidVoltageFault() const
Definition: SolenoidBase.cpp:105