CTRE Phoenix 6 C++ 26.50.0-alpha-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 * - Default Value: signals#S1FloatStateValue#FloatDetect
33 */
35 /**
36 * \brief The floating state of the Signal 2 input (S2IN).
37 *
38 * - Default Value: signals#S2FloatStateValue#FloatDetect
39 */
41 /**
42 * \brief What value the Signal 1 input (S1IN) needs to be for the CTR
43 * Electronics' CANdi™ to detect as Closed.
44 *
45 * \details Devices using the S1 input as a remote limit switch will
46 * treat the switch as closed when the S1 input is this state.
47 *
48 * - Default Value: signals#S1CloseStateValue#CloseWhenNotFloating
49 */
51 /**
52 * \brief What value the Signal 2 input (S2IN) needs to be for the CTR
53 * Electronics' CANdi™ to detect as Closed.
54 *
55 * \details Devices using the S2 input as a remote limit switch will
56 * treat the switch as closed when the S2 input is this state.
57 *
58 * - Default Value: signals#S2CloseStateValue#CloseWhenNotFloating
59 */
61
62 /**
63 * \brief Modifies this configuration's S1FloatState parameter and returns itself for
64 * method-chaining and easier to use config API.
65 *
66 * The floating state of the Signal 1 input (S1IN).
67 *
68 * - Default Value: signals#S1FloatStateValue#FloatDetect
69 *
70 * \param newS1FloatState Parameter to modify
71 * \returns Itself
72 */
74 {
75 S1FloatState = std::move(newS1FloatState);
76 return *this;
77 }
78
79 /**
80 * \brief Modifies this configuration's S2FloatState parameter and returns itself for
81 * method-chaining and easier to use config API.
82 *
83 * The floating state of the Signal 2 input (S2IN).
84 *
85 * - Default Value: signals#S2FloatStateValue#FloatDetect
86 *
87 * \param newS2FloatState Parameter to modify
88 * \returns Itself
89 */
91 {
92 S2FloatState = std::move(newS2FloatState);
93 return *this;
94 }
95
96 /**
97 * \brief Modifies this configuration's S1CloseState parameter and returns itself for
98 * method-chaining and easier to use config API.
99 *
100 * What value the Signal 1 input (S1IN) needs to be for the CTR
101 * Electronics' CANdi™ to detect as Closed.
102 *
103 * \details Devices using the S1 input as a remote limit switch will
104 * treat the switch as closed when the S1 input is this state.
105 *
106 * - Default Value: signals#S1CloseStateValue#CloseWhenNotFloating
107 *
108 * \param newS1CloseState Parameter to modify
109 * \returns Itself
110 */
112 {
113 S1CloseState = std::move(newS1CloseState);
114 return *this;
115 }
116
117 /**
118 * \brief Modifies this configuration's S2CloseState parameter and returns itself for
119 * method-chaining and easier to use config API.
120 *
121 * What value the Signal 2 input (S2IN) needs to be for the CTR
122 * Electronics' CANdi™ to detect as Closed.
123 *
124 * \details Devices using the S2 input as a remote limit switch will
125 * treat the switch as closed when the S2 input is this state.
126 *
127 * - Default Value: signals#S2CloseStateValue#CloseWhenNotFloating
128 *
129 * \param newS2CloseState Parameter to modify
130 * \returns Itself
131 */
133 {
134 S2CloseState = std::move(newS2CloseState);
135 return *this;
136 }
137
138
139
140 std::string ToString() const override;
141
142 std::string Serialize() const final;
143 ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final;
144};
145
146}
147}
148}
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:50
constexpr DigitalInputsConfigs & WithS2FloatState(signals::S2FloatStateValue newS2FloatState)
Modifies this configuration's S2FloatState parameter and returns itself for method-chaining and easie...
Definition DigitalInputsConfigs.hpp:90
signals::S2FloatStateValue S2FloatState
The floating state of the Signal 2 input (S2IN).
Definition DigitalInputsConfigs.hpp:40
constexpr DigitalInputsConfigs & WithS2CloseState(signals::S2CloseStateValue newS2CloseState)
Modifies this configuration's S2CloseState parameter and returns itself for method-chaining and easie...
Definition DigitalInputsConfigs.hpp:132
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:60
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:111
signals::S1FloatStateValue S1FloatState
The floating state of the Signal 1 input (S1IN).
Definition DigitalInputsConfigs.hpp:34
constexpr DigitalInputsConfigs & WithS1FloatState(signals::S1FloatStateValue newS1FloatState)
Modifies this configuration's S1FloatState parameter and returns itself for method-chaining and easie...
Definition DigitalInputsConfigs.hpp:73
Definition Configuration.hpp:17
Definition ExternalFeedbackConfigs.hpp:21
Definition ExternalFeedbackConfigs.hpp:16
Definition FrcUsageReport.hpp:12
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