WPILibC++  unspecified
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 "ErrorBase.h"
11 #include "SmartDashboard/SendableBase.h"
12 
13 namespace frc {
14 
19 class SolenoidBase : public ErrorBase, public SendableBase {
20  public:
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 
36  static constexpr int m_maxModules = 63;
37  static constexpr int m_maxPorts = 8;
38 
39  int m_moduleNumber; // PCM module number
40 };
41 
42 } // namespace frc
Definition: RobotController.cpp:14
SolenoidBase class is the common base class for the Solenoid and DoubleSolenoid classes.
Definition: SolenoidBase.h:19
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
Base class for most objects.
Definition: ErrorBase.h:74
Definition: SendableBase.h:19
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