CTRE Phoenix 6 C++ 26.0.0-beta-1
Loading...
Searching...
No Matches
DigitalInputsConfigs.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) Cross The Road Electronics.  All rights reserved.
3 * License information can be found in CTRE_LICENSE.txt
4 * For support and suggestions contact support@ctr-electronics.com or file
5 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
6 */
7#pragma once
8
11
12namespace ctre {
13namespace phoenix6 {
14
15
16namespace configs {
17
18/**
19 * \brief Configs related to the CANdi™ branded device's digital I/O
20 * settings
21 *
22 * \details Contains float-state settings and when to assert the S1/S2
23 * inputs.
24 */
26public:
27 constexpr DigitalInputsConfigs() = default;
28
29 /**
30 * \brief The floating state of the Signal 1 input (S1IN).
31 *
32 */
34 /**
35 * \brief The floating state of the Signal 2 input (S2IN).
36 *
37 */
39 /**
40 * \brief What value the Signal 1 input (S1IN) needs to be for the CTR
41 * Electronics' CANdi™ to detect as Closed.
42 *
43 * \details Devices using the S1 input as a remote limit switch will
44 * treat the switch as closed when the S1 input is this state.
45 *
46 */
48 /**
49 * \brief What value the Signal 2 input (S2IN) needs to be for the CTR
50 * Electronics' CANdi™ to detect as Closed.
51 *
52 * \details Devices using the S2 input as a remote limit switch will
53 * treat the switch as closed when the S2 input is this state.
54 *
55 */
57
58 /**
59 * \brief Modifies this configuration's S1FloatState parameter and returns itself for
60 * method-chaining and easier to use config API.
61 *
62 * The floating state of the Signal 1 input (S1IN).
63 *
64 *
65 * \param newS1FloatState Parameter to modify
66 * \returns Itself
67 */
69 {
70 S1FloatState = std::move(newS1FloatState);
71 return *this;
72 }
73
74 /**
75 * \brief Modifies this configuration's S2FloatState parameter and returns itself for
76 * method-chaining and easier to use config API.
77 *
78 * The floating state of the Signal 2 input (S2IN).
79 *
80 *
81 * \param newS2FloatState Parameter to modify
82 * \returns Itself
83 */
85 {
86 S2FloatState = std::move(newS2FloatState);
87 return *this;
88 }
89
90 /**
91 * \brief Modifies this configuration's S1CloseState parameter and returns itself for
92 * method-chaining and easier to use config API.
93 *
94 * What value the Signal 1 input (S1IN) needs to be for the CTR
95 * Electronics' CANdi™ to detect as Closed.
96 *
97 * \details Devices using the S1 input as a remote limit switch will
98 * treat the switch as closed when the S1 input is this state.
99 *
100 *
101 * \param newS1CloseState Parameter to modify
102 * \returns Itself
103 */
105 {
106 S1CloseState = std::move(newS1CloseState);
107 return *this;
108 }
109
110 /**
111 * \brief Modifies this configuration's S2CloseState parameter and returns itself for
112 * method-chaining and easier to use config API.
113 *
114 * What value the Signal 2 input (S2IN) needs to be for the CTR
115 * Electronics' CANdi™ to detect as Closed.
116 *
117 * \details Devices using the S2 input as a remote limit switch will
118 * treat the switch as closed when the S2 input is this state.
119 *
120 *
121 * \param newS2CloseState Parameter to modify
122 * \returns Itself
123 */
125 {
126 S2CloseState = std::move(newS2CloseState);
127 return *this;
128 }
129
130
131
132 std::string ToString() const override;
133
134 std::string Serialize() const final;
135 ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final;
136};
137
138}
139}
140}
Configs related to the CANdi™ branded device's digital I/O settings.
Definition DigitalInputsConfigs.hpp:25
signals::S1CloseStateValue S1CloseState
What value the Signal 1 input (S1IN) needs to be for the CTR Electronics' CANdi™ to detect as Closed.
Definition DigitalInputsConfigs.hpp:47
constexpr DigitalInputsConfigs & WithS2FloatState(signals::S2FloatStateValue newS2FloatState)
Modifies this configuration's S2FloatState parameter and returns itself for method-chaining and easie...
Definition DigitalInputsConfigs.hpp:84
signals::S2FloatStateValue S2FloatState
The floating state of the Signal 2 input (S2IN).
Definition DigitalInputsConfigs.hpp:38
constexpr DigitalInputsConfigs & WithS2CloseState(signals::S2CloseStateValue newS2CloseState)
Modifies this configuration's S2CloseState parameter and returns itself for method-chaining and easie...
Definition DigitalInputsConfigs.hpp:124
std::string ToString() const override
signals::S2CloseStateValue S2CloseState
What value the Signal 2 input (S2IN) needs to be for the CTR Electronics' CANdi™ to detect as Closed.
Definition DigitalInputsConfigs.hpp:56
ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final
constexpr DigitalInputsConfigs & WithS1CloseState(signals::S1CloseStateValue newS1CloseState)
Modifies this configuration's S1CloseState parameter and returns itself for method-chaining and easie...
Definition DigitalInputsConfigs.hpp:104
signals::S1FloatStateValue S1FloatState
The floating state of the Signal 1 input (S1IN).
Definition DigitalInputsConfigs.hpp:33
constexpr DigitalInputsConfigs & WithS1FloatState(signals::S1FloatStateValue newS1FloatState)
Modifies this configuration's S1FloatState parameter and returns itself for method-chaining and easie...
Definition DigitalInputsConfigs.hpp:68
Definition Configuration.hpp:17
Definition motor_constants.h:14
What value the Signal 1 input (S1IN) needs to be for the CTR Electronics' CANdi™ to detect as Closed.
Definition SpnEnums.hpp:3533
static constexpr int CloseWhenNotFloating
The S1 input will be treated as closed when it is not floating.
Definition SpnEnums.hpp:3539
The floating state of the Signal 1 input (S1IN).
Definition SpnEnums.hpp:3091
static constexpr int FloatDetect
The input will attempt to detect when it is floating.
Definition SpnEnums.hpp:3098
What value the Signal 2 input (S2IN) needs to be for the CTR Electronics' CANdi™ to detect as Closed.
Definition SpnEnums.hpp:3611
static constexpr int CloseWhenNotFloating
The S2 input will be treated as closed when it is not floating.
Definition SpnEnums.hpp:3617
The floating state of the Signal 2 input (S2IN).
Definition SpnEnums.hpp:3159
static constexpr int FloatDetect
The input will attempt to detect when it is floating.
Definition SpnEnums.hpp:3166