WPILibC++  unspecified
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:
18  static int GetDefaultSolenoidModule();
19 
25  static bool CheckSolenoidModule(int moduleNumber);
26 
35  static bool CheckDigitalChannel(int channel);
36 
45  static bool CheckRelayChannel(int channel);
46 
55  static bool CheckPWMChannel(int channel);
56 
65  static bool CheckAnalogInputChannel(int channel);
66 
75  static bool CheckAnalogOutputChannel(int channel);
76 
82  static bool CheckSolenoidChannel(int channel);
83 
89  static bool CheckPDPChannel(int channel);
90 
91  static const int kDigitalChannels;
92  static const int kAnalogInputs;
93  static const int kAnalogOutputs;
94  static const int kSolenoidChannels;
95  static const int kSolenoidModules;
96  static const int kPwmChannels;
97  static const int kRelayChannels;
98  static const int kPDPChannels;
99 
100  private:
101  SensorUtil() = default;
102 };
103 
104 } // namespace frc
Definition: Utility.cpp:119
static bool CheckPDPChannel(int channel)
Verify that the power distribution channel number is within limits.
Definition: SensorUtil.cpp:60
static bool CheckAnalogOutputChannel(int channel)
Check that the analog output number is valid.
Definition: SensorUtil.cpp:52
Stores most recent status information as well as containing utility functions for checking channels a...
Definition: SensorUtil.h:16
static bool CheckAnalogInputChannel(int channel)
Check that the analog input number is value.
Definition: SensorUtil.cpp:48
static bool CheckDigitalChannel(int channel)
Check that the digital channel number is valid.
Definition: SensorUtil.cpp:36
static bool CheckSolenoidChannel(int channel)
Verify that the solenoid channel number is within limits.
Definition: SensorUtil.cpp:56
static bool CheckSolenoidModule(int moduleNumber)
Check that the solenoid module number is valid.
Definition: SensorUtil.cpp:32
static bool CheckPWMChannel(int channel)
Check that the digital channel number is valid.
Definition: SensorUtil.cpp:44
static bool CheckRelayChannel(int channel)
Check that the relay channel number is valid.
Definition: SensorUtil.cpp:40