CTRE Phoenix 6 C++ 26.1.1
Loading...
Searching...
No Matches
HardwareLimitSwitchConfigs.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#include <units/angle.h>
12
13namespace ctre {
14namespace phoenix6 {
15namespace hardware::core { class CoreCANcoder; }
16namespace hardware::core { class CoreCANdi; }
17namespace hardware::core { class CoreCANrange; }
18namespace hardware::traits { class CommonTalon; }
19
20namespace configs {
21
22/**
23 * \brief Configs that change how the motor controller behaves under
24 * different limit switch states.
25 *
26 * \details Includes configs such as enabling limit switches,
27 * configuring the remote sensor ID, the source, and the
28 * position to set on limit.
29 */
31public:
32 constexpr HardwareLimitSwitchConfigs() = default;
33
34 /**
35 * \brief Determines if the forward limit switch is normally-open
36 * (default) or normally-closed.
37 *
38 */
40 /**
41 * \brief If enabled, the position is automatically set to a specific
42 * value, specified by ForwardLimitAutosetPositionValue, when the
43 * forward limit switch is asserted.
44 *
45 * - Default Value: False
46 */
48 /**
49 * \brief The value to automatically set the position to when the
50 * forward limit switch is asserted. This has no effect if
51 * ForwardLimitAutosetPositionEnable is false.
52 *
53 * - Minimum Value: -3.4e+38
54 * - Maximum Value: 3.4e+38
55 * - Default Value: 0
56 * - Units: rotations
57 */
58 units::angle::turn_t ForwardLimitAutosetPositionValue = 0_tr;
59 /**
60 * \brief If enabled, motor output is set to neutral when the forward
61 * limit switch is asserted and positive output is requested.
62 *
63 * - Default Value: True
64 */
65 bool ForwardLimitEnable = true;
66 /**
67 * \brief Determines where to poll the forward limit switch. This
68 * defaults to the forward limit switch pin on the limit switch
69 * connector.
70 *
71 * Choose RemoteTalonFX to use the forward limit switch attached to
72 * another Talon FX on the same CAN bus (this also requires setting
73 * ForwardLimitRemoteSensorID).
74 *
75 * Choose RemoteCANifier to use the forward limit switch attached to
76 * another CANifier on the same CAN bus (this also requires setting
77 * ForwardLimitRemoteSensorID).
78 *
79 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
80 * (this also requires setting ForwardLimitRemoteSensorID). The
81 * forward limit will assert when the CANcoder magnet strength changes
82 * from BAD (red) to ADEQUATE (orange) or GOOD (green).
83 *
84 */
86 /**
87 * \brief Device ID of the remote device if using remote limit switch
88 * features for the forward limit switch.
89 *
90 * - Minimum Value: 0
91 * - Maximum Value: 62
92 * - Default Value: 0
93 * - Units:
94 */
96 /**
97 * \brief Determines if the reverse limit switch is normally-open
98 * (default) or normally-closed.
99 *
100 */
102 /**
103 * \brief If enabled, the position is automatically set to a specific
104 * value, specified by ReverseLimitAutosetPositionValue, when the
105 * reverse limit switch is asserted.
106 *
107 * - Default Value: False
108 */
110 /**
111 * \brief The value to automatically set the position to when the
112 * reverse limit switch is asserted. This has no effect if
113 * ReverseLimitAutosetPositionEnable is false.
114 *
115 * - Minimum Value: -3.4e+38
116 * - Maximum Value: 3.4e+38
117 * - Default Value: 0
118 * - Units: rotations
119 */
120 units::angle::turn_t ReverseLimitAutosetPositionValue = 0_tr;
121 /**
122 * \brief If enabled, motor output is set to neutral when reverse
123 * limit switch is asseted and negative output is requested.
124 *
125 * - Default Value: True
126 */
128 /**
129 * \brief Determines where to poll the reverse limit switch. This
130 * defaults to the reverse limit switch pin on the limit switch
131 * connector.
132 *
133 * Choose RemoteTalonFX to use the reverse limit switch attached to
134 * another Talon FX on the same CAN bus (this also requires setting
135 * ReverseLimitRemoteSensorID).
136 *
137 * Choose RemoteCANifier to use the reverse limit switch attached to
138 * another CANifier on the same CAN bus (this also requires setting
139 * ReverseLimitRemoteSensorID).
140 *
141 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
142 * (this also requires setting ReverseLimitRemoteSensorID). The
143 * reverse limit will assert when the CANcoder magnet strength changes
144 * from BAD (red) to ADEQUATE (orange) or GOOD (green).
145 *
146 */
148 /**
149 * \brief Device ID of the remote device if using remote limit switch
150 * features for the reverse limit switch.
151 *
152 * - Minimum Value: 0
153 * - Maximum Value: 62
154 * - Default Value: 0
155 * - Units:
156 */
158
159 /**
160 * \brief Modifies this configuration's ForwardLimitType parameter and returns itself for
161 * method-chaining and easier to use config API.
162 *
163 * Determines if the forward limit switch is normally-open (default)
164 * or normally-closed.
165 *
166 *
167 * \param newForwardLimitType Parameter to modify
168 * \returns Itself
169 */
171 {
172 ForwardLimitType = std::move(newForwardLimitType);
173 return *this;
174 }
175
176 /**
177 * \brief Modifies this configuration's ForwardLimitAutosetPositionEnable parameter and returns itself for
178 * method-chaining and easier to use config API.
179 *
180 * If enabled, the position is automatically set to a specific value,
181 * specified by ForwardLimitAutosetPositionValue, when the forward
182 * limit switch is asserted.
183 *
184 * - Default Value: False
185 *
186 * \param newForwardLimitAutosetPositionEnable Parameter to modify
187 * \returns Itself
188 */
189 constexpr HardwareLimitSwitchConfigs &WithForwardLimitAutosetPositionEnable(bool newForwardLimitAutosetPositionEnable)
190 {
191 ForwardLimitAutosetPositionEnable = std::move(newForwardLimitAutosetPositionEnable);
192 return *this;
193 }
194
195 /**
196 * \brief Modifies this configuration's ForwardLimitAutosetPositionValue parameter and returns itself for
197 * method-chaining and easier to use config API.
198 *
199 * The value to automatically set the position to when the forward
200 * limit switch is asserted. This has no effect if
201 * ForwardLimitAutosetPositionEnable is false.
202 *
203 * - Minimum Value: -3.4e+38
204 * - Maximum Value: 3.4e+38
205 * - Default Value: 0
206 * - Units: rotations
207 *
208 * \param newForwardLimitAutosetPositionValue Parameter to modify
209 * \returns Itself
210 */
211 constexpr HardwareLimitSwitchConfigs &WithForwardLimitAutosetPositionValue(units::angle::turn_t newForwardLimitAutosetPositionValue)
212 {
213 ForwardLimitAutosetPositionValue = std::move(newForwardLimitAutosetPositionValue);
214 return *this;
215 }
216
217 /**
218 * \brief Modifies this configuration's ForwardLimitEnable parameter and returns itself for
219 * method-chaining and easier to use config API.
220 *
221 * If enabled, motor output is set to neutral when the forward limit
222 * switch is asserted and positive output is requested.
223 *
224 * - Default Value: True
225 *
226 * \param newForwardLimitEnable Parameter to modify
227 * \returns Itself
228 */
229 constexpr HardwareLimitSwitchConfigs &WithForwardLimitEnable(bool newForwardLimitEnable)
230 {
231 ForwardLimitEnable = std::move(newForwardLimitEnable);
232 return *this;
233 }
234
235 /**
236 * \brief Modifies this configuration's ForwardLimitSource parameter and returns itself for
237 * method-chaining and easier to use config API.
238 *
239 * Determines where to poll the forward limit switch. This defaults
240 * to the forward limit switch pin on the limit switch connector.
241 *
242 * Choose RemoteTalonFX to use the forward limit switch attached to
243 * another Talon FX on the same CAN bus (this also requires setting
244 * ForwardLimitRemoteSensorID).
245 *
246 * Choose RemoteCANifier to use the forward limit switch attached to
247 * another CANifier on the same CAN bus (this also requires setting
248 * ForwardLimitRemoteSensorID).
249 *
250 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
251 * (this also requires setting ForwardLimitRemoteSensorID). The
252 * forward limit will assert when the CANcoder magnet strength changes
253 * from BAD (red) to ADEQUATE (orange) or GOOD (green).
254 *
255 *
256 * \param newForwardLimitSource Parameter to modify
257 * \returns Itself
258 */
260 {
261 ForwardLimitSource = std::move(newForwardLimitSource);
262 return *this;
263 }
264
265 /**
266 * \brief Modifies this configuration's ForwardLimitRemoteSensorID parameter and returns itself for
267 * method-chaining and easier to use config API.
268 *
269 * Device ID of the remote device if using remote limit switch
270 * features for the forward limit switch.
271 *
272 * - Minimum Value: 0
273 * - Maximum Value: 62
274 * - Default Value: 0
275 * - Units:
276 *
277 * \param newForwardLimitRemoteSensorID Parameter to modify
278 * \returns Itself
279 */
280 constexpr HardwareLimitSwitchConfigs &WithForwardLimitRemoteSensorID(int newForwardLimitRemoteSensorID)
281 {
282 ForwardLimitRemoteSensorID = std::move(newForwardLimitRemoteSensorID);
283 return *this;
284 }
285
286 /**
287 * \brief Modifies this configuration's ReverseLimitType parameter and returns itself for
288 * method-chaining and easier to use config API.
289 *
290 * Determines if the reverse limit switch is normally-open (default)
291 * or normally-closed.
292 *
293 *
294 * \param newReverseLimitType Parameter to modify
295 * \returns Itself
296 */
298 {
299 ReverseLimitType = std::move(newReverseLimitType);
300 return *this;
301 }
302
303 /**
304 * \brief Modifies this configuration's ReverseLimitAutosetPositionEnable parameter and returns itself for
305 * method-chaining and easier to use config API.
306 *
307 * If enabled, the position is automatically set to a specific value,
308 * specified by ReverseLimitAutosetPositionValue, when the reverse
309 * limit switch is asserted.
310 *
311 * - Default Value: False
312 *
313 * \param newReverseLimitAutosetPositionEnable Parameter to modify
314 * \returns Itself
315 */
316 constexpr HardwareLimitSwitchConfigs &WithReverseLimitAutosetPositionEnable(bool newReverseLimitAutosetPositionEnable)
317 {
318 ReverseLimitAutosetPositionEnable = std::move(newReverseLimitAutosetPositionEnable);
319 return *this;
320 }
321
322 /**
323 * \brief Modifies this configuration's ReverseLimitAutosetPositionValue parameter and returns itself for
324 * method-chaining and easier to use config API.
325 *
326 * The value to automatically set the position to when the reverse
327 * limit switch is asserted. This has no effect if
328 * ReverseLimitAutosetPositionEnable is false.
329 *
330 * - Minimum Value: -3.4e+38
331 * - Maximum Value: 3.4e+38
332 * - Default Value: 0
333 * - Units: rotations
334 *
335 * \param newReverseLimitAutosetPositionValue Parameter to modify
336 * \returns Itself
337 */
338 constexpr HardwareLimitSwitchConfigs &WithReverseLimitAutosetPositionValue(units::angle::turn_t newReverseLimitAutosetPositionValue)
339 {
340 ReverseLimitAutosetPositionValue = std::move(newReverseLimitAutosetPositionValue);
341 return *this;
342 }
343
344 /**
345 * \brief Modifies this configuration's ReverseLimitEnable parameter and returns itself for
346 * method-chaining and easier to use config API.
347 *
348 * If enabled, motor output is set to neutral when reverse limit
349 * switch is asseted and negative output is requested.
350 *
351 * - Default Value: True
352 *
353 * \param newReverseLimitEnable Parameter to modify
354 * \returns Itself
355 */
356 constexpr HardwareLimitSwitchConfigs &WithReverseLimitEnable(bool newReverseLimitEnable)
357 {
358 ReverseLimitEnable = std::move(newReverseLimitEnable);
359 return *this;
360 }
361
362 /**
363 * \brief Modifies this configuration's ReverseLimitSource parameter and returns itself for
364 * method-chaining and easier to use config API.
365 *
366 * Determines where to poll the reverse limit switch. This defaults
367 * to the reverse limit switch pin on the limit switch connector.
368 *
369 * Choose RemoteTalonFX to use the reverse limit switch attached to
370 * another Talon FX on the same CAN bus (this also requires setting
371 * ReverseLimitRemoteSensorID).
372 *
373 * Choose RemoteCANifier to use the reverse limit switch attached to
374 * another CANifier on the same CAN bus (this also requires setting
375 * ReverseLimitRemoteSensorID).
376 *
377 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
378 * (this also requires setting ReverseLimitRemoteSensorID). The
379 * reverse limit will assert when the CANcoder magnet strength changes
380 * from BAD (red) to ADEQUATE (orange) or GOOD (green).
381 *
382 *
383 * \param newReverseLimitSource Parameter to modify
384 * \returns Itself
385 */
387 {
388 ReverseLimitSource = std::move(newReverseLimitSource);
389 return *this;
390 }
391
392 /**
393 * \brief Modifies this configuration's ReverseLimitRemoteSensorID parameter and returns itself for
394 * method-chaining and easier to use config API.
395 *
396 * Device ID of the remote device if using remote limit switch
397 * features for the reverse limit switch.
398 *
399 * - Minimum Value: 0
400 * - Maximum Value: 62
401 * - Default Value: 0
402 * - Units:
403 *
404 * \param newReverseLimitRemoteSensorID Parameter to modify
405 * \returns Itself
406 */
407 constexpr HardwareLimitSwitchConfigs &WithReverseLimitRemoteSensorID(int newReverseLimitRemoteSensorID)
408 {
409 ReverseLimitRemoteSensorID = std::move(newReverseLimitRemoteSensorID);
410 return *this;
411 }
412
413 /**
414 * \brief Helper method to configure this feedback group to use
415 * RemoteTalonFX forward limit switch by passing in the
416 * CommonTalon object. When using RemoteTalonFX, the Talon FX
417 * will use the forward limit switch attached to another Talon
418 * FX on the same CAN bus.
419 *
420 * \param device CommonTalon reference to use for RemoteTalonFX forward limit
421 * switch
422 * \returns Itself
423 */
425
426 /**
427 * \brief Helper method to configure this feedback group to use
428 * RemoteCANcoder forward limit switch by passing in the
429 * CANcoder object. When using RemoteCANcoder, the Talon FX
430 * will use another CANcoder on the same CAN bus. The forward
431 * limit will assert when the CANcoder magnet strength changes
432 * from BAD (red) to ADEQUATE (orange) or GOOD (green).
433 *
434 * \param device CANcoder reference to use for RemoteCANcoder forward limit
435 * switch
436 * \returns Itself
437 */
439
440 /**
441 * \brief Helper method to configure this feedback group to use the
442 * RemoteCANrange by passing in the CANrange object. The
443 * forward limit will assert when the CANrange proximity detect
444 * is tripped.
445 *
446 * \param device CANrange reference to use for RemoteCANrange forward limit
447 * switch
448 * \returns Itself
449 */
451
452 /**
453 * \brief Helper method to configure this feedback group to use
454 * RemoteCANdi forward limit switch on Signal 1 Input (S1IN) by
455 * passing in the CANdi object. The forward limit will assert
456 * when the CANdi™ branded device's Signal 1 Input (S1IN) pin
457 * matches the configured closed state.
458 *
459 * \param device CANdi reference to use for RemoteCANdi forward limit switch
460 * \returns Itself
461 */
463
464 /**
465 * \brief Helper method to configure this feedback group to use
466 * RemoteCANdi forward limit switch on Signal 2 Input (S2IN) by
467 * passing in the CANdi object. The forward limit will assert
468 * when the CANdi™ branded device's Signal 2 Input (S2IN) pin
469 * matches the configured closed state.
470 *
471 * \param device CANdi reference to use for RemoteCANdi forward limit switch
472 * \returns Itself
473 */
475
476 /**
477 * \brief Helper method to configure this feedback group to use
478 * RemoteTalonFX reverse limit switch by passing in the
479 * CommonTalon object. When using RemoteTalonFX, the Talon FX
480 * will use the reverse limit switch attached to another Talon
481 * FX on the same CAN bus.
482 *
483 * \param device CommonTalon reference to use for RemoteTalonFX reverse limit
484 * switch
485 * \returns Itself
486 */
488
489 /**
490 * \brief Helper method to configure this feedback group to use
491 * RemoteCANcoder reverse limit switch by passing in the
492 * CANcoder object. When using RemoteCANcoder, the Talon FX
493 * will use another CANcoder on the same CAN bus. The reverse
494 * limit will assert when the CANcoder magnet strength changes
495 * from BAD (red) to ADEQUATE (orange) or GOOD (green).
496 *
497 * \param device CANcoder reference to use for RemoteCANcoder reverse limit
498 * switch
499 * \returns Itself
500 */
502
503 /**
504 * \brief Helper method to configure this feedback group to use the
505 * RemoteCANrange by passing in the CANrange object. The
506 * reverse limit will assert when the CANrange proximity detect
507 * is tripped.
508 *
509 * \param device CANrange reference to use for RemoteCANrange reverse limit
510 * switch
511 * \returns Itself
512 */
514
515 /**
516 * \brief Helper method to configure this feedback group to use
517 * RemoteCANdi reverse limit switch on Signal 1 Input (S1IN) by
518 * passing in the CANdi object. The reverse limit will assert
519 * when the CANdi™ branded device's Signal 1 Input (S1IN) pin
520 * matches the configured closed state.
521 *
522 * \param device CANdi reference to use for RemoteCANdi reverse limit switch
523 * \returns Itself
524 */
526
527 /**
528 * \brief Helper method to configure this feedback group to use
529 * RemoteCANdi reverse limit switch on Signal 2 Input (S2IN) by
530 * passing in the CANdi object. The reverse limit will assert
531 * when the CANdi™ branded device's Signal 2 Input (S2IN) pin
532 * matches the configured closed state.
533 *
534 * \param device CANdi reference to use for RemoteCANdi reverse limit switch
535 * \returns Itself
536 */
538
539
540
541 std::string ToString() const override;
542
543 std::string Serialize() const final;
544 ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final;
545};
546
547}
548}
549}
Configs that change how the motor controller behaves under different limit switch states.
Definition HardwareLimitSwitchConfigs.hpp:30
HardwareLimitSwitchConfigs & WithForwardLimitRemoteCANrange(const hardware::core::CoreCANrange &device)
Helper method to configure this feedback group to use the RemoteCANrange by passing in the CANrange o...
HardwareLimitSwitchConfigs & WithReverseLimitRemoteTalonFX(const hardware::traits::CommonTalon &device)
Helper method to configure this feedback group to use RemoteTalonFX reverse limit switch by passing i...
signals::ForwardLimitTypeValue ForwardLimitType
Determines if the forward limit switch is normally-open (default) or normally-closed.
Definition HardwareLimitSwitchConfigs.hpp:39
constexpr HardwareLimitSwitchConfigs & WithForwardLimitAutosetPositionValue(units::angle::turn_t newForwardLimitAutosetPositionValue)
Modifies this configuration's ForwardLimitAutosetPositionValue parameter and returns itself for metho...
Definition HardwareLimitSwitchConfigs.hpp:211
ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final
units::angle::turn_t ForwardLimitAutosetPositionValue
The value to automatically set the position to when the forward limit switch is asserted.
Definition HardwareLimitSwitchConfigs.hpp:58
signals::ForwardLimitSourceValue ForwardLimitSource
Determines where to poll the forward limit switch.
Definition HardwareLimitSwitchConfigs.hpp:85
constexpr HardwareLimitSwitchConfigs & WithForwardLimitEnable(bool newForwardLimitEnable)
Modifies this configuration's ForwardLimitEnable parameter and returns itself for method-chaining and...
Definition HardwareLimitSwitchConfigs.hpp:229
bool ForwardLimitEnable
If enabled, motor output is set to neutral when the forward limit switch is asserted and positive out...
Definition HardwareLimitSwitchConfigs.hpp:65
bool ReverseLimitAutosetPositionEnable
If enabled, the position is automatically set to a specific value, specified by ReverseLimitAutosetPo...
Definition HardwareLimitSwitchConfigs.hpp:109
bool ForwardLimitAutosetPositionEnable
If enabled, the position is automatically set to a specific value, specified by ForwardLimitAutosetPo...
Definition HardwareLimitSwitchConfigs.hpp:47
constexpr HardwareLimitSwitchConfigs & WithReverseLimitAutosetPositionValue(units::angle::turn_t newReverseLimitAutosetPositionValue)
Modifies this configuration's ReverseLimitAutosetPositionValue parameter and returns itself for metho...
Definition HardwareLimitSwitchConfigs.hpp:338
constexpr HardwareLimitSwitchConfigs & WithReverseLimitSource(signals::ReverseLimitSourceValue newReverseLimitSource)
Modifies this configuration's ReverseLimitSource parameter and returns itself for method-chaining and...
Definition HardwareLimitSwitchConfigs.hpp:386
signals::ReverseLimitTypeValue ReverseLimitType
Determines if the reverse limit switch is normally-open (default) or normally-closed.
Definition HardwareLimitSwitchConfigs.hpp:101
units::angle::turn_t ReverseLimitAutosetPositionValue
The value to automatically set the position to when the reverse limit switch is asserted.
Definition HardwareLimitSwitchConfigs.hpp:120
HardwareLimitSwitchConfigs & WithForwardLimitRemoteCANdiS1(const hardware::core::CoreCANdi &device)
Helper method to configure this feedback group to use RemoteCANdi forward limit switch on Signal 1 In...
constexpr HardwareLimitSwitchConfigs & WithForwardLimitAutosetPositionEnable(bool newForwardLimitAutosetPositionEnable)
Modifies this configuration's ForwardLimitAutosetPositionEnable parameter and returns itself for meth...
Definition HardwareLimitSwitchConfigs.hpp:189
constexpr HardwareLimitSwitchConfigs & WithForwardLimitRemoteSensorID(int newForwardLimitRemoteSensorID)
Modifies this configuration's ForwardLimitRemoteSensorID parameter and returns itself for method-chai...
Definition HardwareLimitSwitchConfigs.hpp:280
constexpr HardwareLimitSwitchConfigs & WithReverseLimitAutosetPositionEnable(bool newReverseLimitAutosetPositionEnable)
Modifies this configuration's ReverseLimitAutosetPositionEnable parameter and returns itself for meth...
Definition HardwareLimitSwitchConfigs.hpp:316
HardwareLimitSwitchConfigs & WithReverseLimitRemoteCANcoder(const hardware::core::CoreCANcoder &device)
Helper method to configure this feedback group to use RemoteCANcoder reverse limit switch by passing ...
constexpr HardwareLimitSwitchConfigs & WithReverseLimitType(signals::ReverseLimitTypeValue newReverseLimitType)
Modifies this configuration's ReverseLimitType parameter and returns itself for method-chaining and e...
Definition HardwareLimitSwitchConfigs.hpp:297
HardwareLimitSwitchConfigs & WithForwardLimitRemoteCANdiS2(const hardware::core::CoreCANdi &device)
Helper method to configure this feedback group to use RemoteCANdi forward limit switch on Signal 2 In...
constexpr HardwareLimitSwitchConfigs & WithReverseLimitEnable(bool newReverseLimitEnable)
Modifies this configuration's ReverseLimitEnable parameter and returns itself for method-chaining and...
Definition HardwareLimitSwitchConfigs.hpp:356
int ForwardLimitRemoteSensorID
Device ID of the remote device if using remote limit switch features for the forward limit switch.
Definition HardwareLimitSwitchConfigs.hpp:95
constexpr HardwareLimitSwitchConfigs & WithForwardLimitType(signals::ForwardLimitTypeValue newForwardLimitType)
Modifies this configuration's ForwardLimitType parameter and returns itself for method-chaining and e...
Definition HardwareLimitSwitchConfigs.hpp:170
signals::ReverseLimitSourceValue ReverseLimitSource
Determines where to poll the reverse limit switch.
Definition HardwareLimitSwitchConfigs.hpp:147
HardwareLimitSwitchConfigs & WithReverseLimitRemoteCANrange(const hardware::core::CoreCANrange &device)
Helper method to configure this feedback group to use the RemoteCANrange by passing in the CANrange o...
HardwareLimitSwitchConfigs & WithReverseLimitRemoteCANdiS2(const hardware::core::CoreCANdi &device)
Helper method to configure this feedback group to use RemoteCANdi reverse limit switch on Signal 2 In...
HardwareLimitSwitchConfigs & WithForwardLimitRemoteTalonFX(const hardware::traits::CommonTalon &device)
Helper method to configure this feedback group to use RemoteTalonFX forward limit switch by passing i...
constexpr HardwareLimitSwitchConfigs & WithReverseLimitRemoteSensorID(int newReverseLimitRemoteSensorID)
Modifies this configuration's ReverseLimitRemoteSensorID parameter and returns itself for method-chai...
Definition HardwareLimitSwitchConfigs.hpp:407
constexpr HardwareLimitSwitchConfigs & WithForwardLimitSource(signals::ForwardLimitSourceValue newForwardLimitSource)
Modifies this configuration's ForwardLimitSource parameter and returns itself for method-chaining and...
Definition HardwareLimitSwitchConfigs.hpp:259
HardwareLimitSwitchConfigs & WithReverseLimitRemoteCANdiS1(const hardware::core::CoreCANdi &device)
Helper method to configure this feedback group to use RemoteCANdi reverse limit switch on Signal 1 In...
HardwareLimitSwitchConfigs & WithForwardLimitRemoteCANcoder(const hardware::core::CoreCANcoder &device)
Helper method to configure this feedback group to use RemoteCANcoder forward limit switch by passing ...
bool ReverseLimitEnable
If enabled, motor output is set to neutral when reverse limit switch is asseted and negative output i...
Definition HardwareLimitSwitchConfigs.hpp:127
int ReverseLimitRemoteSensorID
Device ID of the remote device if using remote limit switch features for the reverse limit switch.
Definition HardwareLimitSwitchConfigs.hpp:157
Definition Configuration.hpp:17
Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along w...
Definition CoreCANcoder.hpp:602
Class for CTR Electronics' CANdi™ branded device, a device that integrates digital signals into the e...
Definition CoreCANdi.hpp:925
Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the distance to the front o...
Definition CoreCANrange.hpp:735
Contains everything common between Talon motor controllers.
Definition CommonTalon.hpp:26
Definition motor_constants.h:14
Determines where to poll the forward limit switch.
Definition SpnEnums.hpp:1931
static constexpr int LimitSwitchPin
Use the forward limit switch pin on the limit switch connector.
Definition SpnEnums.hpp:1937
Determines if the forward limit switch is normally-open (default) or normally-closed.
Definition SpnEnums.hpp:1869
static constexpr int NormallyOpen
Definition SpnEnums.hpp:1872
Determines where to poll the reverse limit switch.
Definition SpnEnums.hpp:2091
static constexpr int LimitSwitchPin
Use the reverse limit switch pin on the limit switch connector.
Definition SpnEnums.hpp:2097
Determines if the reverse limit switch is normally-open (default) or normally-closed.
Definition SpnEnums.hpp:2029
static constexpr int NormallyOpen
Definition SpnEnums.hpp:2032