WPILibC++ 2025.3.1
Loading...
Searching...
No Matches
SensorUtil.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7namespace frc {
8
9/**
10 * Stores most recent status information as well as containing utility functions
11 * for checking channels and error processing.
12 */
13class SensorUtil final {
14 public:
15 SensorUtil() = delete;
16
17 /**
18 * Get the number of the default solenoid module.
19 *
20 * @return The number of the default solenoid module.
21 */
23
24 /**
25 * Get the number of the default solenoid module.
26 *
27 * @return The number of the default solenoid module.
28 */
30
31 /**
32 * Check that the digital channel number is valid.
33 *
34 * Verify that the channel number is one of the legal channel numbers. Channel
35 * numbers are 0-based.
36 *
37 * @return Digital channel is valid
38 */
39 static bool CheckDigitalChannel(int channel);
40
41 /**
42 * Check that the relay channel number is valid.
43 *
44 * Verify that the channel number is one of the legal channel numbers. Channel
45 * numbers are 0-based.
46 *
47 * @return Relay channel is valid
48 */
49 static bool CheckRelayChannel(int channel);
50
51 /**
52 * Check that the digital channel number is valid.
53 *
54 * Verify that the channel number is one of the legal channel numbers. Channel
55 * numbers are 0-based.
56 *
57 * @return PWM channel is valid
58 */
59 static bool CheckPWMChannel(int channel);
60
61 /**
62 * Check that the analog input number is value.
63 *
64 * Verify that the analog input number is one of the legal channel numbers.
65 * Channel numbers are 0-based.
66 *
67 * @return Analog channel is valid
68 */
69 static bool CheckAnalogInputChannel(int channel);
70
71 /**
72 * Check that the analog output number is valid.
73 *
74 * Verify that the analog output number is one of the legal channel numbers.
75 * Channel numbers are 0-based.
76 *
77 * @return Analog channel is valid
78 */
79 static bool CheckAnalogOutputChannel(int channel);
80
82 static int GetNumAnalogInputs();
83 static int GetNumAnalogOuputs();
84 static int GetNumPwmChannels();
85 static int GetNumRelayChannels();
86};
87
88} // namespace frc
Stores most recent status information as well as containing utility functions for checking channels a...
Definition SensorUtil.h:13
static bool CheckRelayChannel(int channel)
Check that the relay channel number is valid.
static int GetNumPwmChannels()
static bool CheckPWMChannel(int channel)
Check that the digital channel number is valid.
SensorUtil()=delete
static bool CheckAnalogInputChannel(int channel)
Check that the analog input number is value.
static int GetNumRelayChannels()
static int GetNumAnalogInputs()
static bool CheckDigitalChannel(int channel)
Check that the digital channel number is valid.
static int GetNumDigitalChannels()
static int GetDefaultREVPHModule()
Get the number of the default solenoid module.
static int GetNumAnalogOuputs()
static int GetDefaultCTREPCMModule()
Get the number of the default solenoid module.
static bool CheckAnalogOutputChannel(int channel)
Check that the analog output number is valid.
Definition CAN.h:11