WPILibC++  2019.1.1-beta-1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
SensorUtil.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 namespace frc {
11 
16 class SensorUtil final {
17  public:
23  static int GetDefaultSolenoidModule();
24 
30  static bool CheckSolenoidModule(int moduleNumber);
31 
40  static bool CheckDigitalChannel(int channel);
41 
50  static bool CheckRelayChannel(int channel);
51 
60  static bool CheckPWMChannel(int channel);
61 
70  static bool CheckAnalogInputChannel(int channel);
71 
80  static bool CheckAnalogOutputChannel(int channel);
81 
87  static bool CheckSolenoidChannel(int channel);
88 
94  static bool CheckPDPChannel(int channel);
95 
102  static bool CheckPDPModule(int module);
103 
104  static const int kDigitalChannels;
105  static const int kAnalogInputs;
106  static const int kAnalogOutputs;
107  static const int kSolenoidChannels;
108  static const int kSolenoidModules;
109  static const int kPwmChannels;
110  static const int kRelayChannels;
111  static const int kPDPChannels;
112 
113  private:
114  SensorUtil() = default;
115 };
116 
117 } // namespace frc
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
static int GetDefaultSolenoidModule()
Get the number of the default solenoid module.
static bool CheckAnalogOutputChannel(int channel)
Check that the analog output number is valid.
Stores most recent status information as well as containing utility functions for checking channels a...
Definition: SensorUtil.h:16
static bool CheckPDPChannel(int channel)
Verify that the power distribution channel number is within limits.
static bool CheckSolenoidModule(int moduleNumber)
Check that the solenoid module number is valid.
static bool CheckSolenoidChannel(int channel)
Verify that the solenoid channel number is within limits.
static bool CheckPWMChannel(int channel)
Check that the digital channel number is valid.
static bool CheckRelayChannel(int channel)
Check that the relay channel number is valid.
static bool CheckDigitalChannel(int channel)
Check that the digital channel number is valid.
static bool CheckAnalogInputChannel(int channel)
Check that the analog input number is value.
static bool CheckPDPModule(int module)
Verify that the PDP module number is within limits.