CTRE Phoenix 6 C++ 26.0.0-beta-1
Loading...
Searching...
No Matches
SpnEnums.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
10#include "ctre/phoenix/export.h"
11#include <compare>
12#include <iosfwd>
13
14namespace ctre {
15namespace phoenix6 {
16namespace signals {
17
18
19/**
20 * \brief System state of the device.
21 */
23 int value;
24
25 static constexpr int Bootup_0 = 0;
26 static constexpr int Bootup_1 = 1;
27 static constexpr int Bootup_2 = 2;
28 static constexpr int Bootup_3 = 3;
29 static constexpr int Bootup_4 = 4;
30 static constexpr int Bootup_5 = 5;
31 static constexpr int Bootup_6 = 6;
32 static constexpr int Bootup_7 = 7;
33 static constexpr int BootBeep = 8;
34 static constexpr int ControlDisabled = 9;
35 static constexpr int ControlEnabled = 10;
36 static constexpr int ControlEnabled_11 = 11;
37 static constexpr int Fault = 12;
38 static constexpr int Recover = 13;
39 static constexpr int NotLicensed = 14;
40 static constexpr int Production = 15;
41
42 constexpr System_StateValue(int value) :
44 {}
45
46 constexpr System_StateValue() :
47 value{-1}
48 {}
49
50 constexpr bool operator==(System_StateValue other) const
51 {
52 return value == other.value;
53 }
54 constexpr auto operator<=>(System_StateValue other) const
55 {
56 return value <=> other.value;
57 }
58
59 /**
60 * \brief Gets the string representation of this enum
61 *
62 * \returns String representation of this enum
63 */
64 constexpr std::string_view ToString() const
65 {
66 switch (value) {
67 case System_StateValue::Bootup_0: return "Bootup_0";
68 case System_StateValue::Bootup_1: return "Bootup_1";
69 case System_StateValue::Bootup_2: return "Bootup_2";
70 case System_StateValue::Bootup_3: return "Bootup_3";
71 case System_StateValue::Bootup_4: return "Bootup_4";
72 case System_StateValue::Bootup_5: return "Bootup_5";
73 case System_StateValue::Bootup_6: return "Bootup_6";
74 case System_StateValue::Bootup_7: return "Bootup_7";
75 case System_StateValue::BootBeep: return "BootBeep";
76 case System_StateValue::ControlDisabled: return "ControlDisabled";
77 case System_StateValue::ControlEnabled: return "ControlEnabled";
78 case System_StateValue::ControlEnabled_11: return "ControlEnabled_11";
79 case System_StateValue::Fault: return "Fault";
80 case System_StateValue::Recover: return "Recover";
81 case System_StateValue::NotLicensed: return "NotLicensed";
82 case System_StateValue::Production: return "Production";
83 default: return "Invalid Value";
84 }
85 }
86
87 CTREXPORT friend std::ostream &operator<<(std::ostream &os, System_StateValue data);
88
89 std::string Serialize() const override
90 {
91 return "u_" + std::to_string(this->value);
92 }
93};
94
95/**
96 * \brief Whether the device is Pro licensed.
97 */
99 int value;
100
101 static constexpr int NotLicensed = 0;
102 static constexpr int Licensed = 1;
103
104 constexpr IsPROLicensedValue(int value) :
105 value{value}
106 {}
107
108 constexpr IsPROLicensedValue() :
109 value{-1}
110 {}
111
112 constexpr bool operator==(IsPROLicensedValue other) const
113 {
114 return value == other.value;
115 }
116 constexpr auto operator<=>(IsPROLicensedValue other) const
117 {
118 return value <=> other.value;
119 }
120
121 /**
122 * \brief Gets the string representation of this enum
123 *
124 * \returns String representation of this enum
125 */
126 constexpr std::string_view ToString() const
127 {
128 switch (value) {
129 case IsPROLicensedValue::NotLicensed: return "Not Licensed";
130 case IsPROLicensedValue::Licensed: return "Licensed";
131 default: return "Invalid Value";
132 }
133 }
134
135 CTREXPORT friend std::ostream &operator<<(std::ostream &os, IsPROLicensedValue data);
136
137 std::string Serialize() const override
138 {
139 return "u_" + std::to_string(this->value);
140 }
141};
142
143/**
144 * \brief Whether the device is Season Pass licensed.
145 */
147 int value;
148
149 static constexpr int NotLicensed = 0;
150 static constexpr int Licensed = 1;
151
153 value{value}
154 {}
155
157 value{-1}
158 {}
159
160 constexpr bool operator==(Licensing_IsSeasonPassedValue other) const
161 {
162 return value == other.value;
163 }
164 constexpr auto operator<=>(Licensing_IsSeasonPassedValue other) const
165 {
166 return value <=> other.value;
167 }
168
169 /**
170 * \brief Gets the string representation of this enum
171 *
172 * \returns String representation of this enum
173 */
174 constexpr std::string_view ToString() const
175 {
176 switch (value) {
177 case Licensing_IsSeasonPassedValue::NotLicensed: return "Not Licensed";
178 case Licensing_IsSeasonPassedValue::Licensed: return "Licensed";
179 default: return "Invalid Value";
180 }
181 }
182
183 CTREXPORT friend std::ostream &operator<<(std::ostream &os, Licensing_IsSeasonPassedValue data);
184
185 std::string Serialize() const override
186 {
187 return "u_" + std::to_string(this->value);
188 }
189};
190
191/**
192 * \brief Direction of the sensor to determine positive rotation, as seen facing
193 * the LED side of the CANcoder.
194 */
196 int value;
197
198 /**
199 * \brief Counter-clockwise motion reports positive rotation.
200 */
201 static constexpr int CounterClockwise_Positive = 0;
202 /**
203 * \brief Clockwise motion reports positive rotation.
204 */
205 static constexpr int Clockwise_Positive = 1;
206
208 value{value}
209 {}
210
212 value{-1}
213 {}
214
215 constexpr bool operator==(SensorDirectionValue other) const
216 {
217 return value == other.value;
218 }
219 constexpr auto operator<=>(SensorDirectionValue other) const
220 {
221 return value <=> other.value;
222 }
223
224 /**
225 * \brief Gets the string representation of this enum
226 *
227 * \returns String representation of this enum
228 */
229 constexpr std::string_view ToString() const
230 {
231 switch (value) {
232 case SensorDirectionValue::CounterClockwise_Positive: return "CounterClockwise_Positive";
233 case SensorDirectionValue::Clockwise_Positive: return "Clockwise_Positive";
234 default: return "Invalid Value";
235 }
236 }
237
238 CTREXPORT friend std::ostream &operator<<(std::ostream &os, SensorDirectionValue data);
239
240 std::string Serialize() const override
241 {
242 return "u_" + std::to_string(this->value);
243 }
244};
245
246/**
247 * \brief Whether device is locked by FRC.
248 */
250 int value;
251
252 static constexpr int Frc_Locked = 1;
253 static constexpr int Frc_Unlocked = 0;
254
255 constexpr FrcLockValue(int value) :
256 value{value}
257 {}
258
259 constexpr FrcLockValue() :
260 value{-1}
261 {}
262
263 constexpr bool operator==(FrcLockValue other) const
264 {
265 return value == other.value;
266 }
267 constexpr auto operator<=>(FrcLockValue other) const
268 {
269 return value <=> other.value;
270 }
271
272 /**
273 * \brief Gets the string representation of this enum
274 *
275 * \returns String representation of this enum
276 */
277 constexpr std::string_view ToString() const
278 {
279 switch (value) {
280 case FrcLockValue::Frc_Locked: return "Frc_Locked";
281 case FrcLockValue::Frc_Unlocked: return "Frc_Unlocked";
282 default: return "Invalid Value";
283 }
284 }
285
286 CTREXPORT friend std::ostream &operator<<(std::ostream &os, FrcLockValue data);
287
288 std::string Serialize() const override
289 {
290 return "u_" + std::to_string(this->value);
291 }
292};
293
294/**
295 * \brief Whether the robot is enabled.
296 */
298 int value;
299
300 static constexpr int Enabled = 1;
301 static constexpr int Disabled = 0;
302
303 constexpr RobotEnableValue(int value) :
304 value{value}
305 {}
306
307 constexpr RobotEnableValue() :
308 value{-1}
309 {}
310
311 constexpr bool operator==(RobotEnableValue other) const
312 {
313 return value == other.value;
314 }
315 constexpr auto operator<=>(RobotEnableValue other) const
316 {
317 return value <=> other.value;
318 }
319
320 /**
321 * \brief Gets the string representation of this enum
322 *
323 * \returns String representation of this enum
324 */
325 constexpr std::string_view ToString() const
326 {
327 switch (value) {
328 case RobotEnableValue::Enabled: return "Enabled";
329 case RobotEnableValue::Disabled: return "Disabled";
330 default: return "Invalid Value";
331 }
332 }
333
334 CTREXPORT friend std::ostream &operator<<(std::ostream &os, RobotEnableValue data);
335
336 std::string Serialize() const override
337 {
338 return "u_" + std::to_string(this->value);
339 }
340};
341
342/**
343 * \brief The Color of LED1 when it's "On".
344 */
346 int value;
347
348 static constexpr int Off = 0;
349 static constexpr int Red = 1;
350 static constexpr int Green = 2;
351 static constexpr int Orange = 3;
352 static constexpr int Blue = 4;
353 static constexpr int Pink = 5;
354 static constexpr int Cyan = 6;
355 static constexpr int White = 7;
356
357 constexpr Led1OnColorValue(int value) :
358 value{value}
359 {}
360
361 constexpr Led1OnColorValue() :
362 value{-1}
363 {}
364
365 constexpr bool operator==(Led1OnColorValue other) const
366 {
367 return value == other.value;
368 }
369 constexpr auto operator<=>(Led1OnColorValue other) const
370 {
371 return value <=> other.value;
372 }
373
374 /**
375 * \brief Gets the string representation of this enum
376 *
377 * \returns String representation of this enum
378 */
379 constexpr std::string_view ToString() const
380 {
381 switch (value) {
382 case Led1OnColorValue::Off: return "Off";
383 case Led1OnColorValue::Red: return "Red";
384 case Led1OnColorValue::Green: return "Green";
385 case Led1OnColorValue::Orange: return "Orange";
386 case Led1OnColorValue::Blue: return "Blue";
387 case Led1OnColorValue::Pink: return "Pink";
388 case Led1OnColorValue::Cyan: return "Cyan";
389 case Led1OnColorValue::White: return "White";
390 default: return "Invalid Value";
391 }
392 }
393
394 CTREXPORT friend std::ostream &operator<<(std::ostream &os, Led1OnColorValue data);
395
396 std::string Serialize() const override
397 {
398 return "u_" + std::to_string(this->value);
399 }
400};
401
402/**
403 * \brief The Color of LED1 when it's "Off".
404 */
406 int value;
407
408 static constexpr int Off = 0;
409 static constexpr int Red = 1;
410 static constexpr int Green = 2;
411 static constexpr int Orange = 3;
412 static constexpr int Blue = 4;
413 static constexpr int Pink = 5;
414 static constexpr int Cyan = 6;
415 static constexpr int White = 7;
416
417 constexpr Led1OffColorValue(int value) :
418 value{value}
419 {}
420
421 constexpr Led1OffColorValue() :
422 value{-1}
423 {}
424
425 constexpr bool operator==(Led1OffColorValue other) const
426 {
427 return value == other.value;
428 }
429 constexpr auto operator<=>(Led1OffColorValue other) const
430 {
431 return value <=> other.value;
432 }
433
434 /**
435 * \brief Gets the string representation of this enum
436 *
437 * \returns String representation of this enum
438 */
439 constexpr std::string_view ToString() const
440 {
441 switch (value) {
442 case Led1OffColorValue::Off: return "Off";
443 case Led1OffColorValue::Red: return "Red";
444 case Led1OffColorValue::Green: return "Green";
445 case Led1OffColorValue::Orange: return "Orange";
446 case Led1OffColorValue::Blue: return "Blue";
447 case Led1OffColorValue::Pink: return "Pink";
448 case Led1OffColorValue::Cyan: return "Cyan";
449 case Led1OffColorValue::White: return "White";
450 default: return "Invalid Value";
451 }
452 }
453
454 CTREXPORT friend std::ostream &operator<<(std::ostream &os, Led1OffColorValue data);
455
456 std::string Serialize() const override
457 {
458 return "u_" + std::to_string(this->value);
459 }
460};
461
462/**
463 * \brief The Color of LED2 when it's "On".
464 */
466 int value;
467
468 static constexpr int Off = 0;
469 static constexpr int Red = 1;
470 static constexpr int Green = 2;
471 static constexpr int Orange = 3;
472 static constexpr int Blue = 4;
473 static constexpr int Pink = 5;
474 static constexpr int Cyan = 6;
475 static constexpr int White = 7;
476
477 constexpr Led2OnColorValue(int value) :
478 value{value}
479 {}
480
481 constexpr Led2OnColorValue() :
482 value{-1}
483 {}
484
485 constexpr bool operator==(Led2OnColorValue other) const
486 {
487 return value == other.value;
488 }
489 constexpr auto operator<=>(Led2OnColorValue other) const
490 {
491 return value <=> other.value;
492 }
493
494 /**
495 * \brief Gets the string representation of this enum
496 *
497 * \returns String representation of this enum
498 */
499 constexpr std::string_view ToString() const
500 {
501 switch (value) {
502 case Led2OnColorValue::Off: return "Off";
503 case Led2OnColorValue::Red: return "Red";
504 case Led2OnColorValue::Green: return "Green";
505 case Led2OnColorValue::Orange: return "Orange";
506 case Led2OnColorValue::Blue: return "Blue";
507 case Led2OnColorValue::Pink: return "Pink";
508 case Led2OnColorValue::Cyan: return "Cyan";
509 case Led2OnColorValue::White: return "White";
510 default: return "Invalid Value";
511 }
512 }
513
514 CTREXPORT friend std::ostream &operator<<(std::ostream &os, Led2OnColorValue data);
515
516 std::string Serialize() const override
517 {
518 return "u_" + std::to_string(this->value);
519 }
520};
521
522/**
523 * \brief The Color of LED2 when it's "Off".
524 */
526 int value;
527
528 static constexpr int Off = 0;
529 static constexpr int Red = 1;
530 static constexpr int Green = 2;
531 static constexpr int Orange = 3;
532 static constexpr int Blue = 4;
533 static constexpr int Pink = 5;
534 static constexpr int Cyan = 6;
535 static constexpr int White = 7;
536
537 constexpr Led2OffColorValue(int value) :
538 value{value}
539 {}
540
541 constexpr Led2OffColorValue() :
542 value{-1}
543 {}
544
545 constexpr bool operator==(Led2OffColorValue other) const
546 {
547 return value == other.value;
548 }
549 constexpr auto operator<=>(Led2OffColorValue other) const
550 {
551 return value <=> other.value;
552 }
553
554 /**
555 * \brief Gets the string representation of this enum
556 *
557 * \returns String representation of this enum
558 */
559 constexpr std::string_view ToString() const
560 {
561 switch (value) {
562 case Led2OffColorValue::Off: return "Off";
563 case Led2OffColorValue::Red: return "Red";
564 case Led2OffColorValue::Green: return "Green";
565 case Led2OffColorValue::Orange: return "Orange";
566 case Led2OffColorValue::Blue: return "Blue";
567 case Led2OffColorValue::Pink: return "Pink";
568 case Led2OffColorValue::Cyan: return "Cyan";
569 case Led2OffColorValue::White: return "White";
570 default: return "Invalid Value";
571 }
572 }
573
574 CTREXPORT friend std::ostream &operator<<(std::ostream &os, Led2OffColorValue data);
575
576 std::string Serialize() const override
577 {
578 return "u_" + std::to_string(this->value);
579 }
580};
581
582/**
583 * \brief Whether the device is enabled.
584 */
586 int value;
587
588 static constexpr int Enabled = 1;
589 static constexpr int Disabled = 0;
590
591 constexpr DeviceEnableValue(int value) :
592 value{value}
593 {}
594
595 constexpr DeviceEnableValue() :
596 value{-1}
597 {}
598
599 constexpr bool operator==(DeviceEnableValue other) const
600 {
601 return value == other.value;
602 }
603 constexpr auto operator<=>(DeviceEnableValue other) const
604 {
605 return value <=> other.value;
606 }
607
608 /**
609 * \brief Gets the string representation of this enum
610 *
611 * \returns String representation of this enum
612 */
613 constexpr std::string_view ToString() const
614 {
615 switch (value) {
616 case DeviceEnableValue::Enabled: return "Enabled";
617 case DeviceEnableValue::Disabled: return "Disabled";
618 default: return "Invalid Value";
619 }
620 }
621
622 CTREXPORT friend std::ostream &operator<<(std::ostream &os, DeviceEnableValue data);
623
624 std::string Serialize() const override
625 {
626 return "u_" + std::to_string(this->value);
627 }
628};
629
630/**
631 * \brief Forward Limit Pin.
632 */
634 int value;
635
636 static constexpr int ClosedToGround = 0;
637 static constexpr int Open = 1;
638
639 constexpr ForwardLimitValue(int value) :
640 value{value}
641 {}
642
643 constexpr ForwardLimitValue() :
644 value{-1}
645 {}
646
647 constexpr bool operator==(ForwardLimitValue other) const
648 {
649 return value == other.value;
650 }
651 constexpr auto operator<=>(ForwardLimitValue other) const
652 {
653 return value <=> other.value;
654 }
655
656 /**
657 * \brief Gets the string representation of this enum
658 *
659 * \returns String representation of this enum
660 */
661 constexpr std::string_view ToString() const
662 {
663 switch (value) {
664 case ForwardLimitValue::ClosedToGround: return "Closed To Ground";
665 case ForwardLimitValue::Open: return "Open";
666 default: return "Invalid Value";
667 }
668 }
669
670 CTREXPORT friend std::ostream &operator<<(std::ostream &os, ForwardLimitValue data);
671
672 std::string Serialize() const override
673 {
674 return "u_" + std::to_string(this->value);
675 }
676};
677
678/**
679 * \brief Reverse Limit Pin.
680 */
682 int value;
683
684 static constexpr int ClosedToGround = 0;
685 static constexpr int Open = 1;
686
687 constexpr ReverseLimitValue(int value) :
688 value{value}
689 {}
690
691 constexpr ReverseLimitValue() :
692 value{-1}
693 {}
694
695 constexpr bool operator==(ReverseLimitValue other) const
696 {
697 return value == other.value;
698 }
699 constexpr auto operator<=>(ReverseLimitValue other) const
700 {
701 return value <=> other.value;
702 }
703
704 /**
705 * \brief Gets the string representation of this enum
706 *
707 * \returns String representation of this enum
708 */
709 constexpr std::string_view ToString() const
710 {
711 switch (value) {
712 case ReverseLimitValue::ClosedToGround: return "Closed To Ground";
713 case ReverseLimitValue::Open: return "Open";
714 default: return "Invalid Value";
715 }
716 }
717
718 CTREXPORT friend std::ostream &operator<<(std::ostream &os, ReverseLimitValue data);
719
720 std::string Serialize() const override
721 {
722 return "u_" + std::to_string(this->value);
723 }
724};
725
726/**
727 * \brief The applied rotor polarity as seen from the front of the motor. This
728 * typically is determined by the Inverted config, but can be overridden
729 * if using Follower features.
730 */
732 int value;
733
734 /**
735 * \brief Positive motor output results in counter-clockwise motion.
736 */
737 static constexpr int PositiveIsCounterClockwise = 0;
738 /**
739 * \brief Positive motor output results in clockwise motion.
740 */
741 static constexpr int PositiveIsClockwise = 1;
742
744 value{value}
745 {}
746
748 value{-1}
749 {}
750
751 constexpr bool operator==(AppliedRotorPolarityValue other) const
752 {
753 return value == other.value;
754 }
755 constexpr auto operator<=>(AppliedRotorPolarityValue other) const
756 {
757 return value <=> other.value;
758 }
759
760 /**
761 * \brief Gets the string representation of this enum
762 *
763 * \returns String representation of this enum
764 */
765 constexpr std::string_view ToString() const
766 {
767 switch (value) {
768 case AppliedRotorPolarityValue::PositiveIsCounterClockwise: return "PositiveIsCounterClockwise";
769 case AppliedRotorPolarityValue::PositiveIsClockwise: return "PositiveIsClockwise";
770 default: return "Invalid Value";
771 }
772 }
773
774 CTREXPORT friend std::ostream &operator<<(std::ostream &os, AppliedRotorPolarityValue data);
775
776 std::string Serialize() const override
777 {
778 return "u_" + std::to_string(this->value);
779 }
780};
781
782/**
783 * \brief The active control mode of the motor controller.
784 */
786 int value;
787
788 static constexpr int DisabledOutput = 0;
789 static constexpr int NeutralOut = 1;
790 static constexpr int StaticBrake = 2;
791 static constexpr int DutyCycleOut = 3;
792 static constexpr int PositionDutyCycle = 4;
793 static constexpr int VelocityDutyCycle = 5;
794 static constexpr int MotionMagicDutyCycle = 6;
795 static constexpr int DutyCycleFOC = 7;
796 static constexpr int PositionDutyCycleFOC = 8;
797 static constexpr int VelocityDutyCycleFOC = 9;
798 static constexpr int MotionMagicDutyCycleFOC = 10;
799 static constexpr int VoltageOut = 11;
800 static constexpr int PositionVoltage = 12;
801 static constexpr int VelocityVoltage = 13;
802 static constexpr int MotionMagicVoltage = 14;
803 static constexpr int VoltageFOC = 15;
804 static constexpr int PositionVoltageFOC = 16;
805 static constexpr int VelocityVoltageFOC = 17;
806 static constexpr int MotionMagicVoltageFOC = 18;
807 static constexpr int TorqueCurrentFOC = 19;
808 static constexpr int PositionTorqueCurrentFOC = 20;
809 static constexpr int VelocityTorqueCurrentFOC = 21;
810 static constexpr int MotionMagicTorqueCurrentFOC = 22;
811 static constexpr int Follower = 23;
812 static constexpr int Reserved = 24;
813 static constexpr int CoastOut = 25;
814 static constexpr int UnauthorizedDevice = 26;
815 static constexpr int MusicTone = 27;
816 static constexpr int MotionMagicVelocityDutyCycle = 28;
817 static constexpr int MotionMagicVelocityDutyCycleFOC = 29;
818 static constexpr int MotionMagicVelocityVoltage = 30;
819 static constexpr int MotionMagicVelocityVoltageFOC = 31;
820 static constexpr int MotionMagicVelocityTorqueCurrentFOC = 32;
821 static constexpr int MotionMagicExpoDutyCycle = 33;
822 static constexpr int MotionMagicExpoDutyCycleFOC = 34;
823 static constexpr int MotionMagicExpoVoltage = 35;
824 static constexpr int MotionMagicExpoVoltageFOC = 36;
825 static constexpr int MotionMagicExpoTorqueCurrentFOC = 37;
826
827 constexpr ControlModeValue(int value) :
828 value{value}
829 {}
830
831 constexpr ControlModeValue() :
832 value{-1}
833 {}
834
835 constexpr bool operator==(ControlModeValue other) const
836 {
837 return value == other.value;
838 }
839 constexpr auto operator<=>(ControlModeValue other) const
840 {
841 return value <=> other.value;
842 }
843
844 /**
845 * \brief Gets the string representation of this enum
846 *
847 * \returns String representation of this enum
848 */
849 constexpr std::string_view ToString() const
850 {
851 switch (value) {
852 case ControlModeValue::DisabledOutput: return "DisabledOutput";
853 case ControlModeValue::NeutralOut: return "NeutralOut";
854 case ControlModeValue::StaticBrake: return "StaticBrake";
855 case ControlModeValue::DutyCycleOut: return "DutyCycleOut";
856 case ControlModeValue::PositionDutyCycle: return "PositionDutyCycle";
857 case ControlModeValue::VelocityDutyCycle: return "VelocityDutyCycle";
858 case ControlModeValue::MotionMagicDutyCycle: return "MotionMagicDutyCycle";
859 case ControlModeValue::DutyCycleFOC: return "DutyCycleFOC";
860 case ControlModeValue::PositionDutyCycleFOC: return "PositionDutyCycleFOC";
861 case ControlModeValue::VelocityDutyCycleFOC: return "VelocityDutyCycleFOC";
862 case ControlModeValue::MotionMagicDutyCycleFOC: return "MotionMagicDutyCycleFOC";
863 case ControlModeValue::VoltageOut: return "VoltageOut";
864 case ControlModeValue::PositionVoltage: return "PositionVoltage";
865 case ControlModeValue::VelocityVoltage: return "VelocityVoltage";
866 case ControlModeValue::MotionMagicVoltage: return "MotionMagicVoltage";
867 case ControlModeValue::VoltageFOC: return "VoltageFOC";
868 case ControlModeValue::PositionVoltageFOC: return "PositionVoltageFOC";
869 case ControlModeValue::VelocityVoltageFOC: return "VelocityVoltageFOC";
870 case ControlModeValue::MotionMagicVoltageFOC: return "MotionMagicVoltageFOC";
871 case ControlModeValue::TorqueCurrentFOC: return "TorqueCurrentFOC";
872 case ControlModeValue::PositionTorqueCurrentFOC: return "PositionTorqueCurrentFOC";
873 case ControlModeValue::VelocityTorqueCurrentFOC: return "VelocityTorqueCurrentFOC";
874 case ControlModeValue::MotionMagicTorqueCurrentFOC: return "MotionMagicTorqueCurrentFOC";
875 case ControlModeValue::Follower: return "Follower";
876 case ControlModeValue::Reserved: return "Reserved";
877 case ControlModeValue::CoastOut: return "CoastOut";
878 case ControlModeValue::UnauthorizedDevice: return "UnauthorizedDevice";
879 case ControlModeValue::MusicTone: return "MusicTone";
880 case ControlModeValue::MotionMagicVelocityDutyCycle: return "MotionMagicVelocityDutyCycle";
881 case ControlModeValue::MotionMagicVelocityDutyCycleFOC: return "MotionMagicVelocityDutyCycleFOC";
882 case ControlModeValue::MotionMagicVelocityVoltage: return "MotionMagicVelocityVoltage";
883 case ControlModeValue::MotionMagicVelocityVoltageFOC: return "MotionMagicVelocityVoltageFOC";
884 case ControlModeValue::MotionMagicVelocityTorqueCurrentFOC: return "MotionMagicVelocityTorqueCurrentFOC";
885 case ControlModeValue::MotionMagicExpoDutyCycle: return "MotionMagicExpoDutyCycle";
886 case ControlModeValue::MotionMagicExpoDutyCycleFOC: return "MotionMagicExpoDutyCycleFOC";
887 case ControlModeValue::MotionMagicExpoVoltage: return "MotionMagicExpoVoltage";
888 case ControlModeValue::MotionMagicExpoVoltageFOC: return "MotionMagicExpoVoltageFOC";
889 case ControlModeValue::MotionMagicExpoTorqueCurrentFOC: return "MotionMagicExpoTorqueCurrentFOC";
890 default: return "Invalid Value";
891 }
892 }
893
894 CTREXPORT friend std::ostream &operator<<(std::ostream &os, ControlModeValue data);
895
896 std::string Serialize() const override
897 {
898 return "u_" + std::to_string(this->value);
899 }
900};
901
902/**
903 * \brief Status of the temperature sensor of the external motor.
904 */
906 int value;
907
908 /**
909 * \brief Talon is collecting information on the sensor.
910 */
911 static constexpr int Collecting = 0;
912 /**
913 * \brief Temperature sensor appears to be disconnected.
914 */
915 static constexpr int Disconnected = 1;
916 /**
917 * \brief Temperature sensor is too hot to allow motor operation.
918 */
919 static constexpr int TooHot = 2;
920 /**
921 * \brief Temperature sensor is normal.
922 */
923 static constexpr int Normal = 3;
924 /**
925 * \brief Temperature sensor is present but is not used. Most likely the motor
926 * arrangement is brushed or disabled.
927 */
928 static constexpr int NotUsed = 4;
929 /**
930 * \brief Temperature sensor appears to be for the wrong motor arrangement, or
931 * signals are shorted.
932 */
933 static constexpr int WrongMotorOrShorted = 5;
934
936 value{value}
937 {}
938
940 value{-1}
941 {}
942
943 constexpr bool operator==(ExternalMotorTempStatusValue other) const
944 {
945 return value == other.value;
946 }
947 constexpr auto operator<=>(ExternalMotorTempStatusValue other) const
948 {
949 return value <=> other.value;
950 }
951
952 /**
953 * \brief Gets the string representation of this enum
954 *
955 * \returns String representation of this enum
956 */
957 constexpr std::string_view ToString() const
958 {
959 switch (value) {
960 case ExternalMotorTempStatusValue::Collecting: return "Collecting";
961 case ExternalMotorTempStatusValue::Disconnected: return "Disconnected";
962 case ExternalMotorTempStatusValue::TooHot: return "Too Hot";
963 case ExternalMotorTempStatusValue::Normal: return "Normal";
964 case ExternalMotorTempStatusValue::NotUsed: return "Not Used";
965 case ExternalMotorTempStatusValue::WrongMotorOrShorted: return "Wrong Motor Or Shorted";
966 default: return "Invalid Value";
967 }
968 }
969
970 CTREXPORT friend std::ostream &operator<<(std::ostream &os, ExternalMotorTempStatusValue data);
971
972 std::string Serialize() const override
973 {
974 return "u_" + std::to_string(this->value);
975 }
976};
977
978/**
979 * \brief Whether the closed-loop is running on position or velocity.
980 */
982 int value;
983
984 static constexpr int Position = 0;
985 static constexpr int Velocity = 1;
986
988 value{value}
989 {}
990
992 value{-1}
993 {}
994
996 {
997 return value == other.value;
998 }
1000 {
1001 return value <=> other.value;
1002 }
1003
1004 /**
1005 * \brief Gets the string representation of this enum
1006 *
1007 * \returns String representation of this enum
1008 */
1009 constexpr std::string_view ToString() const
1010 {
1011 switch (value) {
1012 case PIDRefPIDErr_ClosedLoopModeValue::Position: return "Position";
1013 case PIDRefPIDErr_ClosedLoopModeValue::Velocity: return "Velocity";
1014 default: return "Invalid Value";
1015 }
1016 }
1017
1018 CTREXPORT friend std::ostream &operator<<(std::ostream &os, PIDRefPIDErr_ClosedLoopModeValue data);
1019
1020 std::string Serialize() const override
1021 {
1022 return "u_" + std::to_string(this->value);
1023 }
1024};
1025
1026/**
1027 * \brief The output mode of the PID controller.
1028 */
1031
1032 static constexpr int DutyCycle = 0;
1033 static constexpr int Voltage = 1;
1034 static constexpr int TorqueCurrentFOC = 2;
1035
1037 value{value}
1038 {}
1039
1041 value{-1}
1042 {}
1043
1044 constexpr bool operator==(PIDOutput_PIDOutputModeValue other) const
1045 {
1046 return value == other.value;
1047 }
1048 constexpr auto operator<=>(PIDOutput_PIDOutputModeValue other) const
1049 {
1050 return value <=> other.value;
1051 }
1052
1053 /**
1054 * \brief Gets the string representation of this enum
1055 *
1056 * \returns String representation of this enum
1057 */
1058 constexpr std::string_view ToString() const
1059 {
1060 switch (value) {
1061 case PIDOutput_PIDOutputModeValue::DutyCycle: return "DutyCycle";
1062 case PIDOutput_PIDOutputModeValue::Voltage: return "Voltage";
1063 case PIDOutput_PIDOutputModeValue::TorqueCurrentFOC: return "TorqueCurrentFOC";
1064 default: return "Invalid Value";
1065 }
1066 }
1067
1068 CTREXPORT friend std::ostream &operator<<(std::ostream &os, PIDOutput_PIDOutputModeValue data);
1069
1070 std::string Serialize() const override
1071 {
1072 return "u_" + std::to_string(this->value);
1073 }
1074};
1075
1076/**
1077 * \brief Whether the closed-loop is running on position or velocity.
1078 */
1081
1082 static constexpr int Position = 0;
1083 static constexpr int Velocity = 1;
1084
1088
1090 value{-1}
1091 {}
1092
1094 {
1095 return value == other.value;
1096 }
1098 {
1099 return value <=> other.value;
1100 }
1101
1102 /**
1103 * \brief Gets the string representation of this enum
1104 *
1105 * \returns String representation of this enum
1106 */
1107 constexpr std::string_view ToString() const
1108 {
1109 switch (value) {
1112 default: return "Invalid Value";
1113 }
1114 }
1115
1116 CTREXPORT friend std::ostream &operator<<(std::ostream &os, PIDRefSlopeECUTime_ClosedLoopModeValue data);
1117
1118 std::string Serialize() const override
1119 {
1120 return "u_" + std::to_string(this->value);
1121 }
1122};
1123
1124/**
1125 * \brief Assess the status of the motor output with respect to load and supply.
1126 *
1127 * \details This routine can be used to determine the general status of motor
1128 * commutation.
1129 */
1132
1133 /**
1134 * \brief The status of motor output could not be determined.
1135 */
1136 static constexpr int Unknown = 0;
1137 /**
1138 * \brief Motor output is disabled.
1139 */
1140 static constexpr int Off = 1;
1141 /**
1142 * \brief The motor is in neutral-brake.
1143 */
1144 static constexpr int StaticBraking = 2;
1145 /**
1146 * \brief The motor is loaded in a typical fashion, drawing current from the
1147 * supply, and successfully turning the rotor in the direction of applied
1148 * voltage.
1149 */
1150 static constexpr int Motoring = 3;
1151 /**
1152 * \brief The same as Motoring, except the rotor is being backdriven as the
1153 * motor output is not enough to defeat load forces.
1154 */
1155 static constexpr int DiscordantMotoring = 4;
1156 /**
1157 * \brief The motor is braking in such a way where motor current is traveling
1158 * back to the supply (typically a battery).
1159 */
1160 static constexpr int RegenBraking = 5;
1161
1163 value{value}
1164 {}
1165
1167 value{-1}
1168 {}
1169
1170 constexpr bool operator==(MotorOutputStatusValue other) const
1171 {
1172 return value == other.value;
1173 }
1174 constexpr auto operator<=>(MotorOutputStatusValue other) const
1175 {
1176 return value <=> other.value;
1177 }
1178
1179 /**
1180 * \brief Gets the string representation of this enum
1181 *
1182 * \returns String representation of this enum
1183 */
1184 constexpr std::string_view ToString() const
1185 {
1186 switch (value) {
1187 case MotorOutputStatusValue::Unknown: return "Unknown";
1188 case MotorOutputStatusValue::Off: return "Off";
1189 case MotorOutputStatusValue::StaticBraking: return "StaticBraking";
1190 case MotorOutputStatusValue::Motoring: return "Motoring";
1191 case MotorOutputStatusValue::DiscordantMotoring: return "DiscordantMotoring";
1192 case MotorOutputStatusValue::RegenBraking: return "RegenBraking";
1193 default: return "Invalid Value";
1194 }
1195 }
1196
1197 CTREXPORT friend std::ostream &operator<<(std::ostream &os, MotorOutputStatusValue data);
1198
1199 std::string Serialize() const override
1200 {
1201 return "u_" + std::to_string(this->value);
1202 }
1203};
1204
1205/**
1206 * \brief The active control mode of the differential controller.
1207 */
1210
1211 static constexpr int DisabledOutput = 0;
1212 static constexpr int NeutralOut = 1;
1213 static constexpr int StaticBrake = 2;
1214 static constexpr int DutyCycleOut = 3;
1215 static constexpr int PositionDutyCycle = 4;
1216 static constexpr int VelocityDutyCycle = 5;
1217 static constexpr int MotionMagicDutyCycle = 6;
1218 static constexpr int DutyCycleFOC = 7;
1219 static constexpr int PositionDutyCycleFOC = 8;
1220 static constexpr int VelocityDutyCycleFOC = 9;
1221 static constexpr int MotionMagicDutyCycleFOC = 10;
1222 static constexpr int VoltageOut = 11;
1223 static constexpr int PositionVoltage = 12;
1224 static constexpr int VelocityVoltage = 13;
1225 static constexpr int MotionMagicVoltage = 14;
1226 static constexpr int VoltageFOC = 15;
1227 static constexpr int PositionVoltageFOC = 16;
1228 static constexpr int VelocityVoltageFOC = 17;
1229 static constexpr int MotionMagicVoltageFOC = 18;
1230 static constexpr int TorqueCurrentFOC = 19;
1231 static constexpr int PositionTorqueCurrentFOC = 20;
1232 static constexpr int VelocityTorqueCurrentFOC = 21;
1233 static constexpr int MotionMagicTorqueCurrentFOC = 22;
1234 static constexpr int Follower = 23;
1235 static constexpr int Reserved = 24;
1236 static constexpr int CoastOut = 25;
1237 static constexpr int UnauthorizedDevice = 26;
1238 static constexpr int MusicTone = 27;
1239 static constexpr int MotionMagicVelocityDutyCycle = 28;
1240 static constexpr int MotionMagicVelocityDutyCycleFOC = 29;
1241 static constexpr int MotionMagicVelocityVoltage = 30;
1242 static constexpr int MotionMagicVelocityVoltageFOC = 31;
1243 static constexpr int MotionMagicVelocityTorqueCurrentFOC = 32;
1244 static constexpr int MotionMagicExpoDutyCycle = 33;
1245 static constexpr int MotionMagicExpoDutyCycleFOC = 34;
1246 static constexpr int MotionMagicExpoVoltage = 35;
1247 static constexpr int MotionMagicExpoVoltageFOC = 36;
1248 static constexpr int MotionMagicExpoTorqueCurrentFOC = 37;
1249
1251 value{value}
1252 {}
1253
1255 value{-1}
1256 {}
1257
1258 constexpr bool operator==(DifferentialControlModeValue other) const
1259 {
1260 return value == other.value;
1261 }
1262 constexpr auto operator<=>(DifferentialControlModeValue other) const
1263 {
1264 return value <=> other.value;
1265 }
1266
1267 /**
1268 * \brief Gets the string representation of this enum
1269 *
1270 * \returns String representation of this enum
1271 */
1272 constexpr std::string_view ToString() const
1273 {
1274 switch (value) {
1275 case DifferentialControlModeValue::DisabledOutput: return "DisabledOutput";
1276 case DifferentialControlModeValue::NeutralOut: return "NeutralOut";
1277 case DifferentialControlModeValue::StaticBrake: return "StaticBrake";
1278 case DifferentialControlModeValue::DutyCycleOut: return "DutyCycleOut";
1279 case DifferentialControlModeValue::PositionDutyCycle: return "PositionDutyCycle";
1280 case DifferentialControlModeValue::VelocityDutyCycle: return "VelocityDutyCycle";
1281 case DifferentialControlModeValue::MotionMagicDutyCycle: return "MotionMagicDutyCycle";
1282 case DifferentialControlModeValue::DutyCycleFOC: return "DutyCycleFOC";
1283 case DifferentialControlModeValue::PositionDutyCycleFOC: return "PositionDutyCycleFOC";
1284 case DifferentialControlModeValue::VelocityDutyCycleFOC: return "VelocityDutyCycleFOC";
1285 case DifferentialControlModeValue::MotionMagicDutyCycleFOC: return "MotionMagicDutyCycleFOC";
1286 case DifferentialControlModeValue::VoltageOut: return "VoltageOut";
1287 case DifferentialControlModeValue::PositionVoltage: return "PositionVoltage";
1288 case DifferentialControlModeValue::VelocityVoltage: return "VelocityVoltage";
1289 case DifferentialControlModeValue::MotionMagicVoltage: return "MotionMagicVoltage";
1290 case DifferentialControlModeValue::VoltageFOC: return "VoltageFOC";
1291 case DifferentialControlModeValue::PositionVoltageFOC: return "PositionVoltageFOC";
1292 case DifferentialControlModeValue::VelocityVoltageFOC: return "VelocityVoltageFOC";
1293 case DifferentialControlModeValue::MotionMagicVoltageFOC: return "MotionMagicVoltageFOC";
1294 case DifferentialControlModeValue::TorqueCurrentFOC: return "TorqueCurrentFOC";
1295 case DifferentialControlModeValue::PositionTorqueCurrentFOC: return "PositionTorqueCurrentFOC";
1296 case DifferentialControlModeValue::VelocityTorqueCurrentFOC: return "VelocityTorqueCurrentFOC";
1297 case DifferentialControlModeValue::MotionMagicTorqueCurrentFOC: return "MotionMagicTorqueCurrentFOC";
1298 case DifferentialControlModeValue::Follower: return "Follower";
1299 case DifferentialControlModeValue::Reserved: return "Reserved";
1300 case DifferentialControlModeValue::CoastOut: return "CoastOut";
1301 case DifferentialControlModeValue::UnauthorizedDevice: return "UnauthorizedDevice";
1302 case DifferentialControlModeValue::MusicTone: return "MusicTone";
1303 case DifferentialControlModeValue::MotionMagicVelocityDutyCycle: return "MotionMagicVelocityDutyCycle";
1304 case DifferentialControlModeValue::MotionMagicVelocityDutyCycleFOC: return "MotionMagicVelocityDutyCycleFOC";
1305 case DifferentialControlModeValue::MotionMagicVelocityVoltage: return "MotionMagicVelocityVoltage";
1306 case DifferentialControlModeValue::MotionMagicVelocityVoltageFOC: return "MotionMagicVelocityVoltageFOC";
1307 case DifferentialControlModeValue::MotionMagicVelocityTorqueCurrentFOC: return "MotionMagicVelocityTorqueCurrentFOC";
1308 case DifferentialControlModeValue::MotionMagicExpoDutyCycle: return "MotionMagicExpoDutyCycle";
1309 case DifferentialControlModeValue::MotionMagicExpoDutyCycleFOC: return "MotionMagicExpoDutyCycleFOC";
1310 case DifferentialControlModeValue::MotionMagicExpoVoltage: return "MotionMagicExpoVoltage";
1311 case DifferentialControlModeValue::MotionMagicExpoVoltageFOC: return "MotionMagicExpoVoltageFOC";
1312 case DifferentialControlModeValue::MotionMagicExpoTorqueCurrentFOC: return "MotionMagicExpoTorqueCurrentFOC";
1313 default: return "Invalid Value";
1314 }
1315 }
1316
1317 CTREXPORT friend std::ostream &operator<<(std::ostream &os, DifferentialControlModeValue data);
1318
1319 std::string Serialize() const override
1320 {
1321 return "u_" + std::to_string(this->value);
1322 }
1323};
1324
1325/**
1326 * \brief Whether the closed-loop is running on position or velocity.
1327 */
1330
1331 static constexpr int Position = 0;
1332 static constexpr int Velocity = 1;
1333
1337
1339 value{-1}
1340 {}
1341
1343 {
1344 return value == other.value;
1345 }
1347 {
1348 return value <=> other.value;
1349 }
1350
1351 /**
1352 * \brief Gets the string representation of this enum
1353 *
1354 * \returns String representation of this enum
1355 */
1356 constexpr std::string_view ToString() const
1357 {
1358 switch (value) {
1359 case DiffPIDRefPIDErr_ClosedLoopModeValue::Position: return "Position";
1360 case DiffPIDRefPIDErr_ClosedLoopModeValue::Velocity: return "Velocity";
1361 default: return "Invalid Value";
1362 }
1363 }
1364
1365 CTREXPORT friend std::ostream &operator<<(std::ostream &os, DiffPIDRefPIDErr_ClosedLoopModeValue data);
1366
1367 std::string Serialize() const override
1368 {
1369 return "u_" + std::to_string(this->value);
1370 }
1371};
1372
1373/**
1374 * \brief The output mode of the differential PID controller.
1375 */
1378
1379 static constexpr int DutyCycle = 0;
1380 static constexpr int Voltage = 1;
1381 static constexpr int TorqueCurrentFOC = 2;
1382
1384 value{value}
1385 {}
1386
1388 value{-1}
1389 {}
1390
1392 {
1393 return value == other.value;
1394 }
1396 {
1397 return value <=> other.value;
1398 }
1399
1400 /**
1401 * \brief Gets the string representation of this enum
1402 *
1403 * \returns String representation of this enum
1404 */
1405 constexpr std::string_view ToString() const
1406 {
1407 switch (value) {
1408 case DiffPIDOutput_PIDOutputModeValue::DutyCycle: return "DutyCycle";
1409 case DiffPIDOutput_PIDOutputModeValue::Voltage: return "Voltage";
1410 case DiffPIDOutput_PIDOutputModeValue::TorqueCurrentFOC: return "TorqueCurrentFOC";
1411 default: return "Invalid Value";
1412 }
1413 }
1414
1415 CTREXPORT friend std::ostream &operator<<(std::ostream &os, DiffPIDOutput_PIDOutputModeValue data);
1416
1417 std::string Serialize() const override
1418 {
1419 return "u_" + std::to_string(this->value);
1420 }
1421};
1422
1423/**
1424 * \brief Whether the closed-loop is running on position or velocity.
1425 */
1428
1429 static constexpr int Position = 0;
1430 static constexpr int Velocity = 1;
1431
1435
1439
1441 {
1442 return value == other.value;
1443 }
1445 {
1446 return value <=> other.value;
1447 }
1448
1449 /**
1450 * \brief Gets the string representation of this enum
1451 *
1452 * \returns String representation of this enum
1453 */
1454 constexpr std::string_view ToString() const
1455 {
1456 switch (value) {
1459 default: return "Invalid Value";
1460 }
1461 }
1462
1463 CTREXPORT friend std::ostream &operator<<(std::ostream &os, DiffPIDRefSlopeECUTime_ClosedLoopModeValue data);
1464
1465 std::string Serialize() const override
1466 {
1467 return "u_" + std::to_string(this->value);
1468 }
1469};
1470
1471/**
1472 * \brief Gravity feedforward/feedback type.
1473 *
1474 * This determines the type of the gravity feedforward/feedback.
1475 *
1476 * Choose Elevator_Static for systems where the gravity feedforward is
1477 * constant, such as an elevator. The gravity feedforward output will
1478 * always have the same sign.
1479 *
1480 * Choose Arm_Cosine for systems where the gravity feedback is dependent
1481 * on the angular position of the mechanism, such as an arm. The gravity
1482 * feedback output will vary depending on the mechanism angular position.
1483 * Note that the sensor offset and ratios must be configured so that the
1484 * sensor reports a position of 0 when the mechanism is horizonal
1485 * (parallel to the ground), and the reported sensor position is 1:1 with
1486 * the mechanism.
1487 */
1490
1491 /**
1492 * \brief The system's gravity feedforward is constant, such as an elevator. The
1493 * gravity feedforward output will always have the same sign.
1494 */
1495 static constexpr int Elevator_Static = 0;
1496 /**
1497 * \brief The system's gravity feedback is dependent on the angular position of
1498 * the mechanism, such as an arm. The gravity feedback output will vary
1499 * depending on the mechanism angular position. Note that the sensor
1500 * offset and ratios must be configured so that the sensor reports a
1501 * position of 0 when the mechanism is horizonal (parallel to the
1502 * ground), and the reported sensor position is 1:1 with the mechanism.
1503 */
1504 static constexpr int Arm_Cosine = 1;
1505
1506 constexpr GravityTypeValue(int value) :
1507 value{value}
1508 {}
1509
1510 constexpr GravityTypeValue() :
1511 value{-1}
1512 {}
1513
1514 constexpr bool operator==(GravityTypeValue other) const
1515 {
1516 return value == other.value;
1517 }
1518 constexpr auto operator<=>(GravityTypeValue other) const
1519 {
1520 return value <=> other.value;
1521 }
1522
1523 /**
1524 * \brief Gets the string representation of this enum
1525 *
1526 * \returns String representation of this enum
1527 */
1528 constexpr std::string_view ToString() const
1529 {
1530 switch (value) {
1531 case GravityTypeValue::Elevator_Static: return "Elevator_Static";
1532 case GravityTypeValue::Arm_Cosine: return "Arm_Cosine";
1533 default: return "Invalid Value";
1534 }
1535 }
1536
1537 CTREXPORT friend std::ostream &operator<<(std::ostream &os, GravityTypeValue data);
1538
1539 std::string Serialize() const override
1540 {
1541 return "u_" + std::to_string(this->value);
1542 }
1543};
1544
1545/**
1546 * \brief Invert state of the device as seen from the front of the motor.
1547 */
1550
1551 /**
1552 * \brief Positive motor output results in counter-clockwise motion.
1553 */
1554 static constexpr int CounterClockwise_Positive = 0;
1555 /**
1556 * \brief Positive motor output results in clockwise motion.
1557 */
1558 static constexpr int Clockwise_Positive = 1;
1559
1560 constexpr InvertedValue(int value) :
1561 value{value}
1562 {}
1563
1564 constexpr InvertedValue() :
1565 value{-1}
1566 {}
1567
1568 constexpr bool operator==(InvertedValue other) const
1569 {
1570 return value == other.value;
1571 }
1572 constexpr auto operator<=>(InvertedValue other) const
1573 {
1574 return value <=> other.value;
1575 }
1576
1577 /**
1578 * \brief Gets the string representation of this enum
1579 *
1580 * \returns String representation of this enum
1581 */
1582 constexpr std::string_view ToString() const
1583 {
1584 switch (value) {
1585 case InvertedValue::CounterClockwise_Positive: return "CounterClockwise_Positive";
1586 case InvertedValue::Clockwise_Positive: return "Clockwise_Positive";
1587 default: return "Invalid Value";
1588 }
1589 }
1590
1591 CTREXPORT friend std::ostream &operator<<(std::ostream &os, InvertedValue data);
1592
1593 std::string Serialize() const override
1594 {
1595 return "u_" + std::to_string(this->value);
1596 }
1597};
1598
1599/**
1600 * \brief The state of the motor controller bridge when output is neutral or
1601 * disabled.
1602 */
1605
1606 static constexpr int Coast = 0;
1607 static constexpr int Brake = 1;
1608
1609 constexpr NeutralModeValue(int value) :
1610 value{value}
1611 {}
1612
1613 constexpr NeutralModeValue() :
1614 value{-1}
1615 {}
1616
1617 constexpr bool operator==(NeutralModeValue other) const
1618 {
1619 return value == other.value;
1620 }
1621 constexpr auto operator<=>(NeutralModeValue other) const
1622 {
1623 return value <=> other.value;
1624 }
1625
1626 /**
1627 * \brief Gets the string representation of this enum
1628 *
1629 * \returns String representation of this enum
1630 */
1631 constexpr std::string_view ToString() const
1632 {
1633 switch (value) {
1634 case NeutralModeValue::Coast: return "Coast";
1635 case NeutralModeValue::Brake: return "Brake";
1636 default: return "Invalid Value";
1637 }
1638 }
1639
1640 CTREXPORT friend std::ostream &operator<<(std::ostream &os, NeutralModeValue data);
1641
1642 std::string Serialize() const override
1643 {
1644 return "u_" + std::to_string(this->value);
1645 }
1646};
1647
1648/**
1649 * \brief Choose what sensor source is reported via API and used by closed-loop
1650 * and limit features. The default is RotorSensor, which uses the
1651 * internal rotor sensor in the Talon.
1652 *
1653 * Choose Remote* to use another sensor on the same CAN bus (this also
1654 * requires setting FeedbackRemoteSensorID). Talon will update its
1655 * position and velocity whenever the remote sensor publishes its
1656 * information on CAN bus, and the Talon internal rotor will not be used.
1657 *
1658 * Choose Fused* (requires Phoenix Pro) and Talon will fuse another
1659 * sensor's information with the internal rotor, which provides the best
1660 * possible position and velocity for accuracy and bandwidth (this also
1661 * requires setting FeedbackRemoteSensorID). This was developed for
1662 * applications such as swerve-azimuth.
1663 *
1664 * Choose Sync* (requires Phoenix Pro) and Talon will synchronize its
1665 * internal rotor position against another sensor, then continue to use
1666 * the rotor sensor for closed loop control (this also requires setting
1667 * FeedbackRemoteSensorID). The Talon will report if its internal
1668 * position differs significantly from the reported remote sensor
1669 * position. This was developed for mechanisms where there is a risk of
1670 * the sensor failing in such a way that it reports a position that does
1671 * not match the mechanism, such as the sensor mounting assembly breaking
1672 * off.
1673 *
1674 * Choose RemotePigeon2Yaw, RemotePigeon2Pitch, and RemotePigeon2Roll to
1675 * use another Pigeon2 on the same CAN bus (this also requires setting
1676 * FeedbackRemoteSensorID). Talon will update its position to match the
1677 * selected value whenever Pigeon2 publishes its information on CAN bus.
1678 * Note that the Talon position will be in rotations and not degrees.
1679 *
1680 * \details Note: When the feedback source is changed to Fused* or Sync*, the
1681 * Talon needs a period of time to fuse before sensor-based
1682 * (soft-limit, closed loop, etc.) features are used. This period of
1683 * time is determined by the update frequency of the remote sensor's
1684 * Position signal.
1685 */
1688
1689 /**
1690 * \brief Use the internal rotor sensor in the Talon.
1691 */
1692 static constexpr int RotorSensor = 0;
1693 /**
1694 * \brief Use another CANcoder on the same CAN bus (this also requires setting
1695 * FeedbackRemoteSensorID). Talon will update its position and velocity
1696 * whenever CANcoder publishes its information on CAN bus, and the Talon
1697 * internal rotor will not be used.
1698 */
1699 static constexpr int RemoteCANcoder = 1;
1700 /**
1701 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
1702 * FeedbackRemoteSensorID). Talon will update its position to match the
1703 * Pigeon2 yaw whenever Pigeon2 publishes its information on CAN bus.
1704 * Note that the Talon position will be in rotations and not degrees.
1705 */
1706 static constexpr int RemotePigeon2Yaw = 2;
1707 /**
1708 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
1709 * FeedbackRemoteSensorID). Talon will update its position to match the
1710 * Pigeon2 pitch whenever Pigeon2 publishes its information on CAN bus.
1711 * Note that the Talon position will be in rotations and not degrees.
1712 */
1713 static constexpr int RemotePigeon2Pitch = 3;
1714 /**
1715 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
1716 * FeedbackRemoteSensorID). Talon will update its position to match the
1717 * Pigeon2 roll whenever Pigeon2 publishes its information on CAN bus.
1718 * Note that the Talon position will be in rotations and not degrees.
1719 */
1720 static constexpr int RemotePigeon2Roll = 4;
1721 /**
1722 * \brief Requires Phoenix Pro; Talon will fuse another CANcoder's information
1723 * with the internal rotor, which provides the best possible position and
1724 * velocity for accuracy and bandwidth (this also requires setting
1725 * FeedbackRemoteSensorID). FusedCANcoder was developed for applications
1726 * such as swerve-azimuth.
1727 */
1728 static constexpr int FusedCANcoder = 5;
1729 /**
1730 * \brief Requires Phoenix Pro; Talon will synchronize its internal rotor
1731 * position against another CANcoder, then continue to use the rotor
1732 * sensor for closed loop control (this also requires setting
1733 * FeedbackRemoteSensorID). The Talon will report if its internal
1734 * position differs significantly from the reported CANcoder position.
1735 * SyncCANcoder was developed for mechanisms where there is a risk of the
1736 * CANcoder failing in such a way that it reports a position that does
1737 * not match the mechanism, such as the sensor mounting assembly breaking
1738 * off.
1739 */
1740 static constexpr int SyncCANcoder = 6;
1741 /**
1742 * \brief Use a pulse-width encoder remotely attached to the Sensor Input 1
1743 * (S1IN) on the CTR Electronics' CANdi™ (this also requires setting
1744 * FeedbackRemoteSensorID). Talon will update its position and velocity
1745 * whenever the CTR Electronics' CANdi™ publishes its information on CAN
1746 * bus, and the Talon internal rotor will not be used.
1747 */
1748 static constexpr int RemoteCANdiPWM1 = 9;
1749 /**
1750 * \brief Use a pulse-width encoder remotely attached to the Sensor Input 2
1751 * (S2IN) on the CTR Electronics' CANdi™ (this also requires setting
1752 * FeedbackRemoteSensorID). Talon will update its position and velocity
1753 * whenever the CTR Electronics' CANdi™ publishes its information on CAN
1754 * bus, and the Talon internal rotor will not be used.
1755 */
1756 static constexpr int RemoteCANdiPWM2 = 10;
1757 /**
1758 * \brief Use a quadrature encoder remotely attached to the two Sensor Inputs on
1759 * the CTR Electronics' CANdi™ (this also requires setting
1760 * FeedbackRemoteSensorID). Talon will update its position and velocity
1761 * whenever the CTR Electronics' CANdi™ publishes its information on CAN
1762 * bus, and the Talon internal rotor will not be used.
1763 */
1764 static constexpr int RemoteCANdiQuadrature = 11;
1765 /**
1766 * \brief Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely
1767 * attached to the Sensor Input 1 (S1IN) on the CTR Electronics' CANdi™,
1768 * which provides the best possible position and velocity for accuracy
1769 * and bandwidth (this also requires setting FeedbackRemoteSensorID).
1770 * FusedCANdi was developed for applications such as swerve-azimuth.
1771 */
1772 static constexpr int FusedCANdiPWM1 = 12;
1773 /**
1774 * \brief Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely
1775 * attached to the Sensor Input 2 (S2IN) on the CTR Electronics' CANdi™,
1776 * which provides the best possible position and velocity for accuracy
1777 * and bandwidth (this also requires setting FeedbackRemoteSensorID).
1778 * FusedCANdi was developed for applications such as swerve-azimuth.
1779 */
1780 static constexpr int FusedCANdiPWM2 = 13;
1781 /**
1782 * \brief Requires Phoenix Pro; Talon will fuse a qaudrature encoder remotely
1783 * attached to the two Sensor Inputs on the CTR Electronics' CANdi™. This
1784 * provides velocity and relative position measurements. This also
1785 * requires setting FeedbackRemoteSensorID.
1786 */
1787 static constexpr int FusedCANdiQuadrature = 14;
1788 /**
1789 * \brief Requires Phoenix Pro; Talon will synchronize its internal rotor
1790 * position against the pulse-width encoder attached to Sensor Input 1
1791 * (S1IN), then continue to use the rotor sensor for closed loop control
1792 * (this also requires setting FeedbackRemoteSensorID). The Talon will
1793 * report if its internal position differs significantly from the
1794 * reported PWM position. SyncCANdi was developed for mechanisms where
1795 * there is a risk of the CTR Electronics' CANdi™ failing in such a way
1796 * that it reports a position that does not match the mechanism, such as
1797 * the sensor mounting assembly breaking off.
1798 */
1799 static constexpr int SyncCANdiPWM1 = 15;
1800 /**
1801 * \brief Requires Phoenix Pro; Talon will synchronize its internal rotor
1802 * position against the pulse-width encoder attached to Sensor Input 1
1803 * (S1IN), then continue to use the rotor sensor for closed loop control
1804 * (this also requires setting FeedbackRemoteSensorID). The Talon will
1805 * report if its internal position differs significantly from the
1806 * reported PWM position. SyncCANdi was developed for mechanisms where
1807 * there is a risk of the CTR Electronics' CANdi™ failing in such a way
1808 * that it reports a position that does not match the mechanism, such as
1809 * the sensor mounting assembly breaking off.
1810 */
1811 static constexpr int SyncCANdiPWM2 = 16;
1812
1814 value{value}
1815 {}
1816
1818 value{-1}
1819 {}
1820
1821 constexpr bool operator==(FeedbackSensorSourceValue other) const
1822 {
1823 return value == other.value;
1824 }
1825 constexpr auto operator<=>(FeedbackSensorSourceValue other) const
1826 {
1827 return value <=> other.value;
1828 }
1829
1830 /**
1831 * \brief Gets the string representation of this enum
1832 *
1833 * \returns String representation of this enum
1834 */
1835 constexpr std::string_view ToString() const
1836 {
1837 switch (value) {
1838 case FeedbackSensorSourceValue::RotorSensor: return "RotorSensor";
1839 case FeedbackSensorSourceValue::RemoteCANcoder: return "RemoteCANcoder";
1840 case FeedbackSensorSourceValue::RemotePigeon2Yaw: return "RemotePigeon2Yaw";
1841 case FeedbackSensorSourceValue::RemotePigeon2Pitch: return "RemotePigeon2Pitch";
1842 case FeedbackSensorSourceValue::RemotePigeon2Roll: return "RemotePigeon2Roll";
1843 case FeedbackSensorSourceValue::FusedCANcoder: return "FusedCANcoder";
1844 case FeedbackSensorSourceValue::SyncCANcoder: return "SyncCANcoder";
1845 case FeedbackSensorSourceValue::RemoteCANdiPWM1: return "RemoteCANdiPWM1";
1846 case FeedbackSensorSourceValue::RemoteCANdiPWM2: return "RemoteCANdiPWM2";
1847 case FeedbackSensorSourceValue::RemoteCANdiQuadrature: return "RemoteCANdiQuadrature";
1848 case FeedbackSensorSourceValue::FusedCANdiPWM1: return "FusedCANdiPWM1";
1849 case FeedbackSensorSourceValue::FusedCANdiPWM2: return "FusedCANdiPWM2";
1850 case FeedbackSensorSourceValue::FusedCANdiQuadrature: return "FusedCANdiQuadrature";
1851 case FeedbackSensorSourceValue::SyncCANdiPWM1: return "SyncCANdiPWM1";
1852 case FeedbackSensorSourceValue::SyncCANdiPWM2: return "SyncCANdiPWM2";
1853 default: return "Invalid Value";
1854 }
1855 }
1856
1857 CTREXPORT friend std::ostream &operator<<(std::ostream &os, FeedbackSensorSourceValue data);
1858
1859 std::string Serialize() const override
1860 {
1861 return "u_" + std::to_string(this->value);
1862 }
1863};
1864
1865/**
1866 * \brief Determines if the forward limit switch is normally-open (default) or
1867 * normally-closed.
1868 */
1871
1872 static constexpr int NormallyOpen = 0;
1873 static constexpr int NormallyClosed = 1;
1874
1876 value{value}
1877 {}
1878
1880 value{-1}
1881 {}
1882
1883 constexpr bool operator==(ForwardLimitTypeValue other) const
1884 {
1885 return value == other.value;
1886 }
1887 constexpr auto operator<=>(ForwardLimitTypeValue other) const
1888 {
1889 return value <=> other.value;
1890 }
1891
1892 /**
1893 * \brief Gets the string representation of this enum
1894 *
1895 * \returns String representation of this enum
1896 */
1897 constexpr std::string_view ToString() const
1898 {
1899 switch (value) {
1900 case ForwardLimitTypeValue::NormallyOpen: return "NormallyOpen";
1901 case ForwardLimitTypeValue::NormallyClosed: return "NormallyClosed";
1902 default: return "Invalid Value";
1903 }
1904 }
1905
1906 CTREXPORT friend std::ostream &operator<<(std::ostream &os, ForwardLimitTypeValue data);
1907
1908 std::string Serialize() const override
1909 {
1910 return "u_" + std::to_string(this->value);
1911 }
1912};
1913
1914/**
1915 * \brief Determines where to poll the forward limit switch. This defaults to
1916 * the forward limit switch pin on the limit switch connector.
1917 *
1918 * Choose RemoteTalonFX to use the forward limit switch attached to
1919 * another Talon FX on the same CAN bus (this also requires setting
1920 * ForwardLimitRemoteSensorID).
1921 *
1922 * Choose RemoteCANifier to use the forward limit switch attached to
1923 * another CANifier on the same CAN bus (this also requires setting
1924 * ForwardLimitRemoteSensorID).
1925 *
1926 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
1927 * (this also requires setting ForwardLimitRemoteSensorID). The forward
1928 * limit will assert when the CANcoder magnet strength changes from BAD
1929 * (red) to ADEQUATE (orange) or GOOD (green).
1930 */
1933
1934 /**
1935 * \brief Use the forward limit switch pin on the limit switch connector.
1936 */
1937 static constexpr int LimitSwitchPin = 0;
1938 /**
1939 * \brief Use the forward limit switch attached to another Talon FX on the same
1940 * CAN bus (this also requires setting ForwardLimitRemoteSensorID).
1941 */
1942 static constexpr int RemoteTalonFX = 1;
1943 /**
1944 * \brief Use the forward limit switch attached to another CANifier on the same
1945 * CAN bus (this also requires setting ForwardLimitRemoteSensorID).
1946 */
1947 static constexpr int RemoteCANifier = 2;
1948 /**
1949 * \brief Use another CANcoder on the same CAN bus (this also requires setting
1950 * ForwardLimitRemoteSensorID). The forward limit will assert when the
1951 * CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange)
1952 * or GOOD (green).
1953 */
1954 static constexpr int RemoteCANcoder = 4;
1955 /**
1956 * \brief Use another CANrange on the same CAN bus (this also requires setting
1957 * ForwardLimitRemoteSensorID). The forward limit will assert when the
1958 * CANrange proximity detect is tripped.
1959 */
1960 static constexpr int RemoteCANrange = 6;
1961 /**
1962 * \brief Use another CTR Electronics' CANdi™ on the same CAN bus (this also
1963 * requires setting ForwardLimitRemoteSensorID). The forward limit will
1964 * assert when the CTR Electronics' CANdi™ Signal 1 Input (S1IN) pin
1965 * matches the configured closed state.
1966 */
1967 static constexpr int RemoteCANdiS1 = 7;
1968 /**
1969 * \brief Use another CTR Electronics' CANdi™ on the same CAN bus (this also
1970 * requires setting ForwardLimitRemoteSensorID). The forward limit will
1971 * assert when the CTR Electronics' CANdi™ Signal 2 Input (S2IN) pin
1972 * matches the configured closed state.
1973 */
1974 static constexpr int RemoteCANdiS2 = 8;
1975 /**
1976 * \brief Disable the forward limit switch.
1977 */
1978 static constexpr int Disabled = 3;
1979
1981 value{value}
1982 {}
1983
1985 value{-1}
1986 {}
1987
1988 constexpr bool operator==(ForwardLimitSourceValue other) const
1989 {
1990 return value == other.value;
1991 }
1992 constexpr auto operator<=>(ForwardLimitSourceValue other) const
1993 {
1994 return value <=> other.value;
1995 }
1996
1997 /**
1998 * \brief Gets the string representation of this enum
1999 *
2000 * \returns String representation of this enum
2001 */
2002 constexpr std::string_view ToString() const
2003 {
2004 switch (value) {
2005 case ForwardLimitSourceValue::LimitSwitchPin: return "LimitSwitchPin";
2006 case ForwardLimitSourceValue::RemoteTalonFX: return "RemoteTalonFX";
2007 case ForwardLimitSourceValue::RemoteCANifier: return "RemoteCANifier";
2008 case ForwardLimitSourceValue::RemoteCANcoder: return "RemoteCANcoder";
2009 case ForwardLimitSourceValue::RemoteCANrange: return "RemoteCANrange";
2010 case ForwardLimitSourceValue::RemoteCANdiS1: return "RemoteCANdiS1";
2011 case ForwardLimitSourceValue::RemoteCANdiS2: return "RemoteCANdiS2";
2012 case ForwardLimitSourceValue::Disabled: return "Disabled";
2013 default: return "Invalid Value";
2014 }
2015 }
2016
2017 CTREXPORT friend std::ostream &operator<<(std::ostream &os, ForwardLimitSourceValue data);
2018
2019 std::string Serialize() const override
2020 {
2021 return "u_" + std::to_string(this->value);
2022 }
2023};
2024
2025/**
2026 * \brief Determines if the reverse limit switch is normally-open (default) or
2027 * normally-closed.
2028 */
2031
2032 static constexpr int NormallyOpen = 0;
2033 static constexpr int NormallyClosed = 1;
2034
2036 value{value}
2037 {}
2038
2040 value{-1}
2041 {}
2042
2043 constexpr bool operator==(ReverseLimitTypeValue other) const
2044 {
2045 return value == other.value;
2046 }
2047 constexpr auto operator<=>(ReverseLimitTypeValue other) const
2048 {
2049 return value <=> other.value;
2050 }
2051
2052 /**
2053 * \brief Gets the string representation of this enum
2054 *
2055 * \returns String representation of this enum
2056 */
2057 constexpr std::string_view ToString() const
2058 {
2059 switch (value) {
2060 case ReverseLimitTypeValue::NormallyOpen: return "NormallyOpen";
2061 case ReverseLimitTypeValue::NormallyClosed: return "NormallyClosed";
2062 default: return "Invalid Value";
2063 }
2064 }
2065
2066 CTREXPORT friend std::ostream &operator<<(std::ostream &os, ReverseLimitTypeValue data);
2067
2068 std::string Serialize() const override
2069 {
2070 return "u_" + std::to_string(this->value);
2071 }
2072};
2073
2074/**
2075 * \brief Determines where to poll the reverse limit switch. This defaults to
2076 * the reverse limit switch pin on the limit switch connector.
2077 *
2078 * Choose RemoteTalonFX to use the reverse limit switch attached to
2079 * another Talon FX on the same CAN bus (this also requires setting
2080 * ReverseLimitRemoteSensorID).
2081 *
2082 * Choose RemoteCANifier to use the reverse limit switch attached to
2083 * another CANifier on the same CAN bus (this also requires setting
2084 * ReverseLimitRemoteSensorID).
2085 *
2086 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
2087 * (this also requires setting ReverseLimitRemoteSensorID). The reverse
2088 * limit will assert when the CANcoder magnet strength changes from BAD
2089 * (red) to ADEQUATE (orange) or GOOD (green).
2090 */
2093
2094 /**
2095 * \brief Use the reverse limit switch pin on the limit switch connector.
2096 */
2097 static constexpr int LimitSwitchPin = 0;
2098 /**
2099 * \brief Use the reverse limit switch attached to another Talon FX on the same
2100 * CAN bus (this also requires setting ReverseLimitRemoteSensorID).
2101 */
2102 static constexpr int RemoteTalonFX = 1;
2103 /**
2104 * \brief Use the reverse limit switch attached to another CANifier on the same
2105 * CAN bus (this also requires setting ReverseLimitRemoteSensorID).
2106 */
2107 static constexpr int RemoteCANifier = 2;
2108 /**
2109 * \brief Use another CANcoder on the same CAN bus (this also requires setting
2110 * ReverseLimitRemoteSensorID). The reverse limit will assert when the
2111 * CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange)
2112 * or GOOD (green).
2113 */
2114 static constexpr int RemoteCANcoder = 4;
2115 /**
2116 * \brief Use another CANrange on the same CAN bus (this also requires setting
2117 * ReverseLimitRemoteSensorID). The reverse limit will assert when the
2118 * CANrange proximity detect is tripped.
2119 */
2120 static constexpr int RemoteCANrange = 6;
2121 /**
2122 * \brief Use another CTR Electronics' CANdi™ on the same CAN bus (this also
2123 * requires setting ForwardLimitRemoteSensorID). The forward limit will
2124 * assert when the CTR Electronics' CANdi™ Signal 1 Input (S1IN) pin
2125 * matches the configured closed state.
2126 */
2127 static constexpr int RemoteCANdiS1 = 7;
2128 /**
2129 * \brief Use another CTR Electronics' CANdi™ on the same CAN bus (this also
2130 * requires setting ForwardLimitRemoteSensorID). The forward limit will
2131 * assert when CANdi™ Signal 2 Input (S2IN) pin matches the configured
2132 * closed state.
2133 */
2134 static constexpr int RemoteCANdiS2 = 8;
2135 /**
2136 * \brief Disable the reverse limit switch.
2137 */
2138 static constexpr int Disabled = 3;
2139
2141 value{value}
2142 {}
2143
2145 value{-1}
2146 {}
2147
2148 constexpr bool operator==(ReverseLimitSourceValue other) const
2149 {
2150 return value == other.value;
2151 }
2152 constexpr auto operator<=>(ReverseLimitSourceValue other) const
2153 {
2154 return value <=> other.value;
2155 }
2156
2157 /**
2158 * \brief Gets the string representation of this enum
2159 *
2160 * \returns String representation of this enum
2161 */
2162 constexpr std::string_view ToString() const
2163 {
2164 switch (value) {
2165 case ReverseLimitSourceValue::LimitSwitchPin: return "LimitSwitchPin";
2166 case ReverseLimitSourceValue::RemoteTalonFX: return "RemoteTalonFX";
2167 case ReverseLimitSourceValue::RemoteCANifier: return "RemoteCANifier";
2168 case ReverseLimitSourceValue::RemoteCANcoder: return "RemoteCANcoder";
2169 case ReverseLimitSourceValue::RemoteCANrange: return "RemoteCANrange";
2170 case ReverseLimitSourceValue::RemoteCANdiS1: return "RemoteCANdiS1";
2171 case ReverseLimitSourceValue::RemoteCANdiS2: return "RemoteCANdiS2";
2172 case ReverseLimitSourceValue::Disabled: return "Disabled";
2173 default: return "Invalid Value";
2174 }
2175 }
2176
2177 CTREXPORT friend std::ostream &operator<<(std::ostream &os, ReverseLimitSourceValue data);
2178
2179 std::string Serialize() const override
2180 {
2181 return "u_" + std::to_string(this->value);
2182 }
2183};
2184
2185/**
2186 * \brief Magnet health as measured by CANcoder.
2187 *
2188 * Red indicates too close or too far, Orange is adequate but with
2189 * reduced accuracy, green is ideal. Invalid means the accuracy cannot be
2190 * determined.
2191 */
2194
2195 /**
2196 * \brief The magnet is too close or too far from the CANcoder.
2197 */
2198 static constexpr int Magnet_Red = 1;
2199 /**
2200 * \brief Magnet health is adequate but with reduced accuracy.
2201 */
2202 static constexpr int Magnet_Orange = 2;
2203 /**
2204 * \brief Magnet health is ideal.
2205 */
2206 static constexpr int Magnet_Green = 3;
2207 /**
2208 * \brief The accuracy cannot be determined.
2209 */
2210 static constexpr int Magnet_Invalid = 0;
2211
2212 constexpr MagnetHealthValue(int value) :
2213 value{value}
2214 {}
2215
2216 constexpr MagnetHealthValue() :
2217 value{-1}
2218 {}
2219
2220 constexpr bool operator==(MagnetHealthValue other) const
2221 {
2222 return value == other.value;
2223 }
2224 constexpr auto operator<=>(MagnetHealthValue other) const
2225 {
2226 return value <=> other.value;
2227 }
2228
2229 /**
2230 * \brief Gets the string representation of this enum
2231 *
2232 * \returns String representation of this enum
2233 */
2234 constexpr std::string_view ToString() const
2235 {
2236 switch (value) {
2237 case MagnetHealthValue::Magnet_Red: return "Magnet_Red";
2238 case MagnetHealthValue::Magnet_Orange: return "Magnet_Orange";
2239 case MagnetHealthValue::Magnet_Green: return "Magnet_Green";
2240 case MagnetHealthValue::Magnet_Invalid: return "Magnet_Invalid";
2241 default: return "Invalid Value";
2242 }
2243 }
2244
2245 CTREXPORT friend std::ostream &operator<<(std::ostream &os, MagnetHealthValue data);
2246
2247 std::string Serialize() const override
2248 {
2249 return "u_" + std::to_string(this->value);
2250 }
2251};
2252
2253/**
2254 * \brief The applied output of the bridge.
2255 */
2258
2259 static constexpr int BridgeReq_Coast = 0;
2260 static constexpr int BridgeReq_Brake = 1;
2261 static constexpr int BridgeReq_Trapez = 6;
2262 static constexpr int BridgeReq_FOCTorque = 7;
2263 static constexpr int BridgeReq_MusicTone = 8;
2264 static constexpr int BridgeReq_FOCEasy = 9;
2265 static constexpr int BridgeReq_FaultBrake = 12;
2266 static constexpr int BridgeReq_FaultCoast = 13;
2267 static constexpr int BridgeReq_ActiveBrake = 14;
2268 static constexpr int BridgeReq_VariableBrake = 15;
2269
2270 constexpr BridgeOutputValue(int value) :
2271 value{value}
2272 {}
2273
2274 constexpr BridgeOutputValue() :
2275 value{-1}
2276 {}
2277
2278 constexpr bool operator==(BridgeOutputValue other) const
2279 {
2280 return value == other.value;
2281 }
2282 constexpr auto operator<=>(BridgeOutputValue other) const
2283 {
2284 return value <=> other.value;
2285 }
2286
2287 /**
2288 * \brief Gets the string representation of this enum
2289 *
2290 * \returns String representation of this enum
2291 */
2292 constexpr std::string_view ToString() const
2293 {
2294 switch (value) {
2295 case BridgeOutputValue::BridgeReq_Coast: return "BridgeReq_Coast";
2296 case BridgeOutputValue::BridgeReq_Brake: return "BridgeReq_Brake";
2297 case BridgeOutputValue::BridgeReq_Trapez: return "BridgeReq_Trapez";
2298 case BridgeOutputValue::BridgeReq_FOCTorque: return "BridgeReq_FOCTorque";
2299 case BridgeOutputValue::BridgeReq_MusicTone: return "BridgeReq_MusicTone";
2300 case BridgeOutputValue::BridgeReq_FOCEasy: return "BridgeReq_FOCEasy";
2301 case BridgeOutputValue::BridgeReq_FaultBrake: return "BridgeReq_FaultBrake";
2302 case BridgeOutputValue::BridgeReq_FaultCoast: return "BridgeReq_FaultCoast";
2303 case BridgeOutputValue::BridgeReq_ActiveBrake: return "BridgeReq_ActiveBrake";
2304 case BridgeOutputValue::BridgeReq_VariableBrake: return "BridgeReq_VariableBrake";
2305 default: return "Invalid Value";
2306 }
2307 }
2308
2309 CTREXPORT friend std::ostream &operator<<(std::ostream &os, BridgeOutputValue data);
2310
2311 std::string Serialize() const override
2312 {
2313 return "u_" + std::to_string(this->value);
2314 }
2315};
2316
2317/**
2318 * \brief Choose what sensor source is used for differential control of a
2319 * mechanism. The default is Disabled. All other options require
2320 * setting the DifferentialTalonFXSensorID, as the average of this Talon
2321 * FX's sensor and the remote TalonFX's sensor is used for the
2322 * differential controller's primary targets.
2323 *
2324 * Choose RemoteTalonFX_HalfDiff to use another TalonFX on the same CAN
2325 * bus. Talon FX will update its differential position and velocity
2326 * whenever the remote TalonFX publishes its information on CAN bus. The
2327 * differential controller will use half of the difference between this
2328 * TalonFX's sensor and the remote Talon FX's sensor for the differential
2329 * component of the output.
2330 *
2331 * Choose RemotePigeon2Yaw, RemotePigeon2Pitch, and RemotePigeon2Roll to
2332 * use another Pigeon2 on the same CAN bus (this also requires setting
2333 * DifferentialRemoteSensorID). Talon FX will update its differential
2334 * position to match the selected value whenever Pigeon2 publishes its
2335 * information on CAN bus. Note that the Talon FX differential position
2336 * will be in rotations and not degrees.
2337 *
2338 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
2339 * (this also requires setting DifferentialRemoteSensorID). Talon FX
2340 * will update its differential position and velocity to match the
2341 * CANcoder whenever CANcoder publishes its information on CAN bus.
2342 */
2345
2346 /**
2347 * \brief Disable differential control.
2348 */
2349 static constexpr int Disabled = 0;
2350 /**
2351 * \brief Use another TalonFX on the same CAN bus. Talon FX will update its
2352 * differential position and velocity whenever the remote TalonFX
2353 * publishes its information on CAN bus. The differential controller
2354 * will use half of the difference between this TalonFX's sensor and the
2355 * remote Talon FX's sensor for the differential component of the output.
2356 */
2357 static constexpr int RemoteTalonFX_HalfDiff = 1;
2358 /**
2359 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
2360 * DifferentialRemoteSensorID). Talon FX will update its differential
2361 * position to match the Pigeon2 yaw whenever Pigeon2 publishes its
2362 * information on CAN bus. Note that the Talon FX differential position
2363 * will be in rotations and not degrees.
2364 */
2365 static constexpr int RemotePigeon2Yaw = 2;
2366 /**
2367 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
2368 * DifferentialRemoteSensorID). Talon FX will update its differential
2369 * position to match the Pigeon2 pitch whenever Pigeon2 publishes its
2370 * information on CAN bus. Note that the Talon FX differential position
2371 * will be in rotations and not degrees.
2372 */
2373 static constexpr int RemotePigeon2Pitch = 3;
2374 /**
2375 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
2376 * DifferentialRemoteSensorID). Talon FX will update its differential
2377 * position to match the Pigeon2 roll whenever Pigeon2 publishes its
2378 * information on CAN bus. Note that the Talon FX differential position
2379 * will be in rotations and not degrees.
2380 */
2381 static constexpr int RemotePigeon2Roll = 4;
2382 /**
2383 * \brief Use another CANcoder on the same CAN bus (this also requires setting
2384 * DifferentialRemoteSensorID). Talon FX will update its differential
2385 * position and velocity to match the CANcoder whenever CANcoder
2386 * publishes its information on CAN bus.
2387 */
2388 static constexpr int RemoteCANcoder = 5;
2389 /**
2390 * \brief Use a pulse-width encoder remotely attached to the Sensor Input 1
2391 * (S1IN) on the CTR Electronics' CANdi™ (this also requires setting the
2392 * DifferentialRemoteSensorID). Talon FX will update its differential
2393 * position and velocity to match the CTR Electronics' CANdi™ whenever
2394 * the CTR Electronics' CANdi™ publishes its information on CAN bus.
2395 */
2396 static constexpr int RemoteCANdiPWM1 = 6;
2397 /**
2398 * \brief Use a pulse-width encoder remotely attached to the Sensor Input 2
2399 * (S2IN) on the CTR Electronics' CANdi™ (this also requires setting the
2400 * DifferentialRemoteSensorID). Talon FX will update its differential
2401 * position and velocity to match the CTR Electronics' CANdi™ whenever
2402 * the CTR Electronics' CANdi™ publishes its information on CAN bus.
2403 */
2404 static constexpr int RemoteCANdiPWM2 = 7;
2405 /**
2406 * \brief Use a quadrature encoder remotely attached to the two Sensor Inputs on
2407 * the CTR Electronics' CANdi™ (this also requires setting the
2408 * DifferentialRemoteSensorID). Talon FX will update its differential
2409 * position and velocity to match the CTR Electronics' CANdi™ whenever
2410 * the CTR Electronics' CANdi™ publishes its information on CAN bus.
2411 */
2412 static constexpr int RemoteCANdiQuadrature = 8;
2413
2415 value{value}
2416 {}
2417
2419 value{-1}
2420 {}
2421
2422 constexpr bool operator==(DifferentialSensorSourceValue other) const
2423 {
2424 return value == other.value;
2425 }
2426 constexpr auto operator<=>(DifferentialSensorSourceValue other) const
2427 {
2428 return value <=> other.value;
2429 }
2430
2431 /**
2432 * \brief Gets the string representation of this enum
2433 *
2434 * \returns String representation of this enum
2435 */
2436 constexpr std::string_view ToString() const
2437 {
2438 switch (value) {
2439 case DifferentialSensorSourceValue::Disabled: return "Disabled";
2440 case DifferentialSensorSourceValue::RemoteTalonFX_HalfDiff: return "RemoteTalonFX_HalfDiff";
2441 case DifferentialSensorSourceValue::RemotePigeon2Yaw: return "RemotePigeon2Yaw";
2442 case DifferentialSensorSourceValue::RemotePigeon2Pitch: return "RemotePigeon2Pitch";
2443 case DifferentialSensorSourceValue::RemotePigeon2Roll: return "RemotePigeon2Roll";
2444 case DifferentialSensorSourceValue::RemoteCANcoder: return "RemoteCANcoder";
2445 case DifferentialSensorSourceValue::RemoteCANdiPWM1: return "RemoteCANdiPWM1";
2446 case DifferentialSensorSourceValue::RemoteCANdiPWM2: return "RemoteCANdiPWM2";
2447 case DifferentialSensorSourceValue::RemoteCANdiQuadrature: return "RemoteCANdiQuadrature";
2448 default: return "Invalid Value";
2449 }
2450 }
2451
2452 CTREXPORT friend std::ostream &operator<<(std::ostream &os, DifferentialSensorSourceValue data);
2453
2454 std::string Serialize() const override
2455 {
2456 return "u_" + std::to_string(this->value);
2457 }
2458};
2459
2460/**
2461 * \brief Static feedforward sign during position closed loop.
2462 *
2463 * This determines the sign of the applied kS during position closed-loop
2464 * modes. The default behavior uses the velocity reference sign. This
2465 * works well with velocity closed loop, Motion Magic® controls, and
2466 * position closed loop when velocity reference is specified (motion
2467 * profiling).
2468 *
2469 * However, when using position closed loop with zero velocity reference
2470 * (no motion profiling), the application may want to apply static
2471 * feedforward based on the sign of closed loop error instead. When doing
2472 * so, we recommend using the minimal amount of kS, otherwise the motor
2473 * output may dither when closed loop error is near zero.
2474 */
2477
2478 /**
2479 * \brief Use the velocity reference sign. This works well with velocity closed
2480 * loop, Motion Magic® controls, and position closed loop when velocity
2481 * reference is specified (motion profiling).
2482 */
2483 static constexpr int UseVelocitySign = 0;
2484 /**
2485 * \brief Use the sign of closed loop error. This is useful when using position
2486 * closed loop with zero velocity reference (no motion profiling). We
2487 * recommend the minimal amount of kS, otherwise the motor output may
2488 * dither when closed loop error is near zero.
2489 */
2490 static constexpr int UseClosedLoopSign = 1;
2491
2493 value{value}
2494 {}
2495
2497 value{-1}
2498 {}
2499
2500 constexpr bool operator==(StaticFeedforwardSignValue other) const
2501 {
2502 return value == other.value;
2503 }
2504 constexpr auto operator<=>(StaticFeedforwardSignValue other) const
2505 {
2506 return value <=> other.value;
2507 }
2508
2509 /**
2510 * \brief Gets the string representation of this enum
2511 *
2512 * \returns String representation of this enum
2513 */
2514 constexpr std::string_view ToString() const
2515 {
2516 switch (value) {
2517 case StaticFeedforwardSignValue::UseVelocitySign: return "UseVelocitySign";
2518 case StaticFeedforwardSignValue::UseClosedLoopSign: return "UseClosedLoopSign";
2519 default: return "Invalid Value";
2520 }
2521 }
2522
2523 CTREXPORT friend std::ostream &operator<<(std::ostream &os, StaticFeedforwardSignValue data);
2524
2525 std::string Serialize() const override
2526 {
2527 return "u_" + std::to_string(this->value);
2528 }
2529};
2530
2531/**
2532 * \brief The type of motor attached to the Talon.
2533 *
2534 * \details This can be used to determine what motor is attached to the Talon
2535 * FX. Return will be "Unknown" if firmware is too old or device is
2536 * not present.
2537 */
2540
2541 /**
2542 * \brief Talon could not determine the type of motor attached.
2543 */
2544 static constexpr int Unknown = 0;
2545 /**
2546 * \brief Talon is attached to an integrated Falcon motor.
2547 */
2548 static constexpr int Falcon500_Integrated = 1;
2549 /**
2550 * \brief Talon is attached to an integrated Kraken X60 motor.
2551 */
2552 static constexpr int KrakenX60_Integrated = 2;
2553 /**
2554 * \brief Talon is attached to an integrated Kraken X44 motor.
2555 */
2556 static constexpr int KrakenX44_Integrated = 3;
2557 /**
2558 * \brief Talon is connected to a CTR Electronics Minion® brushless three phase
2559 * motor.
2560 */
2561 static constexpr int Minion_JST = 4;
2562 /**
2563 * \brief Talon is connected to a third party brushed DC motor with leads A and
2564 * B.
2565 */
2566 static constexpr int Brushed_AB = 5;
2567 /**
2568 * \brief Talon is connected to a third party brushed DC motor with leads A and
2569 * C.
2570 */
2571 static constexpr int Brushed_AC = 6;
2572 /**
2573 * \brief Talon is connected to a third party brushed DC motor with leads B and
2574 * C.
2575 */
2576 static constexpr int Brushed_BC = 7;
2577 /**
2578 * \brief Talon is connected to a third party NEO brushless three phase motor.
2579 */
2580 static constexpr int NEO_JST = 8;
2581 /**
2582 * \brief Talon is connected to a third party NEO550 brushless three phase
2583 * motor.
2584 */
2585 static constexpr int NEO550_JST = 9;
2586 /**
2587 * \brief Talon is connected to a third party VORTEX brushless three phase
2588 * motor.
2589 */
2590 static constexpr int VORTEX_JST = 10;
2591 /**
2592 * \brief Talon is connected to a custom brushless three phase motor. This
2593 * requires that the device is not FRC-Locked.
2594 */
2595 static constexpr int CustomBrushless = 11;
2596
2598 value{value}
2599 {}
2600
2602 value{-1}
2603 {}
2604
2605 constexpr bool operator==(ConnectedMotorValue other) const
2606 {
2607 return value == other.value;
2608 }
2609 constexpr auto operator<=>(ConnectedMotorValue other) const
2610 {
2611 return value <=> other.value;
2612 }
2613
2614 /**
2615 * \brief Gets the string representation of this enum
2616 *
2617 * \returns String representation of this enum
2618 */
2619 constexpr std::string_view ToString() const
2620 {
2621 switch (value) {
2622 case ConnectedMotorValue::Unknown: return "Unknown";
2623 case ConnectedMotorValue::Falcon500_Integrated: return "Falcon500_Integrated";
2624 case ConnectedMotorValue::KrakenX60_Integrated: return "KrakenX60_Integrated";
2625 case ConnectedMotorValue::KrakenX44_Integrated: return "KrakenX44_Integrated";
2626 case ConnectedMotorValue::Minion_JST: return "Minion_JST";
2627 case ConnectedMotorValue::Brushed_AB: return "Brushed_AB";
2628 case ConnectedMotorValue::Brushed_AC: return "Brushed_AC";
2629 case ConnectedMotorValue::Brushed_BC: return "Brushed_BC";
2630 case ConnectedMotorValue::NEO_JST: return "NEO_JST";
2631 case ConnectedMotorValue::NEO550_JST: return "NEO550_JST";
2632 case ConnectedMotorValue::VORTEX_JST: return "VORTEX_JST";
2633 case ConnectedMotorValue::CustomBrushless: return "Custom Brushless";
2634 default: return "Invalid Value";
2635 }
2636 }
2637
2638 CTREXPORT friend std::ostream &operator<<(std::ostream &os, ConnectedMotorValue data);
2639
2640 std::string Serialize() const override
2641 {
2642 return "u_" + std::to_string(this->value);
2643 }
2644};
2645
2646/**
2647 * \brief Health of the distance measurement.
2648 */
2651
2652 /**
2653 * \brief Measurement is good.
2654 */
2655 static constexpr int Good = 0;
2656 /**
2657 * \brief Measurement is likely okay, but the target is either very far away or
2658 * moving very quickly.
2659 */
2660 static constexpr int Limited = 1;
2661 /**
2662 * \brief Measurement is compromised.
2663 */
2664 static constexpr int Bad = 2;
2665
2667 value{value}
2668 {}
2669
2671 value{-1}
2672 {}
2673
2674 constexpr bool operator==(MeasurementHealthValue other) const
2675 {
2676 return value == other.value;
2677 }
2678 constexpr auto operator<=>(MeasurementHealthValue other) const
2679 {
2680 return value <=> other.value;
2681 }
2682
2683 /**
2684 * \brief Gets the string representation of this enum
2685 *
2686 * \returns String representation of this enum
2687 */
2688 constexpr std::string_view ToString() const
2689 {
2690 switch (value) {
2691 case MeasurementHealthValue::Good: return "Good";
2692 case MeasurementHealthValue::Limited: return "Limited";
2693 case MeasurementHealthValue::Bad: return "Bad";
2694 default: return "Invalid Value";
2695 }
2696 }
2697
2698 CTREXPORT friend std::ostream &operator<<(std::ostream &os, MeasurementHealthValue data);
2699
2700 std::string Serialize() const override
2701 {
2702 return "u_" + std::to_string(this->value);
2703 }
2704};
2705
2706/**
2707 * \brief Update mode of the CANrange. The CANrange supports short-range and
2708 * long-range detection at various update frequencies.
2709 */
2712
2713 /**
2714 * \brief Updates distance/proximity at 100hz using short-range detection mode.
2715 */
2716 static constexpr int ShortRange100Hz = 0;
2717 /**
2718 * \brief Uses short-range detection mode for improved detection under high
2719 * ambient infrared light conditions. Uses user-specified update
2720 * frequency.
2721 */
2722 static constexpr int ShortRangeUserFreq = 1;
2723 /**
2724 * \brief Uses long-range detection mode and user-specified update frequency.
2725 */
2726 static constexpr int LongRangeUserFreq = 2;
2727
2728 constexpr UpdateModeValue(int value) :
2729 value{value}
2730 {}
2731
2732 constexpr UpdateModeValue() :
2733 value{-1}
2734 {}
2735
2736 constexpr bool operator==(UpdateModeValue other) const
2737 {
2738 return value == other.value;
2739 }
2740 constexpr auto operator<=>(UpdateModeValue other) const
2741 {
2742 return value <=> other.value;
2743 }
2744
2745 /**
2746 * \brief Gets the string representation of this enum
2747 *
2748 * \returns String representation of this enum
2749 */
2750 constexpr std::string_view ToString() const
2751 {
2752 switch (value) {
2753 case UpdateModeValue::ShortRange100Hz: return "ShortRange100Hz";
2754 case UpdateModeValue::ShortRangeUserFreq: return "ShortRangeUserFreq";
2755 case UpdateModeValue::LongRangeUserFreq: return "LongRangeUserFreq";
2756 default: return "Invalid Value";
2757 }
2758 }
2759
2760 CTREXPORT friend std::ostream &operator<<(std::ostream &os, UpdateModeValue data);
2761
2762 std::string Serialize() const override
2763 {
2764 return "u_" + std::to_string(this->value);
2765 }
2766};
2767
2768/**
2769 * \brief Requires Phoenix Pro; Improves commutation and velocity measurement
2770 * for motors with hall sensors. Talon can use advanced features to
2771 * improve commutation and velocity measurement when using a motor with
2772 * hall sensors. This can improve peak efficiency by as high as 2% and
2773 * reduce noise in the measured velocity.
2774 */
2777
2778 /**
2779 * \brief Talon will utilize hall sensors without advanced features.
2780 */
2781 static constexpr int Disabled = 0;
2782 /**
2783 * \brief Requires Phoenix Pro; Talon uses advanced features to improve
2784 * commutation and velocity measurement when using hall sensors. This
2785 * can improve peak efficiency by as high as 2% and reduce noise in the
2786 * measured velocity.
2787 */
2788 static constexpr int Enabled = 1;
2789
2791 value{value}
2792 {}
2793
2795 value{-1}
2796 {}
2797
2798 constexpr bool operator==(AdvancedHallSupportValue other) const
2799 {
2800 return value == other.value;
2801 }
2802 constexpr auto operator<=>(AdvancedHallSupportValue other) const
2803 {
2804 return value <=> other.value;
2805 }
2806
2807 /**
2808 * \brief Gets the string representation of this enum
2809 *
2810 * \returns String representation of this enum
2811 */
2812 constexpr std::string_view ToString() const
2813 {
2814 switch (value) {
2815 case AdvancedHallSupportValue::Disabled: return "Disabled";
2816 case AdvancedHallSupportValue::Enabled: return "Enabled";
2817 default: return "Invalid Value";
2818 }
2819 }
2820
2821 CTREXPORT friend std::ostream &operator<<(std::ostream &os, AdvancedHallSupportValue data);
2822
2823 std::string Serialize() const override
2824 {
2825 return "u_" + std::to_string(this->value);
2826 }
2827};
2828
2829/**
2830 * \brief Selects the motor and motor connections used with Talon.
2831 *
2832 * This setting determines what kind of motor and sensors are used with
2833 * the Talon. This also determines what signals are used on the JST and
2834 * Gadgeteer port.
2835 *
2836 * Motor drive will not function correctly if this setting does not match
2837 * the physical setup.
2838 */
2841
2842 /**
2843 * \brief Motor is not selected. This is the default setting to ensure the user
2844 * has an opportunity to select the correct motor arrangement before
2845 * attempting to drive motor.
2846 */
2847 static constexpr int Disabled = 0;
2848 /**
2849 * \brief CTR Electronics Minion® brushless three phase motor.
2850 * Motor leads: red(terminal A), black (terminal B), and white (terminal
2851 * C).
2852 * JST Connector: hall [A, B, C] is on pins [4, 3, 2] and temperature is
2853 * on pin [5]. Motor JST cable can be plugged directly into the JST
2854 * connector.
2855 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
2856 * [forward, reverse] are on pins [4, 8], and pulse width position is on
2857 * pin [9].
2858 */
2859 static constexpr int Minion_JST = 1;
2860 /**
2861 * \brief Third party brushed DC motor with two leads.
2862 * Use the Brushed Motor Wiring config to determine which leads to use on
2863 * the Talon (motor leads may be flipped to correct for clockwise vs
2864 * counterclockwise).
2865 * Note that the invert configuration can still be used to invert rotor
2866 * orientation.
2867 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
2868 * [forward, reverse] are on pins [4, 8], and pulse width position is on
2869 * pin [9].
2870 */
2871 static constexpr int Brushed_DC = 2;
2872 /**
2873 * \brief Third party NEO brushless three phase motor (~6000 RPM at 12V).
2874 * Motor leads: red(terminal A), black (terminal B), and white (terminal
2875 * C).
2876 * JST Connector: hall [A, B, C] is on pins [4, 3, 2] and temperature is
2877 * on pin [5]. Motor JST cable can be plugged directly into the JST
2878 * connector.
2879 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
2880 * [forward, reverse] are on pins [4, 8], and pulse width position is on
2881 * pin [9].
2882 */
2883 static constexpr int NEO_JST = 5;
2884 /**
2885 * \brief Third party NEO550 brushless three phase motor (~11000 RPM at 12V).
2886 * Motor leads: red(terminal A), black (terminal B), and white (terminal
2887 * C).
2888 * JST Connector: hall [A, B, C] is on pins [4, 3, 2] and temperature is
2889 * on pin [5]. Motor JST cable can be plugged directly into the JST
2890 * connector.
2891 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
2892 * [forward, reverse] are on pins [4, 8], and pulse width position is on
2893 * pin [9].
2894 */
2895 static constexpr int NEO550_JST = 6;
2896 /**
2897 * \brief Third party VORTEX brushless three phase motor.
2898 * Motor leads: red(terminal A), black (terminal B), and white (terminal
2899 * C).
2900 * JST Connector: hall [A, B, C] is on pins [4, 3, 2] and temperature is
2901 * on pin [5]. Motor JST cable can be plugged directly into the JST
2902 * connector.
2903 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
2904 * [forward, reverse] are on pins [4, 8], and pulse width position is on
2905 * pin [9].
2906 */
2907 static constexpr int VORTEX_JST = 7;
2908 /**
2909 * \brief Third party custom brushless three phase motor.
2910 * This setting allows use of TalonFXS with motors that are not
2911 * explicitly supported above. Note that this requires user to set the
2912 * Custom Motor configuration parameters.
2913 * This setting will only work outside of the FRC use case. If selected
2914 * during FRC use, motor output will be neutral.
2915 * Motor leads: red(terminal A), black (terminal B), and white (terminal
2916 * C).
2917 * JST Connector: hall [A, B, C] is on pins [4, 3, 2] and temperature is
2918 * on pin [5]. Motor JST cable can be plugged directly into the JST
2919 * connector.
2920 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
2921 * [forward, reverse] are on pins [4, 8], and pulse width position is on
2922 * pin [9].
2923 */
2924 static constexpr int CustomBrushless = 8;
2925
2927 value{value}
2928 {}
2929
2931 value{-1}
2932 {}
2933
2934 constexpr bool operator==(MotorArrangementValue other) const
2935 {
2936 return value == other.value;
2937 }
2938 constexpr auto operator<=>(MotorArrangementValue other) const
2939 {
2940 return value <=> other.value;
2941 }
2942
2943 /**
2944 * \brief Gets the string representation of this enum
2945 *
2946 * \returns String representation of this enum
2947 */
2948 constexpr std::string_view ToString() const
2949 {
2950 switch (value) {
2951 case MotorArrangementValue::Disabled: return "Disabled";
2952 case MotorArrangementValue::Minion_JST: return "Minion_JST";
2953 case MotorArrangementValue::Brushed_DC: return "Brushed_DC";
2954 case MotorArrangementValue::NEO_JST: return "NEO_JST";
2955 case MotorArrangementValue::NEO550_JST: return "NEO550_JST";
2956 case MotorArrangementValue::VORTEX_JST: return "VORTEX_JST";
2957 case MotorArrangementValue::CustomBrushless: return "Custom Brushless";
2958 default: return "Invalid Value";
2959 }
2960 }
2961
2962 CTREXPORT friend std::ostream &operator<<(std::ostream &os, MotorArrangementValue data);
2963
2964 std::string Serialize() const override
2965 {
2966 return "u_" + std::to_string(this->value);
2967 }
2968};
2969
2970/**
2971 * \brief State of the Signal 1 input (S1IN).
2972 */
2975
2976 /**
2977 * \brief Input is not driven high or low, it is disconnected from load.
2978 */
2979 static constexpr int Floating = 0;
2980 /**
2981 * \brief Input is driven low (below 0.5V).
2982 */
2983 static constexpr int Low = 1;
2984 /**
2985 * \brief Input is driven high (above 3V).
2986 */
2987 static constexpr int High = 2;
2988
2989 constexpr S1StateValue(int value) :
2990 value{value}
2991 {}
2992
2993 constexpr S1StateValue() :
2994 value{-1}
2995 {}
2996
2997 constexpr bool operator==(S1StateValue other) const
2998 {
2999 return value == other.value;
3000 }
3001 constexpr auto operator<=>(S1StateValue other) const
3002 {
3003 return value <=> other.value;
3004 }
3005
3006 /**
3007 * \brief Gets the string representation of this enum
3008 *
3009 * \returns String representation of this enum
3010 */
3011 constexpr std::string_view ToString() const
3012 {
3013 switch (value) {
3014 case S1StateValue::Floating: return "Floating";
3015 case S1StateValue::Low: return "Low";
3016 case S1StateValue::High: return "High";
3017 default: return "Invalid Value";
3018 }
3019 }
3020
3021 CTREXPORT friend std::ostream &operator<<(std::ostream &os, S1StateValue data);
3022
3023 std::string Serialize() const override
3024 {
3025 return "u_" + std::to_string(this->value);
3026 }
3027};
3028
3029/**
3030 * \brief State of the Signal 2 input (S2IN).
3031 */
3034
3035 /**
3036 * \brief Input is not driven high or low, it is disconnected from load.
3037 */
3038 static constexpr int Floating = 0;
3039 /**
3040 * \brief Input is driven low (below 0.5V).
3041 */
3042 static constexpr int Low = 1;
3043 /**
3044 * \brief Input is driven high (above 3V).
3045 */
3046 static constexpr int High = 2;
3047
3048 constexpr S2StateValue(int value) :
3049 value{value}
3050 {}
3051
3052 constexpr S2StateValue() :
3053 value{-1}
3054 {}
3055
3056 constexpr bool operator==(S2StateValue other) const
3057 {
3058 return value == other.value;
3059 }
3060 constexpr auto operator<=>(S2StateValue other) const
3061 {
3062 return value <=> other.value;
3063 }
3064
3065 /**
3066 * \brief Gets the string representation of this enum
3067 *
3068 * \returns String representation of this enum
3069 */
3070 constexpr std::string_view ToString() const
3071 {
3072 switch (value) {
3073 case S2StateValue::Floating: return "Floating";
3074 case S2StateValue::Low: return "Low";
3075 case S2StateValue::High: return "High";
3076 default: return "Invalid Value";
3077 }
3078 }
3079
3080 CTREXPORT friend std::ostream &operator<<(std::ostream &os, S2StateValue data);
3081
3082 std::string Serialize() const override
3083 {
3084 return "u_" + std::to_string(this->value);
3085 }
3086};
3087
3088/**
3089 * \brief The floating state of the Signal 1 input (S1IN).
3090 */
3093
3094 /**
3095 * \brief The input will attempt to detect when it is floating. This is enabled
3096 * by default.
3097 */
3098 static constexpr int FloatDetect = 0;
3099 /**
3100 * \brief The input will be pulled high when not loaded by an outside device.
3101 * This is useful for NPN-style devices.
3102 */
3103 static constexpr int PullHigh = 1;
3104 /**
3105 * \brief The input will be pulled low when not loaded by an outside device.
3106 * This is useful for PNP-style devices.
3107 */
3108 static constexpr int PullLow = 2;
3109 /**
3110 * \brief The input will pull in the direction of the last measured state. This
3111 * may be useful for devices that can enter into a high-Z tri-state.
3112 */
3113 static constexpr int BusKeeper = 3;
3114
3115 constexpr S1FloatStateValue(int value) :
3116 value{value}
3117 {}
3118
3119 constexpr S1FloatStateValue() :
3120 value{-1}
3121 {}
3122
3123 constexpr bool operator==(S1FloatStateValue other) const
3124 {
3125 return value == other.value;
3126 }
3127 constexpr auto operator<=>(S1FloatStateValue other) const
3128 {
3129 return value <=> other.value;
3130 }
3131
3132 /**
3133 * \brief Gets the string representation of this enum
3134 *
3135 * \returns String representation of this enum
3136 */
3137 constexpr std::string_view ToString() const
3138 {
3139 switch (value) {
3140 case S1FloatStateValue::FloatDetect: return "Float Detect";
3141 case S1FloatStateValue::PullHigh: return "Pull High";
3142 case S1FloatStateValue::PullLow: return "Pull Low";
3143 case S1FloatStateValue::BusKeeper: return "Bus Keeper";
3144 default: return "Invalid Value";
3145 }
3146 }
3147
3148 CTREXPORT friend std::ostream &operator<<(std::ostream &os, S1FloatStateValue data);
3149
3150 std::string Serialize() const override
3151 {
3152 return "u_" + std::to_string(this->value);
3153 }
3154};
3155
3156/**
3157 * \brief The floating state of the Signal 2 input (S2IN).
3158 */
3161
3162 /**
3163 * \brief The input will attempt to detect when it is floating. This is enabled
3164 * by default.
3165 */
3166 static constexpr int FloatDetect = 0;
3167 /**
3168 * \brief The input will be pulled high when not loaded by an outside device.
3169 * This is useful for NPN-style devices.
3170 */
3171 static constexpr int PullHigh = 1;
3172 /**
3173 * \brief The input will be pulled low when not loaded by an outside device.
3174 * This is useful for PNP-style devices.
3175 */
3176 static constexpr int PullLow = 2;
3177 /**
3178 * \brief The input will pull in the direction of the last measured state. This
3179 * may be useful for devices that can enter into a high-Z tri-state.
3180 */
3181 static constexpr int BusKeeper = 3;
3182
3183 constexpr S2FloatStateValue(int value) :
3184 value{value}
3185 {}
3186
3187 constexpr S2FloatStateValue() :
3188 value{-1}
3189 {}
3190
3191 constexpr bool operator==(S2FloatStateValue other) const
3192 {
3193 return value == other.value;
3194 }
3195 constexpr auto operator<=>(S2FloatStateValue other) const
3196 {
3197 return value <=> other.value;
3198 }
3199
3200 /**
3201 * \brief Gets the string representation of this enum
3202 *
3203 * \returns String representation of this enum
3204 */
3205 constexpr std::string_view ToString() const
3206 {
3207 switch (value) {
3208 case S2FloatStateValue::FloatDetect: return "Float Detect";
3209 case S2FloatStateValue::PullHigh: return "Pull High";
3210 case S2FloatStateValue::PullLow: return "Pull Low";
3211 case S2FloatStateValue::BusKeeper: return "Bus Keeper";
3212 default: return "Invalid Value";
3213 }
3214 }
3215
3216 CTREXPORT friend std::ostream &operator<<(std::ostream &os, S2FloatStateValue data);
3217
3218 std::string Serialize() const override
3219 {
3220 return "u_" + std::to_string(this->value);
3221 }
3222};
3223
3224/**
3225 * \brief Choose what sensor source is reported via API and used by closed-loop
3226 * and limit features. The default is Commutation, which uses the
3227 * external sensor used for motor commutation.
3228 *
3229 * Choose Remote* to use another sensor on the same CAN bus (this also
3230 * requires setting FeedbackRemoteSensorID). Talon will update its
3231 * position and velocity whenever the remote sensor publishes its
3232 * information on CAN bus, and the Talon commutation sensor will not be
3233 * used.
3234 *
3235 * Choose Fused* (requires Phoenix Pro) and Talon will fuse another
3236 * sensor's information with the commutation sensor, which provides the
3237 * best possible position and velocity for accuracy and bandwidth (this
3238 * also requires setting FeedbackRemoteSensorID). This was developed for
3239 * applications such as swerve-azimuth.
3240 *
3241 * Choose Sync* (requires Phoenix Pro) and Talon will synchronize its
3242 * commutation sensor position against another sensor, then continue to
3243 * use the rotor sensor for closed loop control (this also requires
3244 * setting FeedbackRemoteSensorID). The Talon will report if its
3245 * internal position differs significantly from the reported remote
3246 * sensor position. This was developed for mechanisms where there is a
3247 * risk of the sensor failing in such a way that it reports a position
3248 * that does not match the mechanism, such as the sensor mounting
3249 * assembly breaking off.
3250 *
3251 * Choose RemotePigeon2Yaw, RemotePigeon2Pitch, and RemotePigeon2Roll to
3252 * use another Pigeon2 on the same CAN bus (this also requires setting
3253 * FeedbackRemoteSensorID). Talon will update its position to match the
3254 * selected value whenever Pigeon2 publishes its information on CAN bus.
3255 * Note that the Talon position will be in rotations and not degrees.
3256 *
3257 * Choose Quadrature to use a quadrature encoder directly attached to the
3258 * Talon data port. This provides velocity and relative position
3259 * measurements.
3260 *
3261 * Choose PulseWidth to use a pulse-width encoder directly attached to
3262 * the Talon data port. This provides velocity and absolute position
3263 * measurements.
3264 *
3265 * \details Note: When the feedback source is changed to Fused* or Sync*, the
3266 * Talon needs a period of time to fuse before sensor-based
3267 * (soft-limit, closed loop, etc.) features are used. This period of
3268 * time is determined by the update frequency of the remote sensor's
3269 * Position signal.
3270 */
3273
3274 /**
3275 * \brief Use the external sensor used for motor commutation.
3276 */
3277 static constexpr int Commutation = 0;
3278 /**
3279 * \brief Use another CANcoder on the same CAN bus (this also requires setting
3280 * FeedbackRemoteSensorID). Talon will update its position and velocity
3281 * whenever CANcoder publishes its information on CAN bus, and the Talon
3282 * commutation sensor will not be used.
3283 */
3284 static constexpr int RemoteCANcoder = 1;
3285 /**
3286 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
3287 * FeedbackRemoteSensorID). Talon will update its position to match the
3288 * Pigeon2 yaw whenever Pigeon2 publishes its information on CAN bus.
3289 * Note that the Talon position will be in rotations and not degrees.
3290 */
3291 static constexpr int RemotePigeon2Yaw = 2;
3292 /**
3293 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
3294 * FeedbackRemoteSensorID). Talon will update its position to match the
3295 * Pigeon2 pitch whenever Pigeon2 publishes its information on CAN bus.
3296 * Note that the Talon position will be in rotations and not degrees.
3297 */
3298 static constexpr int RemotePigeon2Pitch = 3;
3299 /**
3300 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
3301 * FeedbackRemoteSensorID). Talon will update its position to match the
3302 * Pigeon2 roll whenever Pigeon2 publishes its information on CAN bus.
3303 * Note that the Talon position will be in rotations and not degrees.
3304 */
3305 static constexpr int RemotePigeon2Roll = 4;
3306 /**
3307 * \brief Requires Phoenix Pro; Talon will fuse another CANcoder's information
3308 * with the commutation sensor, which provides the best possible position
3309 * and velocity for accuracy and bandwidth (this also requires setting
3310 * FeedbackRemoteSensorID). FusedCANcoder was developed for applications
3311 * such as swerve-azimuth.
3312 */
3313 static constexpr int FusedCANcoder = 5;
3314 /**
3315 * \brief Requires Phoenix Pro; Talon will synchronize its commutation sensor
3316 * position against another CANcoder, then continue to use the rotor
3317 * sensor for closed loop control (this also requires setting
3318 * FeedbackRemoteSensorID). The Talon will report if its internal
3319 * position differs significantly from the reported CANcoder position.
3320 * SyncCANcoder was developed for mechanisms where there is a risk of the
3321 * CANcoder failing in such a way that it reports a position that does
3322 * not match the mechanism, such as the sensor mounting assembly breaking
3323 * off.
3324 */
3325 static constexpr int SyncCANcoder = 6;
3326 /**
3327 * \brief Use a quadrature encoder directly attached to the Talon data port.
3328 * This provides velocity and relative position measurements.
3329 */
3330 static constexpr int Quadrature = 7;
3331 /**
3332 * \brief Use a pulse-width encoder directly attached to the Talon data port.
3333 * This provides velocity and absolute position measurements.
3334 */
3335 static constexpr int PulseWidth = 8;
3336 /**
3337 * \brief Use a pulse-width encoder remotely attached to the Sensor Input 1
3338 * (S1IN) on CANdi™ (this also requires setting FeedbackRemoteSensorID).
3339 * Talon will update its position and velocity whenever CANdi™ publishes
3340 * its information on CAN bus, and the Talon internal rotor will not be
3341 * used.
3342 */
3343 static constexpr int RemoteCANdiPWM1 = 9;
3344 /**
3345 * \brief Use a pulse-width encoder remotely attached to the Sensor Input 2
3346 * (S2IN) on CANdi™ (this also requires setting FeedbackRemoteSensorID).
3347 * Talon will update its position and velocity whenever CANdi™ publishes
3348 * its information on CAN bus, and the Talon internal rotor will not be
3349 * used.
3350 */
3351 static constexpr int RemoteCANdiPWM2 = 10;
3352 /**
3353 * \brief Use a quadrature encoder remotely attached to the two Sensor Inputs on
3354 * CANdi™ (this also requires setting FeedbackRemoteSensorID). Talon will
3355 * update its position and velocity whenever CANdi™ publishes its
3356 * information on CAN bus, and the Talon internal rotor will not be used.
3357 */
3358 static constexpr int RemoteCANdiQuadrature = 11;
3359 /**
3360 * \brief Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely
3361 * attached to the Sensor Input 1 (S1IN) on CANdi™, which provides the
3362 * best possible position and velocity for accuracy and bandwidth (this
3363 * also requires setting FeedbackRemoteSensorID). FusedCANdi was
3364 * developed for applications such as swerve-azimuth.
3365 */
3366 static constexpr int FusedCANdiPWM1 = 12;
3367 /**
3368 * \brief Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely
3369 * attached to the Sensor Input 2 (S2IN) on CANdi™, which provides the
3370 * best possible position and velocity for accuracy and bandwidth (this
3371 * also requires setting FeedbackRemoteSensorID). FusedCANdi was
3372 * developed for applications such as swerve-azimuth.
3373 */
3374 static constexpr int FusedCANdiPWM2 = 13;
3375 /**
3376 * \brief Requires Phoenix Pro; Talon will fuse a qaudrature encoder remotely
3377 * attached to the two Sensor Inputs on CANdi™. This provides velocity
3378 * and relative position measurements. This also requires setting
3379 * FeedbackRemoteSensorID.
3380 */
3381 static constexpr int FusedCANdiQuadrature = 14;
3382 /**
3383 * \brief Requires Phoenix Pro; Talon will synchronize its internal rotor
3384 * position against the pulse-width encoder attached to Sensor Input 1
3385 * (S1IN), then continue to use the rotor sensor for closed loop control
3386 * (this also requires setting FeedbackRemoteSensorID). The Talon will
3387 * report if its internal position differs significantly from the
3388 * reported PWM position. SyncCANdi was developed for mechanisms where
3389 * there is a risk of the CTR Electronics' CANdi™ failing in such a way
3390 * that it reports a position that does not match the mechanism, such as
3391 * the sensor mounting assembly breaking off.
3392 */
3393 static constexpr int SyncCANdiPWM1 = 15;
3394 /**
3395 * \brief Requires Phoenix Pro; Talon will synchronize its internal rotor
3396 * position against the pulse-width encoder attached to Sensor Input 1
3397 * (S1IN), then continue to use the rotor sensor for closed loop control
3398 * (this also requires setting FeedbackRemoteSensorID). The Talon will
3399 * report if its internal position differs significantly from the
3400 * reported PWM position. SyncCANdi was developed for mechanisms where
3401 * there is a risk of the CTR Electronics' CANdi™ failing in such a way
3402 * that it reports a position that does not match the mechanism, such as
3403 * the sensor mounting assembly breaking off.
3404 */
3405 static constexpr int SyncCANdiPWM2 = 16;
3406
3408 value{value}
3409 {}
3410
3412 value{-1}
3413 {}
3414
3416 {
3417 return value == other.value;
3418 }
3420 {
3421 return value <=> other.value;
3422 }
3423
3424 /**
3425 * \brief Gets the string representation of this enum
3426 *
3427 * \returns String representation of this enum
3428 */
3429 constexpr std::string_view ToString() const
3430 {
3431 switch (value) {
3432 case ExternalFeedbackSensorSourceValue::Commutation: return "Commutation";
3433 case ExternalFeedbackSensorSourceValue::RemoteCANcoder: return "RemoteCANcoder";
3434 case ExternalFeedbackSensorSourceValue::RemotePigeon2Yaw: return "RemotePigeon2Yaw";
3435 case ExternalFeedbackSensorSourceValue::RemotePigeon2Pitch: return "RemotePigeon2Pitch";
3436 case ExternalFeedbackSensorSourceValue::RemotePigeon2Roll: return "RemotePigeon2Roll";
3437 case ExternalFeedbackSensorSourceValue::FusedCANcoder: return "FusedCANcoder";
3438 case ExternalFeedbackSensorSourceValue::SyncCANcoder: return "SyncCANcoder";
3439 case ExternalFeedbackSensorSourceValue::Quadrature: return "Quadrature";
3440 case ExternalFeedbackSensorSourceValue::PulseWidth: return "PulseWidth";
3441 case ExternalFeedbackSensorSourceValue::RemoteCANdiPWM1: return "RemoteCANdiPWM1";
3442 case ExternalFeedbackSensorSourceValue::RemoteCANdiPWM2: return "RemoteCANdiPWM2";
3443 case ExternalFeedbackSensorSourceValue::RemoteCANdiQuadrature: return "RemoteCANdiQuadrature";
3444 case ExternalFeedbackSensorSourceValue::FusedCANdiPWM1: return "FusedCANdiPWM1";
3445 case ExternalFeedbackSensorSourceValue::FusedCANdiPWM2: return "FusedCANdiPWM2";
3446 case ExternalFeedbackSensorSourceValue::FusedCANdiQuadrature: return "FusedCANdiQuadrature";
3447 case ExternalFeedbackSensorSourceValue::SyncCANdiPWM1: return "SyncCANdiPWM1";
3448 case ExternalFeedbackSensorSourceValue::SyncCANdiPWM2: return "SyncCANdiPWM2";
3449 default: return "Invalid Value";
3450 }
3451 }
3452
3453 CTREXPORT friend std::ostream &operator<<(std::ostream &os, ExternalFeedbackSensorSourceValue data);
3454
3455 std::string Serialize() const override
3456 {
3457 return "u_" + std::to_string(this->value);
3458 }
3459};
3460
3461/**
3462 * \brief The relationship between the motor controlled by a Talon and the
3463 * external sensor connected to the data port. This does not affect the
3464 * commutation sensor or remote sensors.
3465 *
3466 * To determine the sensor phase, set this config to Aligned and drive
3467 * the motor with positive output. If the reported sensor velocity is
3468 * positive, then the phase is Aligned. If the reported sensor velocity
3469 * is negative, then the phase is Opposed.
3470 *
3471 * The sensor direction is automatically inverted along with motor
3472 * invert, so the sensor phase does not need to be changed when motor
3473 * invert changes.
3474 */
3477
3478 /**
3479 * \brief The sensor direction is normally aligned with the motor.
3480 */
3481 static constexpr int Aligned = 0;
3482 /**
3483 * \brief The sensor direction is normally opposed to the motor.
3484 */
3485 static constexpr int Opposed = 1;
3486
3487 constexpr SensorPhaseValue(int value) :
3488 value{value}
3489 {}
3490
3491 constexpr SensorPhaseValue() :
3492 value{-1}
3493 {}
3494
3495 constexpr bool operator==(SensorPhaseValue other) const
3496 {
3497 return value == other.value;
3498 }
3499 constexpr auto operator<=>(SensorPhaseValue other) const
3500 {
3501 return value <=> other.value;
3502 }
3503
3504 /**
3505 * \brief Gets the string representation of this enum
3506 *
3507 * \returns String representation of this enum
3508 */
3509 constexpr std::string_view ToString() const
3510 {
3511 switch (value) {
3512 case SensorPhaseValue::Aligned: return "Aligned";
3513 case SensorPhaseValue::Opposed: return "Opposed";
3514 default: return "Invalid Value";
3515 }
3516 }
3517
3518 CTREXPORT friend std::ostream &operator<<(std::ostream &os, SensorPhaseValue data);
3519
3520 std::string Serialize() const override
3521 {
3522 return "u_" + std::to_string(this->value);
3523 }
3524};
3525
3526/**
3527 * \brief What value the Signal 1 input (S1IN) needs to be for the CTR
3528 * Electronics' CANdi™ to detect as Closed.
3529 *
3530 * \details Devices using the S1 input as a remote limit switch will treat the
3531 * switch as closed when the S1 input is this state.
3532 */
3535
3536 /**
3537 * \brief The S1 input will be treated as closed when it is not floating.
3538 */
3539 static constexpr int CloseWhenNotFloating = 0;
3540 /**
3541 * \brief The S1 input will be treated as closed when it is floating.
3542 */
3543 static constexpr int CloseWhenFloating = 1;
3544 /**
3545 * \brief The S1 input will be treated as closed when it is not High.
3546 */
3547 static constexpr int CloseWhenNotHigh = 2;
3548 /**
3549 * \brief The S1 input will be treated as closed when it is High.
3550 */
3551 static constexpr int CloseWhenHigh = 3;
3552 /**
3553 * \brief The S1 input will be treated as closed when it is not Low.
3554 */
3555 static constexpr int CloseWhenNotLow = 4;
3556 /**
3557 * \brief The S1 input will be treated as closed when it is Low.
3558 */
3559 static constexpr int CloseWhenLow = 5;
3560
3561 constexpr S1CloseStateValue(int value) :
3562 value{value}
3563 {}
3564
3565 constexpr S1CloseStateValue() :
3566 value{-1}
3567 {}
3568
3569 constexpr bool operator==(S1CloseStateValue other) const
3570 {
3571 return value == other.value;
3572 }
3573 constexpr auto operator<=>(S1CloseStateValue other) const
3574 {
3575 return value <=> other.value;
3576 }
3577
3578 /**
3579 * \brief Gets the string representation of this enum
3580 *
3581 * \returns String representation of this enum
3582 */
3583 constexpr std::string_view ToString() const
3584 {
3585 switch (value) {
3586 case S1CloseStateValue::CloseWhenNotFloating: return "CloseWhenNotFloating";
3587 case S1CloseStateValue::CloseWhenFloating: return "CloseWhenFloating";
3588 case S1CloseStateValue::CloseWhenNotHigh: return "CloseWhenNotHigh";
3589 case S1CloseStateValue::CloseWhenHigh: return "CloseWhenHigh";
3590 case S1CloseStateValue::CloseWhenNotLow: return "CloseWhenNotLow";
3591 case S1CloseStateValue::CloseWhenLow: return "CloseWhenLow";
3592 default: return "Invalid Value";
3593 }
3594 }
3595
3596 CTREXPORT friend std::ostream &operator<<(std::ostream &os, S1CloseStateValue data);
3597
3598 std::string Serialize() const override
3599 {
3600 return "u_" + std::to_string(this->value);
3601 }
3602};
3603
3604/**
3605 * \brief What value the Signal 2 input (S2IN) needs to be for the CTR
3606 * Electronics' CANdi™ to detect as Closed.
3607 *
3608 * \details Devices using the S2 input as a remote limit switch will treat the
3609 * switch as closed when the S2 input is this state.
3610 */
3613
3614 /**
3615 * \brief The S2 input will be treated as closed when it is not floating.
3616 */
3617 static constexpr int CloseWhenNotFloating = 0;
3618 /**
3619 * \brief The S2 input will be treated as closed when it is floating.
3620 */
3621 static constexpr int CloseWhenFloating = 1;
3622 /**
3623 * \brief The S2 input will be treated as closed when it is not High.
3624 */
3625 static constexpr int CloseWhenNotHigh = 2;
3626 /**
3627 * \brief The S2 input will be treated as closed when it is High.
3628 */
3629 static constexpr int CloseWhenHigh = 3;
3630 /**
3631 * \brief The S2 input will be treated as closed when it is not Low.
3632 */
3633 static constexpr int CloseWhenNotLow = 4;
3634 /**
3635 * \brief The S2 input will be treated as closed when it is Low.
3636 */
3637 static constexpr int CloseWhenLow = 5;
3638
3639 constexpr S2CloseStateValue(int value) :
3640 value{value}
3641 {}
3642
3643 constexpr S2CloseStateValue() :
3644 value{-1}
3645 {}
3646
3647 constexpr bool operator==(S2CloseStateValue other) const
3648 {
3649 return value == other.value;
3650 }
3651 constexpr auto operator<=>(S2CloseStateValue other) const
3652 {
3653 return value <=> other.value;
3654 }
3655
3656 /**
3657 * \brief Gets the string representation of this enum
3658 *
3659 * \returns String representation of this enum
3660 */
3661 constexpr std::string_view ToString() const
3662 {
3663 switch (value) {
3664 case S2CloseStateValue::CloseWhenNotFloating: return "CloseWhenNotFloating";
3665 case S2CloseStateValue::CloseWhenFloating: return "CloseWhenFloating";
3666 case S2CloseStateValue::CloseWhenNotHigh: return "CloseWhenNotHigh";
3667 case S2CloseStateValue::CloseWhenHigh: return "CloseWhenHigh";
3668 case S2CloseStateValue::CloseWhenNotLow: return "CloseWhenNotLow";
3669 case S2CloseStateValue::CloseWhenLow: return "CloseWhenLow";
3670 default: return "Invalid Value";
3671 }
3672 }
3673
3674 CTREXPORT friend std::ostream &operator<<(std::ostream &os, S2CloseStateValue data);
3675
3676 std::string Serialize() const override
3677 {
3678 return "u_" + std::to_string(this->value);
3679 }
3680};
3681
3682/**
3683 * \brief If a brushed motor is selected with Motor Arrangement, this config
3684 * determines which of three leads to use.
3685 */
3688
3689 /**
3690 * \brief Third party brushed DC motor with two leads.
3691 * Motor leads: Use terminal A for the motor red lead and terminal B for
3692 * the motor black lead (motor leads may be flipped to correct for
3693 * clockwise vs counterclockwise).
3694 * Note that the invert configuration can still be used to invert rotor
3695 * orientation.
3696 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
3697 * [forward, reverse] are on pins [4, 8], and pulse width position is on
3698 * pin [9].
3699 */
3700 static constexpr int Leads_A_and_B = 0;
3701 /**
3702 * \brief Third party brushed DC motor with two leads.
3703 * Motor leads: Use terminal A for the motor red lead and terminal C for
3704 * the motor black lead (motor leads may be flipped to correct for
3705 * clockwise vs counterclockwise).
3706 * Note that the invert configuration can still be used to reverse rotor
3707 * orientation.
3708 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
3709 * [forward, reverse] are on pins [4, 8], and pulse width position is on
3710 * pin [9].
3711 */
3712 static constexpr int Leads_A_and_C = 1;
3713 /**
3714 * \brief Third party brushed DC motor with two leads.
3715 * Motor leads: Use terminal B for the motor red lead and terminal C for
3716 * the motor black lead (motor leads may be flipped to correct for
3717 * clockwise vs counterclockwise).
3718 * Note that the invert configuration can still be used to reverse rotor
3719 * orientation.
3720 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
3721 * [forward, reverse] are on pins [4, 8], and pulse width position is on
3722 * pin [9].
3723 */
3724 static constexpr int Leads_B_and_C = 2;
3725
3727 value{value}
3728 {}
3729
3731 value{-1}
3732 {}
3733
3734 constexpr bool operator==(BrushedMotorWiringValue other) const
3735 {
3736 return value == other.value;
3737 }
3738 constexpr auto operator<=>(BrushedMotorWiringValue other) const
3739 {
3740 return value <=> other.value;
3741 }
3742
3743 /**
3744 * \brief Gets the string representation of this enum
3745 *
3746 * \returns String representation of this enum
3747 */
3748 constexpr std::string_view ToString() const
3749 {
3750 switch (value) {
3751 case BrushedMotorWiringValue::Leads_A_and_B: return "Leads_A_and_B";
3752 case BrushedMotorWiringValue::Leads_A_and_C: return "Leads_A_and_C";
3753 case BrushedMotorWiringValue::Leads_B_and_C: return "Leads_B_and_C";
3754 default: return "Invalid Value";
3755 }
3756 }
3757
3758 CTREXPORT friend std::ostream &operator<<(std::ostream &os, BrushedMotorWiringValue data);
3759
3760 std::string Serialize() const override
3761 {
3762 return "u_" + std::to_string(this->value);
3763 }
3764};
3765
3766/**
3767 * \brief The type of LEDs that are being controlled.
3768 */
3771
3772 /**
3773 * \brief LEDs that are controlled by Green-Red-Blue values.
3774 */
3775 static constexpr int GRB = 0;
3776 /**
3777 * \brief LEDs that are controlled by Red-Green-Blue values.
3778 */
3779 static constexpr int RGB = 1;
3780 /**
3781 * \brief LEDs that are controlled by Blue-Red-Green values.
3782 */
3783 static constexpr int BRG = 2;
3784 /**
3785 * \brief LEDs that are controlled by Green-Red-Blue-White values.
3786 */
3787 static constexpr int GRBW = 6;
3788 /**
3789 * \brief LEDs that are controlled by Red-Green-Blue-White values.
3790 */
3791 static constexpr int RGBW = 7;
3792 /**
3793 * \brief LEDs that are controlled by Blue-Red-Green-White values.
3794 */
3795 static constexpr int BRGW = 8;
3796
3797 constexpr StripTypeValue(int value) :
3798 value{value}
3799 {}
3800
3801 constexpr StripTypeValue() :
3802 value{-1}
3803 {}
3804
3805 constexpr bool operator==(StripTypeValue other) const
3806 {
3807 return value == other.value;
3808 }
3809 constexpr auto operator<=>(StripTypeValue other) const
3810 {
3811 return value <=> other.value;
3812 }
3813
3814 /**
3815 * \brief Gets the string representation of this enum
3816 *
3817 * \returns String representation of this enum
3818 */
3819 constexpr std::string_view ToString() const
3820 {
3821 switch (value) {
3822 case StripTypeValue::GRB: return "GRB";
3823 case StripTypeValue::RGB: return "RGB";
3824 case StripTypeValue::BRG: return "BRG";
3825 case StripTypeValue::GRBW: return "GRBW";
3826 case StripTypeValue::RGBW: return "RGBW";
3827 case StripTypeValue::BRGW: return "BRGW";
3828 default: return "Invalid Value";
3829 }
3830 }
3831
3832 CTREXPORT friend std::ostream &operator<<(std::ostream &os, StripTypeValue data);
3833
3834 std::string Serialize() const override
3835 {
3836 return "u_" + std::to_string(this->value);
3837 }
3838};
3839
3840/**
3841 * \brief The behavior of the LEDs when the control signal is lost.
3842 */
3845
3846 /**
3847 * \brief LEDs remain enabled, and animations continue to run.
3848 */
3849 static constexpr int KeepRunning = 0;
3850 /**
3851 * \brief LEDs and animations are disabled after the control signal is lost.
3852 */
3853 static constexpr int DisableLEDs = 1;
3854
3856 value{value}
3857 {}
3858
3860 value{-1}
3861 {}
3862
3863 constexpr bool operator==(LossOfSignalBehaviorValue other) const
3864 {
3865 return value == other.value;
3866 }
3867 constexpr auto operator<=>(LossOfSignalBehaviorValue other) const
3868 {
3869 return value <=> other.value;
3870 }
3871
3872 /**
3873 * \brief Gets the string representation of this enum
3874 *
3875 * \returns String representation of this enum
3876 */
3877 constexpr std::string_view ToString() const
3878 {
3879 switch (value) {
3880 case LossOfSignalBehaviorValue::KeepRunning: return "KeepRunning";
3881 case LossOfSignalBehaviorValue::DisableLEDs: return "DisableLEDs";
3882 default: return "Invalid Value";
3883 }
3884 }
3885
3886 CTREXPORT friend std::ostream &operator<<(std::ostream &os, LossOfSignalBehaviorValue data);
3887
3888 std::string Serialize() const override
3889 {
3890 return "u_" + std::to_string(this->value);
3891 }
3892};
3893
3894/**
3895 * \brief Whether the 5V rail is enabled. Disabling the 5V rail will also turn
3896 * off the onboard LEDs.
3897 */
3900
3901 /**
3902 * \brief The 5V rail is enabled, allowing for LED control.
3903 */
3904 static constexpr int Enabled = 0;
3905 /**
3906 * \brief The 5V rail is disabled. This will also turn off the onboard LEDs.
3907 */
3908 static constexpr int Disabled = 1;
3909
3910 constexpr Enable5VRailValue(int value) :
3911 value{value}
3912 {}
3913
3914 constexpr Enable5VRailValue() :
3915 value{-1}
3916 {}
3917
3918 constexpr bool operator==(Enable5VRailValue other) const
3919 {
3920 return value == other.value;
3921 }
3922 constexpr auto operator<=>(Enable5VRailValue other) const
3923 {
3924 return value <=> other.value;
3925 }
3926
3927 /**
3928 * \brief Gets the string representation of this enum
3929 *
3930 * \returns String representation of this enum
3931 */
3932 constexpr std::string_view ToString() const
3933 {
3934 switch (value) {
3935 case Enable5VRailValue::Enabled: return "Enabled";
3936 case Enable5VRailValue::Disabled: return "Disabled";
3937 default: return "Invalid Value";
3938 }
3939 }
3940
3941 CTREXPORT friend std::ostream &operator<<(std::ostream &os, Enable5VRailValue data);
3942
3943 std::string Serialize() const override
3944 {
3945 return "u_" + std::to_string(this->value);
3946 }
3947};
3948
3949/**
3950 * \brief The behavior of the VBat output. CANdle supports modulating VBat
3951 * output for single-color LED strips.
3952 */
3955
3956 /**
3957 * \brief VBat output is on at full power.
3958 */
3959 static constexpr int On = 0;
3960 /**
3961 * \brief VBat output is off.
3962 */
3963 static constexpr int Off = 1;
3964 /**
3965 * \brief VBat output is on at the specified modulation.
3966 */
3967 static constexpr int Modulated = 2;
3968
3970 value{value}
3971 {}
3972
3974 value{-1}
3975 {}
3976
3977 constexpr bool operator==(VBatOutputModeValue other) const
3978 {
3979 return value == other.value;
3980 }
3981 constexpr auto operator<=>(VBatOutputModeValue other) const
3982 {
3983 return value <=> other.value;
3984 }
3985
3986 /**
3987 * \brief Gets the string representation of this enum
3988 *
3989 * \returns String representation of this enum
3990 */
3991 constexpr std::string_view ToString() const
3992 {
3993 switch (value) {
3994 case VBatOutputModeValue::On: return "On";
3995 case VBatOutputModeValue::Off: return "Off";
3996 case VBatOutputModeValue::Modulated: return "Modulated";
3997 default: return "Invalid Value";
3998 }
3999 }
4000
4001 CTREXPORT friend std::ostream &operator<<(std::ostream &os, VBatOutputModeValue data);
4002
4003 std::string Serialize() const override
4004 {
4005 return "u_" + std::to_string(this->value);
4006 }
4007};
4008
4009/**
4010 * \brief Whether the Status LED is enabled when the CANdle is actively being
4011 * controlled.
4012 */
4015
4016 /**
4017 * \brief The status LED is enabled during control.
4018 */
4019 static constexpr int Enabled = 0;
4020 /**
4021 * \brief The status LED is disabled during control.
4022 */
4023 static constexpr int Disabled = 1;
4024
4026 value{value}
4027 {}
4028
4030 value{-1}
4031 {}
4032
4033 constexpr bool operator==(StatusLedWhenActiveValue other) const
4034 {
4035 return value == other.value;
4036 }
4037 constexpr auto operator<=>(StatusLedWhenActiveValue other) const
4038 {
4039 return value <=> other.value;
4040 }
4041
4042 /**
4043 * \brief Gets the string representation of this enum
4044 *
4045 * \returns String representation of this enum
4046 */
4047 constexpr std::string_view ToString() const
4048 {
4049 switch (value) {
4050 case StatusLedWhenActiveValue::Enabled: return "Enabled";
4051 case StatusLedWhenActiveValue::Disabled: return "Disabled";
4052 default: return "Invalid Value";
4053 }
4054 }
4055
4056 CTREXPORT friend std::ostream &operator<<(std::ostream &os, StatusLedWhenActiveValue data);
4057
4058 std::string Serialize() const override
4059 {
4060 return "u_" + std::to_string(this->value);
4061 }
4062};
4063
4064/**
4065 * \brief The type of animation running in slot 0 of the CANdle.
4066 */
4069
4070 /**
4071 * \brief No animation.
4072 */
4073 static constexpr int Empty = 0;
4074 /**
4075 * \brief Color flow animation.
4076 */
4077 static constexpr int ColorFlow = 1;
4078 /**
4079 * \brief Fire animation.
4080 */
4081 static constexpr int Fire = 2;
4082 /**
4083 * \brief Larson animation.
4084 */
4085 static constexpr int Larson = 3;
4086 /**
4087 * \brief Rainbow animation.
4088 */
4089 static constexpr int Rainbow = 4;
4090 /**
4091 * \brief RGB Fade animation.
4092 */
4093 static constexpr int RgbFade = 5;
4094 /**
4095 * \brief Single fade animation.
4096 */
4097 static constexpr int SingleFade = 6;
4098 /**
4099 * \brief Strobe animation.
4100 */
4101 static constexpr int Strobe = 7;
4102 /**
4103 * \brief Twinkle animation.
4104 */
4105 static constexpr int Twinkle = 8;
4106 /**
4107 * \brief Twinkle off animation.
4108 */
4109 static constexpr int TwinkleOff = 9;
4110
4112 value{value}
4113 {}
4114
4116 value{-1}
4117 {}
4118
4119 constexpr bool operator==(Animation0TypeValue other) const
4120 {
4121 return value == other.value;
4122 }
4123 constexpr auto operator<=>(Animation0TypeValue other) const
4124 {
4125 return value <=> other.value;
4126 }
4127
4128 /**
4129 * \brief Gets the string representation of this enum
4130 *
4131 * \returns String representation of this enum
4132 */
4133 constexpr std::string_view ToString() const
4134 {
4135 switch (value) {
4136 case Animation0TypeValue::Empty: return "Empty";
4137 case Animation0TypeValue::ColorFlow: return "ColorFlow";
4138 case Animation0TypeValue::Fire: return "Fire";
4139 case Animation0TypeValue::Larson: return "Larson";
4140 case Animation0TypeValue::Rainbow: return "Rainbow";
4141 case Animation0TypeValue::RgbFade: return "RgbFade";
4142 case Animation0TypeValue::SingleFade: return "SingleFade";
4143 case Animation0TypeValue::Strobe: return "Strobe";
4144 case Animation0TypeValue::Twinkle: return "Twinkle";
4145 case Animation0TypeValue::TwinkleOff: return "TwinkleOff";
4146 default: return "Invalid Value";
4147 }
4148 }
4149
4150 CTREXPORT friend std::ostream &operator<<(std::ostream &os, Animation0TypeValue data);
4151
4152 std::string Serialize() const override
4153 {
4154 return "u_" + std::to_string(this->value);
4155 }
4156};
4157
4158/**
4159 * \brief The type of animation running in slot 1 of the CANdle.
4160 */
4163
4164 /**
4165 * \brief No animation.
4166 */
4167 static constexpr int Empty = 0;
4168 /**
4169 * \brief Color flow animation.
4170 */
4171 static constexpr int ColorFlow = 1;
4172 /**
4173 * \brief Fire animation.
4174 */
4175 static constexpr int Fire = 2;
4176 /**
4177 * \brief Larson animation.
4178 */
4179 static constexpr int Larson = 3;
4180 /**
4181 * \brief Rainbow animation.
4182 */
4183 static constexpr int Rainbow = 4;
4184 /**
4185 * \brief RGB Fade animation.
4186 */
4187 static constexpr int RgbFade = 5;
4188 /**
4189 * \brief Single fade animation.
4190 */
4191 static constexpr int SingleFade = 6;
4192 /**
4193 * \brief Strobe animation.
4194 */
4195 static constexpr int Strobe = 7;
4196 /**
4197 * \brief Twinkle animation.
4198 */
4199 static constexpr int Twinkle = 8;
4200 /**
4201 * \brief Twinkle off animation.
4202 */
4203 static constexpr int TwinkleOff = 9;
4204
4206 value{value}
4207 {}
4208
4210 value{-1}
4211 {}
4212
4213 constexpr bool operator==(Animation1TypeValue other) const
4214 {
4215 return value == other.value;
4216 }
4217 constexpr auto operator<=>(Animation1TypeValue other) const
4218 {
4219 return value <=> other.value;
4220 }
4221
4222 /**
4223 * \brief Gets the string representation of this enum
4224 *
4225 * \returns String representation of this enum
4226 */
4227 constexpr std::string_view ToString() const
4228 {
4229 switch (value) {
4230 case Animation1TypeValue::Empty: return "Empty";
4231 case Animation1TypeValue::ColorFlow: return "ColorFlow";
4232 case Animation1TypeValue::Fire: return "Fire";
4233 case Animation1TypeValue::Larson: return "Larson";
4234 case Animation1TypeValue::Rainbow: return "Rainbow";
4235 case Animation1TypeValue::RgbFade: return "RgbFade";
4236 case Animation1TypeValue::SingleFade: return "SingleFade";
4237 case Animation1TypeValue::Strobe: return "Strobe";
4238 case Animation1TypeValue::Twinkle: return "Twinkle";
4239 case Animation1TypeValue::TwinkleOff: return "TwinkleOff";
4240 default: return "Invalid Value";
4241 }
4242 }
4243
4244 CTREXPORT friend std::ostream &operator<<(std::ostream &os, Animation1TypeValue data);
4245
4246 std::string Serialize() const override
4247 {
4248 return "u_" + std::to_string(this->value);
4249 }
4250};
4251
4252/**
4253 * \brief The type of animation running in slot 2 of the CANdle.
4254 */
4257
4258 /**
4259 * \brief No animation.
4260 */
4261 static constexpr int Empty = 0;
4262 /**
4263 * \brief Color flow animation.
4264 */
4265 static constexpr int ColorFlow = 1;
4266 /**
4267 * \brief Fire animation.
4268 */
4269 static constexpr int Fire = 2;
4270 /**
4271 * \brief Larson animation.
4272 */
4273 static constexpr int Larson = 3;
4274 /**
4275 * \brief Rainbow animation.
4276 */
4277 static constexpr int Rainbow = 4;
4278 /**
4279 * \brief RGB Fade animation.
4280 */
4281 static constexpr int RgbFade = 5;
4282 /**
4283 * \brief Single fade animation.
4284 */
4285 static constexpr int SingleFade = 6;
4286 /**
4287 * \brief Strobe animation.
4288 */
4289 static constexpr int Strobe = 7;
4290 /**
4291 * \brief Twinkle animation.
4292 */
4293 static constexpr int Twinkle = 8;
4294 /**
4295 * \brief Twinkle off animation.
4296 */
4297 static constexpr int TwinkleOff = 9;
4298
4300 value{value}
4301 {}
4302
4304 value{-1}
4305 {}
4306
4307 constexpr bool operator==(Animation2TypeValue other) const
4308 {
4309 return value == other.value;
4310 }
4311 constexpr auto operator<=>(Animation2TypeValue other) const
4312 {
4313 return value <=> other.value;
4314 }
4315
4316 /**
4317 * \brief Gets the string representation of this enum
4318 *
4319 * \returns String representation of this enum
4320 */
4321 constexpr std::string_view ToString() const
4322 {
4323 switch (value) {
4324 case Animation2TypeValue::Empty: return "Empty";
4325 case Animation2TypeValue::ColorFlow: return "ColorFlow";
4326 case Animation2TypeValue::Fire: return "Fire";
4327 case Animation2TypeValue::Larson: return "Larson";
4328 case Animation2TypeValue::Rainbow: return "Rainbow";
4329 case Animation2TypeValue::RgbFade: return "RgbFade";
4330 case Animation2TypeValue::SingleFade: return "SingleFade";
4331 case Animation2TypeValue::Strobe: return "Strobe";
4332 case Animation2TypeValue::Twinkle: return "Twinkle";
4333 case Animation2TypeValue::TwinkleOff: return "TwinkleOff";
4334 default: return "Invalid Value";
4335 }
4336 }
4337
4338 CTREXPORT friend std::ostream &operator<<(std::ostream &os, Animation2TypeValue data);
4339
4340 std::string Serialize() const override
4341 {
4342 return "u_" + std::to_string(this->value);
4343 }
4344};
4345
4346/**
4347 * \brief The type of animation running in slot 3 of the CANdle.
4348 */
4351
4352 /**
4353 * \brief No animation.
4354 */
4355 static constexpr int Empty = 0;
4356 /**
4357 * \brief Color flow animation.
4358 */
4359 static constexpr int ColorFlow = 1;
4360 /**
4361 * \brief Fire animation.
4362 */
4363 static constexpr int Fire = 2;
4364 /**
4365 * \brief Larson animation.
4366 */
4367 static constexpr int Larson = 3;
4368 /**
4369 * \brief Rainbow animation.
4370 */
4371 static constexpr int Rainbow = 4;
4372 /**
4373 * \brief RGB Fade animation.
4374 */
4375 static constexpr int RgbFade = 5;
4376 /**
4377 * \brief Single fade animation.
4378 */
4379 static constexpr int SingleFade = 6;
4380 /**
4381 * \brief Strobe animation.
4382 */
4383 static constexpr int Strobe = 7;
4384 /**
4385 * \brief Twinkle animation.
4386 */
4387 static constexpr int Twinkle = 8;
4388 /**
4389 * \brief Twinkle off animation.
4390 */
4391 static constexpr int TwinkleOff = 9;
4392
4394 value{value}
4395 {}
4396
4398 value{-1}
4399 {}
4400
4401 constexpr bool operator==(Animation3TypeValue other) const
4402 {
4403 return value == other.value;
4404 }
4405 constexpr auto operator<=>(Animation3TypeValue other) const
4406 {
4407 return value <=> other.value;
4408 }
4409
4410 /**
4411 * \brief Gets the string representation of this enum
4412 *
4413 * \returns String representation of this enum
4414 */
4415 constexpr std::string_view ToString() const
4416 {
4417 switch (value) {
4418 case Animation3TypeValue::Empty: return "Empty";
4419 case Animation3TypeValue::ColorFlow: return "ColorFlow";
4420 case Animation3TypeValue::Fire: return "Fire";
4421 case Animation3TypeValue::Larson: return "Larson";
4422 case Animation3TypeValue::Rainbow: return "Rainbow";
4423 case Animation3TypeValue::RgbFade: return "RgbFade";
4424 case Animation3TypeValue::SingleFade: return "SingleFade";
4425 case Animation3TypeValue::Strobe: return "Strobe";
4426 case Animation3TypeValue::Twinkle: return "Twinkle";
4427 case Animation3TypeValue::TwinkleOff: return "TwinkleOff";
4428 default: return "Invalid Value";
4429 }
4430 }
4431
4432 CTREXPORT friend std::ostream &operator<<(std::ostream &os, Animation3TypeValue data);
4433
4434 std::string Serialize() const override
4435 {
4436 return "u_" + std::to_string(this->value);
4437 }
4438};
4439
4440/**
4441 * \brief The type of animation running in slot 4 of the CANdle.
4442 */
4445
4446 /**
4447 * \brief No animation.
4448 */
4449 static constexpr int Empty = 0;
4450 /**
4451 * \brief Color flow animation.
4452 */
4453 static constexpr int ColorFlow = 1;
4454 /**
4455 * \brief Fire animation.
4456 */
4457 static constexpr int Fire = 2;
4458 /**
4459 * \brief Larson animation.
4460 */
4461 static constexpr int Larson = 3;
4462 /**
4463 * \brief Rainbow animation.
4464 */
4465 static constexpr int Rainbow = 4;
4466 /**
4467 * \brief RGB Fade animation.
4468 */
4469 static constexpr int RgbFade = 5;
4470 /**
4471 * \brief Single fade animation.
4472 */
4473 static constexpr int SingleFade = 6;
4474 /**
4475 * \brief Strobe animation.
4476 */
4477 static constexpr int Strobe = 7;
4478 /**
4479 * \brief Twinkle animation.
4480 */
4481 static constexpr int Twinkle = 8;
4482 /**
4483 * \brief Twinkle off animation.
4484 */
4485 static constexpr int TwinkleOff = 9;
4486
4488 value{value}
4489 {}
4490
4492 value{-1}
4493 {}
4494
4495 constexpr bool operator==(Animation4TypeValue other) const
4496 {
4497 return value == other.value;
4498 }
4499 constexpr auto operator<=>(Animation4TypeValue other) const
4500 {
4501 return value <=> other.value;
4502 }
4503
4504 /**
4505 * \brief Gets the string representation of this enum
4506 *
4507 * \returns String representation of this enum
4508 */
4509 constexpr std::string_view ToString() const
4510 {
4511 switch (value) {
4512 case Animation4TypeValue::Empty: return "Empty";
4513 case Animation4TypeValue::ColorFlow: return "ColorFlow";
4514 case Animation4TypeValue::Fire: return "Fire";
4515 case Animation4TypeValue::Larson: return "Larson";
4516 case Animation4TypeValue::Rainbow: return "Rainbow";
4517 case Animation4TypeValue::RgbFade: return "RgbFade";
4518 case Animation4TypeValue::SingleFade: return "SingleFade";
4519 case Animation4TypeValue::Strobe: return "Strobe";
4520 case Animation4TypeValue::Twinkle: return "Twinkle";
4521 case Animation4TypeValue::TwinkleOff: return "TwinkleOff";
4522 default: return "Invalid Value";
4523 }
4524 }
4525
4526 CTREXPORT friend std::ostream &operator<<(std::ostream &os, Animation4TypeValue data);
4527
4528 std::string Serialize() const override
4529 {
4530 return "u_" + std::to_string(this->value);
4531 }
4532};
4533
4534/**
4535 * \brief The type of animation running in slot 5 of the CANdle.
4536 */
4539
4540 /**
4541 * \brief No animation.
4542 */
4543 static constexpr int Empty = 0;
4544 /**
4545 * \brief Color flow animation.
4546 */
4547 static constexpr int ColorFlow = 1;
4548 /**
4549 * \brief Fire animation.
4550 */
4551 static constexpr int Fire = 2;
4552 /**
4553 * \brief Larson animation.
4554 */
4555 static constexpr int Larson = 3;
4556 /**
4557 * \brief Rainbow animation.
4558 */
4559 static constexpr int Rainbow = 4;
4560 /**
4561 * \brief RGB Fade animation.
4562 */
4563 static constexpr int RgbFade = 5;
4564 /**
4565 * \brief Single fade animation.
4566 */
4567 static constexpr int SingleFade = 6;
4568 /**
4569 * \brief Strobe animation.
4570 */
4571 static constexpr int Strobe = 7;
4572 /**
4573 * \brief Twinkle animation.
4574 */
4575 static constexpr int Twinkle = 8;
4576 /**
4577 * \brief Twinkle off animation.
4578 */
4579 static constexpr int TwinkleOff = 9;
4580
4582 value{value}
4583 {}
4584
4586 value{-1}
4587 {}
4588
4589 constexpr bool operator==(Animation5TypeValue other) const
4590 {
4591 return value == other.value;
4592 }
4593 constexpr auto operator<=>(Animation5TypeValue other) const
4594 {
4595 return value <=> other.value;
4596 }
4597
4598 /**
4599 * \brief Gets the string representation of this enum
4600 *
4601 * \returns String representation of this enum
4602 */
4603 constexpr std::string_view ToString() const
4604 {
4605 switch (value) {
4606 case Animation5TypeValue::Empty: return "Empty";
4607 case Animation5TypeValue::ColorFlow: return "ColorFlow";
4608 case Animation5TypeValue::Fire: return "Fire";
4609 case Animation5TypeValue::Larson: return "Larson";
4610 case Animation5TypeValue::Rainbow: return "Rainbow";
4611 case Animation5TypeValue::RgbFade: return "RgbFade";
4612 case Animation5TypeValue::SingleFade: return "SingleFade";
4613 case Animation5TypeValue::Strobe: return "Strobe";
4614 case Animation5TypeValue::Twinkle: return "Twinkle";
4615 case Animation5TypeValue::TwinkleOff: return "TwinkleOff";
4616 default: return "Invalid Value";
4617 }
4618 }
4619
4620 CTREXPORT friend std::ostream &operator<<(std::ostream &os, Animation5TypeValue data);
4621
4622 std::string Serialize() const override
4623 {
4624 return "u_" + std::to_string(this->value);
4625 }
4626};
4627
4628/**
4629 * \brief The type of animation running in slot 6 of the CANdle.
4630 */
4633
4634 /**
4635 * \brief No animation.
4636 */
4637 static constexpr int Empty = 0;
4638 /**
4639 * \brief Color flow animation.
4640 */
4641 static constexpr int ColorFlow = 1;
4642 /**
4643 * \brief Fire animation.
4644 */
4645 static constexpr int Fire = 2;
4646 /**
4647 * \brief Larson animation.
4648 */
4649 static constexpr int Larson = 3;
4650 /**
4651 * \brief Rainbow animation.
4652 */
4653 static constexpr int Rainbow = 4;
4654 /**
4655 * \brief RGB Fade animation.
4656 */
4657 static constexpr int RgbFade = 5;
4658 /**
4659 * \brief Single fade animation.
4660 */
4661 static constexpr int SingleFade = 6;
4662 /**
4663 * \brief Strobe animation.
4664 */
4665 static constexpr int Strobe = 7;
4666 /**
4667 * \brief Twinkle animation.
4668 */
4669 static constexpr int Twinkle = 8;
4670 /**
4671 * \brief Twinkle off animation.
4672 */
4673 static constexpr int TwinkleOff = 9;
4674
4676 value{value}
4677 {}
4678
4680 value{-1}
4681 {}
4682
4683 constexpr bool operator==(Animation6TypeValue other) const
4684 {
4685 return value == other.value;
4686 }
4687 constexpr auto operator<=>(Animation6TypeValue other) const
4688 {
4689 return value <=> other.value;
4690 }
4691
4692 /**
4693 * \brief Gets the string representation of this enum
4694 *
4695 * \returns String representation of this enum
4696 */
4697 constexpr std::string_view ToString() const
4698 {
4699 switch (value) {
4700 case Animation6TypeValue::Empty: return "Empty";
4701 case Animation6TypeValue::ColorFlow: return "ColorFlow";
4702 case Animation6TypeValue::Fire: return "Fire";
4703 case Animation6TypeValue::Larson: return "Larson";
4704 case Animation6TypeValue::Rainbow: return "Rainbow";
4705 case Animation6TypeValue::RgbFade: return "RgbFade";
4706 case Animation6TypeValue::SingleFade: return "SingleFade";
4707 case Animation6TypeValue::Strobe: return "Strobe";
4708 case Animation6TypeValue::Twinkle: return "Twinkle";
4709 case Animation6TypeValue::TwinkleOff: return "TwinkleOff";
4710 default: return "Invalid Value";
4711 }
4712 }
4713
4714 CTREXPORT friend std::ostream &operator<<(std::ostream &os, Animation6TypeValue data);
4715
4716 std::string Serialize() const override
4717 {
4718 return "u_" + std::to_string(this->value);
4719 }
4720};
4721
4722/**
4723 * \brief The type of animation running in slot 7 of the CANdle.
4724 */
4727
4728 /**
4729 * \brief No animation.
4730 */
4731 static constexpr int Empty = 0;
4732 /**
4733 * \brief Color flow animation.
4734 */
4735 static constexpr int ColorFlow = 1;
4736 /**
4737 * \brief Fire animation.
4738 */
4739 static constexpr int Fire = 2;
4740 /**
4741 * \brief Larson animation.
4742 */
4743 static constexpr int Larson = 3;
4744 /**
4745 * \brief Rainbow animation.
4746 */
4747 static constexpr int Rainbow = 4;
4748 /**
4749 * \brief RGB Fade animation.
4750 */
4751 static constexpr int RgbFade = 5;
4752 /**
4753 * \brief Single fade animation.
4754 */
4755 static constexpr int SingleFade = 6;
4756 /**
4757 * \brief Strobe animation.
4758 */
4759 static constexpr int Strobe = 7;
4760 /**
4761 * \brief Twinkle animation.
4762 */
4763 static constexpr int Twinkle = 8;
4764 /**
4765 * \brief Twinkle off animation.
4766 */
4767 static constexpr int TwinkleOff = 9;
4768
4770 value{value}
4771 {}
4772
4774 value{-1}
4775 {}
4776
4777 constexpr bool operator==(Animation7TypeValue other) const
4778 {
4779 return value == other.value;
4780 }
4781 constexpr auto operator<=>(Animation7TypeValue other) const
4782 {
4783 return value <=> other.value;
4784 }
4785
4786 /**
4787 * \brief Gets the string representation of this enum
4788 *
4789 * \returns String representation of this enum
4790 */
4791 constexpr std::string_view ToString() const
4792 {
4793 switch (value) {
4794 case Animation7TypeValue::Empty: return "Empty";
4795 case Animation7TypeValue::ColorFlow: return "ColorFlow";
4796 case Animation7TypeValue::Fire: return "Fire";
4797 case Animation7TypeValue::Larson: return "Larson";
4798 case Animation7TypeValue::Rainbow: return "Rainbow";
4799 case Animation7TypeValue::RgbFade: return "RgbFade";
4800 case Animation7TypeValue::SingleFade: return "SingleFade";
4801 case Animation7TypeValue::Strobe: return "Strobe";
4802 case Animation7TypeValue::Twinkle: return "Twinkle";
4803 case Animation7TypeValue::TwinkleOff: return "TwinkleOff";
4804 default: return "Invalid Value";
4805 }
4806 }
4807
4808 CTREXPORT friend std::ostream &operator<<(std::ostream &os, Animation7TypeValue data);
4809
4810 std::string Serialize() const override
4811 {
4812 return "u_" + std::to_string(this->value);
4813 }
4814};
4815
4816/**
4817 * \brief Direction of the animation.
4818 */
4821
4822 /**
4823 * \brief The animation starts at the specified LED start index and moves
4824 * towards the LED end index.
4825 */
4826 static constexpr int Forward = 0;
4827 /**
4828 * \brief The animation starts at the specified LED end index and moves towards
4829 * the LED start index.
4830 */
4831 static constexpr int Backward = 1;
4832
4834 value{value}
4835 {}
4836
4838 value{-1}
4839 {}
4840
4841 constexpr bool operator==(AnimationDirectionValue other) const
4842 {
4843 return value == other.value;
4844 }
4845 constexpr auto operator<=>(AnimationDirectionValue other) const
4846 {
4847 return value <=> other.value;
4848 }
4849
4850 /**
4851 * \brief Gets the string representation of this enum
4852 *
4853 * \returns String representation of this enum
4854 */
4855 constexpr std::string_view ToString() const
4856 {
4857 switch (value) {
4858 case AnimationDirectionValue::Forward: return "Forward";
4859 case AnimationDirectionValue::Backward: return "Backward";
4860 default: return "Invalid Value";
4861 }
4862 }
4863
4864 CTREXPORT friend std::ostream &operator<<(std::ostream &os, AnimationDirectionValue data);
4865
4866 std::string Serialize() const override
4867 {
4868 return "u_" + std::to_string(this->value);
4869 }
4870};
4871
4872/**
4873 * \brief The behavior of the larson animation pocket of light when it reaches
4874 * the end of the strip.
4875 */
4878
4879 /**
4880 * \brief The animation bounces as soon as the first LED reaches the end of the
4881 * strip.
4882 */
4883 static constexpr int Front = 0;
4884 /**
4885 * \brief The animation bounces once it is midway through the end of the strip.
4886 */
4887 static constexpr int Center = 1;
4888 /**
4889 * \brief The animation bounces once all LEDs are off the strip.
4890 */
4891 static constexpr int Back = 2;
4892
4893 constexpr LarsonBounceValue(int value) :
4894 value{value}
4895 {}
4896
4897 constexpr LarsonBounceValue() :
4898 value{-1}
4899 {}
4900
4901 constexpr bool operator==(LarsonBounceValue other) const
4902 {
4903 return value == other.value;
4904 }
4905 constexpr auto operator<=>(LarsonBounceValue other) const
4906 {
4907 return value <=> other.value;
4908 }
4909
4910 /**
4911 * \brief Gets the string representation of this enum
4912 *
4913 * \returns String representation of this enum
4914 */
4915 constexpr std::string_view ToString() const
4916 {
4917 switch (value) {
4918 case LarsonBounceValue::Front: return "Front";
4919 case LarsonBounceValue::Center: return "Center";
4920 case LarsonBounceValue::Back: return "Back";
4921 default: return "Invalid Value";
4922 }
4923 }
4924
4925 CTREXPORT friend std::ostream &operator<<(std::ostream &os, LarsonBounceValue data);
4926
4927 std::string Serialize() const override
4928 {
4929 return "u_" + std::to_string(this->value);
4930 }
4931};
4932
4933/**
4934 * \brief Whether a temperature sensor should be required for motor control.
4935 * This configuration is ignored in FRC environments and defaults to
4936 * Required.
4937 */
4940
4941 /**
4942 * \brief Temperature sensor is required for motor control.
4943 */
4944 static constexpr int Required = 0;
4945 /**
4946 * \brief Temperature sensor is not required for motor control.
4947 */
4948 static constexpr int Not_Required = 1;
4949
4951 value{value}
4952 {}
4953
4955 value{-1}
4956 {}
4957
4958 constexpr bool operator==(TempSensorRequiredValue other) const
4959 {
4960 return value == other.value;
4961 }
4962 constexpr auto operator<=>(TempSensorRequiredValue other) const
4963 {
4964 return value <=> other.value;
4965 }
4966
4967 /**
4968 * \brief Gets the string representation of this enum
4969 *
4970 * \returns String representation of this enum
4971 */
4972 constexpr std::string_view ToString() const
4973 {
4974 switch (value) {
4975 case TempSensorRequiredValue::Required: return "Required";
4976 case TempSensorRequiredValue::Not_Required: return "Not_Required";
4977 default: return "Invalid Value";
4978 }
4979 }
4980
4981 CTREXPORT friend std::ostream &operator<<(std::ostream &os, TempSensorRequiredValue data);
4982
4983 std::string Serialize() const override
4984 {
4985 return "u_" + std::to_string(this->value);
4986 }
4987};
4988
4989/**
4990 * \brief The behavior of kP output as the error crosses the
4991 * GainSchedErrorThreshold during gain scheduling. The output of kP can
4992 * be adjusted to maintain continuity in output, or it can be left
4993 * discontinuous.
4994 */
4997
4998 /**
4999 * \brief The gain scheduler will maintain continuity in the kP output as the
5000 * error crosses the gain threshold. This results in the best system
5001 * stability, but it may result in output that does not match pOut = kP *
5002 * error.
5003 */
5004 static constexpr int Continuous = 0;
5005 /**
5006 * \brief The gain scheduler will allow for a discontinuity in the kP output.
5007 * This ensures that pOut = kP * error, but it may result in instability
5008 * as the system's error crosses the gain threshold.
5009 */
5010 static constexpr int Discontinuous = 1;
5011
5013 value{value}
5014 {}
5015
5017 value{-1}
5018 {}
5019
5020 constexpr bool operator==(GainSchedKpBehaviorValue other) const
5021 {
5022 return value == other.value;
5023 }
5024 constexpr auto operator<=>(GainSchedKpBehaviorValue other) const
5025 {
5026 return value <=> other.value;
5027 }
5028
5029 /**
5030 * \brief Gets the string representation of this enum
5031 *
5032 * \returns String representation of this enum
5033 */
5034 constexpr std::string_view ToString() const
5035 {
5036 switch (value) {
5037 case GainSchedKpBehaviorValue::Continuous: return "Continuous";
5038 case GainSchedKpBehaviorValue::Discontinuous: return "Discontinuous";
5039 default: return "Invalid Value";
5040 }
5041 }
5042
5043 CTREXPORT friend std::ostream &operator<<(std::ostream &os, GainSchedKpBehaviorValue data);
5044
5045 std::string Serialize() const override
5046 {
5047 return "u_" + std::to_string(this->value);
5048 }
5049};
5050
5051/**
5052 * \brief The behavior of the gain scheduler on this slot. This specifies which
5053 * gains to use while within the configured GainSchedErrorThreshold. The
5054 * default is to continue using the specified slot.
5055 *
5056 * \details Gain scheduling will not take effect when running velocity
5057 * closed-loop controls.
5058 */
5061
5062 /**
5063 * \brief No gain scheduling will occur.
5064 */
5065 static constexpr int Inactive = 0;
5066 /**
5067 * \brief The output of the PID controller will be completely zeroed, except for
5068 * kG and the user FeedForward control request parameter.
5069 */
5070 static constexpr int ZeroOutput = 1;
5071 /**
5072 * \brief Switch to Slot 0 while within the configured GainSchedErrorThreshold.
5073 */
5074 static constexpr int UseSlot0 = 2;
5075 /**
5076 * \brief Switch to Slot 1 while within the configured GainSchedErrorThreshold.
5077 */
5078 static constexpr int UseSlot1 = 3;
5079 /**
5080 * \brief Switch to Slot 2 while within the configured GainSchedErrorThreshold.
5081 */
5082 static constexpr int UseSlot2 = 4;
5083
5085 value{value}
5086 {}
5087
5089 value{-1}
5090 {}
5091
5092 constexpr bool operator==(GainSchedBehaviorValue other) const
5093 {
5094 return value == other.value;
5095 }
5096 constexpr auto operator<=>(GainSchedBehaviorValue other) const
5097 {
5098 return value <=> other.value;
5099 }
5100
5101 /**
5102 * \brief Gets the string representation of this enum
5103 *
5104 * \returns String representation of this enum
5105 */
5106 constexpr std::string_view ToString() const
5107 {
5108 switch (value) {
5109 case GainSchedBehaviorValue::Inactive: return "Inactive";
5110 case GainSchedBehaviorValue::ZeroOutput: return "ZeroOutput";
5111 case GainSchedBehaviorValue::UseSlot0: return "UseSlot0";
5112 case GainSchedBehaviorValue::UseSlot1: return "UseSlot1";
5113 case GainSchedBehaviorValue::UseSlot2: return "UseSlot2";
5114 default: return "Invalid Value";
5115 }
5116 }
5117
5118 CTREXPORT friend std::ostream &operator<<(std::ostream &os, GainSchedBehaviorValue data);
5119
5120 std::string Serialize() const override
5121 {
5122 return "u_" + std::to_string(this->value);
5123 }
5124};
5125
5126/**
5127 * \brief The relationship between two motors in a mechanism. Depending on
5128 * hardware setup, one motor may be inverted relative to the other motor.
5129 */
5132
5133 /**
5134 * \brief The two motor directions are aligned. Positive output on both motors
5135 * moves the mechanism forward/backward.
5136 */
5137 static constexpr int Aligned = 0;
5138 /**
5139 * \brief The two motor directions are opposed. To move forward/backward, one
5140 * motor needs positive output, and the other needs negative output.
5141 */
5142 static constexpr int Opposed = 1;
5143
5145 value{value}
5146 {}
5147
5149 value{-1}
5150 {}
5151
5152 constexpr bool operator==(MotorAlignmentValue other) const
5153 {
5154 return value == other.value;
5155 }
5156 constexpr auto operator<=>(MotorAlignmentValue other) const
5157 {
5158 return value <=> other.value;
5159 }
5160
5161 /**
5162 * \brief Gets the string representation of this enum
5163 *
5164 * \returns String representation of this enum
5165 */
5166 constexpr std::string_view ToString() const
5167 {
5168 switch (value) {
5169 case MotorAlignmentValue::Aligned: return "Aligned";
5170 case MotorAlignmentValue::Opposed: return "Opposed";
5171 default: return "Invalid Value";
5172 }
5173 }
5174
5175 CTREXPORT friend std::ostream &operator<<(std::ostream &os, MotorAlignmentValue data);
5176
5177 std::string Serialize() const override
5178 {
5179 return "u_" + std::to_string(this->value);
5180 }
5181};
5182
5183
5184}
5185}
5186}
Definition Serializable.hpp:14
#define CTREXPORT
Definition export.h:14
Definition motor_constants.h:14
Requires Phoenix Pro; Improves commutation and velocity measurement for motors with hall sensors.
Definition SpnEnums.hpp:2775
std::string Serialize() const override
Definition SpnEnums.hpp:2823
constexpr bool operator==(AdvancedHallSupportValue other) const
Definition SpnEnums.hpp:2798
constexpr AdvancedHallSupportValue()
Definition SpnEnums.hpp:2794
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2812
static constexpr int Enabled
Requires Phoenix Pro; Talon uses advanced features to improve commutation and velocity measurement wh...
Definition SpnEnums.hpp:2788
static constexpr int Disabled
Talon will utilize hall sensors without advanced features.
Definition SpnEnums.hpp:2781
constexpr auto operator<=>(AdvancedHallSupportValue other) const
Definition SpnEnums.hpp:2802
CTREXPORT friend std::ostream & operator<<(std::ostream &os, AdvancedHallSupportValue data)
constexpr AdvancedHallSupportValue(int value)
Definition SpnEnums.hpp:2790
The type of animation running in slot 0 of the CANdle.
Definition SpnEnums.hpp:4067
static constexpr int Rainbow
Rainbow animation.
Definition SpnEnums.hpp:4089
static constexpr int Empty
No animation.
Definition SpnEnums.hpp:4073
constexpr Animation0TypeValue(int value)
Definition SpnEnums.hpp:4111
static constexpr int TwinkleOff
Twinkle off animation.
Definition SpnEnums.hpp:4109
static constexpr int Twinkle
Twinkle animation.
Definition SpnEnums.hpp:4105
constexpr auto operator<=>(Animation0TypeValue other) const
Definition SpnEnums.hpp:4123
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4133
static constexpr int Larson
Larson animation.
Definition SpnEnums.hpp:4085
static constexpr int SingleFade
Single fade animation.
Definition SpnEnums.hpp:4097
static constexpr int RgbFade
RGB Fade animation.
Definition SpnEnums.hpp:4093
std::string Serialize() const override
Definition SpnEnums.hpp:4152
int value
Definition SpnEnums.hpp:4068
static constexpr int Fire
Fire animation.
Definition SpnEnums.hpp:4081
static constexpr int Strobe
Strobe animation.
Definition SpnEnums.hpp:4101
constexpr Animation0TypeValue()
Definition SpnEnums.hpp:4115
static constexpr int ColorFlow
Color flow animation.
Definition SpnEnums.hpp:4077
CTREXPORT friend std::ostream & operator<<(std::ostream &os, Animation0TypeValue data)
constexpr bool operator==(Animation0TypeValue other) const
Definition SpnEnums.hpp:4119
The type of animation running in slot 1 of the CANdle.
Definition SpnEnums.hpp:4161
constexpr Animation1TypeValue()
Definition SpnEnums.hpp:4209
static constexpr int RgbFade
RGB Fade animation.
Definition SpnEnums.hpp:4187
static constexpr int Empty
No animation.
Definition SpnEnums.hpp:4167
int value
Definition SpnEnums.hpp:4162
static constexpr int Rainbow
Rainbow animation.
Definition SpnEnums.hpp:4183
static constexpr int Fire
Fire animation.
Definition SpnEnums.hpp:4175
static constexpr int TwinkleOff
Twinkle off animation.
Definition SpnEnums.hpp:4203
static constexpr int Twinkle
Twinkle animation.
Definition SpnEnums.hpp:4199
static constexpr int Larson
Larson animation.
Definition SpnEnums.hpp:4179
static constexpr int ColorFlow
Color flow animation.
Definition SpnEnums.hpp:4171
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4227
CTREXPORT friend std::ostream & operator<<(std::ostream &os, Animation1TypeValue data)
constexpr auto operator<=>(Animation1TypeValue other) const
Definition SpnEnums.hpp:4217
static constexpr int SingleFade
Single fade animation.
Definition SpnEnums.hpp:4191
std::string Serialize() const override
Definition SpnEnums.hpp:4246
constexpr Animation1TypeValue(int value)
Definition SpnEnums.hpp:4205
constexpr bool operator==(Animation1TypeValue other) const
Definition SpnEnums.hpp:4213
static constexpr int Strobe
Strobe animation.
Definition SpnEnums.hpp:4195
The type of animation running in slot 2 of the CANdle.
Definition SpnEnums.hpp:4255
static constexpr int ColorFlow
Color flow animation.
Definition SpnEnums.hpp:4265
static constexpr int RgbFade
RGB Fade animation.
Definition SpnEnums.hpp:4281
static constexpr int Larson
Larson animation.
Definition SpnEnums.hpp:4273
static constexpr int SingleFade
Single fade animation.
Definition SpnEnums.hpp:4285
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4321
static constexpr int TwinkleOff
Twinkle off animation.
Definition SpnEnums.hpp:4297
static constexpr int Fire
Fire animation.
Definition SpnEnums.hpp:4269
static constexpr int Twinkle
Twinkle animation.
Definition SpnEnums.hpp:4293
constexpr Animation2TypeValue(int value)
Definition SpnEnums.hpp:4299
CTREXPORT friend std::ostream & operator<<(std::ostream &os, Animation2TypeValue data)
constexpr bool operator==(Animation2TypeValue other) const
Definition SpnEnums.hpp:4307
int value
Definition SpnEnums.hpp:4256
std::string Serialize() const override
Definition SpnEnums.hpp:4340
static constexpr int Empty
No animation.
Definition SpnEnums.hpp:4261
static constexpr int Strobe
Strobe animation.
Definition SpnEnums.hpp:4289
constexpr Animation2TypeValue()
Definition SpnEnums.hpp:4303
static constexpr int Rainbow
Rainbow animation.
Definition SpnEnums.hpp:4277
constexpr auto operator<=>(Animation2TypeValue other) const
Definition SpnEnums.hpp:4311
The type of animation running in slot 3 of the CANdle.
Definition SpnEnums.hpp:4349
static constexpr int Rainbow
Rainbow animation.
Definition SpnEnums.hpp:4371
constexpr auto operator<=>(Animation3TypeValue other) const
Definition SpnEnums.hpp:4405
static constexpr int RgbFade
RGB Fade animation.
Definition SpnEnums.hpp:4375
std::string Serialize() const override
Definition SpnEnums.hpp:4434
int value
Definition SpnEnums.hpp:4350
constexpr Animation3TypeValue()
Definition SpnEnums.hpp:4397
static constexpr int SingleFade
Single fade animation.
Definition SpnEnums.hpp:4379
static constexpr int TwinkleOff
Twinkle off animation.
Definition SpnEnums.hpp:4391
constexpr bool operator==(Animation3TypeValue other) const
Definition SpnEnums.hpp:4401
static constexpr int Larson
Larson animation.
Definition SpnEnums.hpp:4367
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4415
static constexpr int Empty
No animation.
Definition SpnEnums.hpp:4355
static constexpr int Fire
Fire animation.
Definition SpnEnums.hpp:4363
constexpr Animation3TypeValue(int value)
Definition SpnEnums.hpp:4393
CTREXPORT friend std::ostream & operator<<(std::ostream &os, Animation3TypeValue data)
static constexpr int Twinkle
Twinkle animation.
Definition SpnEnums.hpp:4387
static constexpr int ColorFlow
Color flow animation.
Definition SpnEnums.hpp:4359
static constexpr int Strobe
Strobe animation.
Definition SpnEnums.hpp:4383
The type of animation running in slot 4 of the CANdle.
Definition SpnEnums.hpp:4443
static constexpr int RgbFade
RGB Fade animation.
Definition SpnEnums.hpp:4469
static constexpr int Rainbow
Rainbow animation.
Definition SpnEnums.hpp:4465
constexpr auto operator<=>(Animation4TypeValue other) const
Definition SpnEnums.hpp:4499
CTREXPORT friend std::ostream & operator<<(std::ostream &os, Animation4TypeValue data)
static constexpr int Twinkle
Twinkle animation.
Definition SpnEnums.hpp:4481
static constexpr int TwinkleOff
Twinkle off animation.
Definition SpnEnums.hpp:4485
constexpr bool operator==(Animation4TypeValue other) const
Definition SpnEnums.hpp:4495
std::string Serialize() const override
Definition SpnEnums.hpp:4528
static constexpr int Fire
Fire animation.
Definition SpnEnums.hpp:4457
static constexpr int Empty
No animation.
Definition SpnEnums.hpp:4449
static constexpr int SingleFade
Single fade animation.
Definition SpnEnums.hpp:4473
static constexpr int ColorFlow
Color flow animation.
Definition SpnEnums.hpp:4453
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4509
constexpr Animation4TypeValue()
Definition SpnEnums.hpp:4491
static constexpr int Larson
Larson animation.
Definition SpnEnums.hpp:4461
constexpr Animation4TypeValue(int value)
Definition SpnEnums.hpp:4487
int value
Definition SpnEnums.hpp:4444
static constexpr int Strobe
Strobe animation.
Definition SpnEnums.hpp:4477
The type of animation running in slot 5 of the CANdle.
Definition SpnEnums.hpp:4537
static constexpr int SingleFade
Single fade animation.
Definition SpnEnums.hpp:4567
static constexpr int TwinkleOff
Twinkle off animation.
Definition SpnEnums.hpp:4579
static constexpr int Twinkle
Twinkle animation.
Definition SpnEnums.hpp:4575
constexpr Animation5TypeValue(int value)
Definition SpnEnums.hpp:4581
static constexpr int Rainbow
Rainbow animation.
Definition SpnEnums.hpp:4559
static constexpr int Strobe
Strobe animation.
Definition SpnEnums.hpp:4571
int value
Definition SpnEnums.hpp:4538
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4603
constexpr bool operator==(Animation5TypeValue other) const
Definition SpnEnums.hpp:4589
static constexpr int Empty
No animation.
Definition SpnEnums.hpp:4543
std::string Serialize() const override
Definition SpnEnums.hpp:4622
constexpr auto operator<=>(Animation5TypeValue other) const
Definition SpnEnums.hpp:4593
static constexpr int Larson
Larson animation.
Definition SpnEnums.hpp:4555
static constexpr int Fire
Fire animation.
Definition SpnEnums.hpp:4551
static constexpr int RgbFade
RGB Fade animation.
Definition SpnEnums.hpp:4563
CTREXPORT friend std::ostream & operator<<(std::ostream &os, Animation5TypeValue data)
static constexpr int ColorFlow
Color flow animation.
Definition SpnEnums.hpp:4547
constexpr Animation5TypeValue()
Definition SpnEnums.hpp:4585
The type of animation running in slot 6 of the CANdle.
Definition SpnEnums.hpp:4631
CTREXPORT friend std::ostream & operator<<(std::ostream &os, Animation6TypeValue data)
static constexpr int SingleFade
Single fade animation.
Definition SpnEnums.hpp:4661
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4697
constexpr Animation6TypeValue()
Definition SpnEnums.hpp:4679
std::string Serialize() const override
Definition SpnEnums.hpp:4716
static constexpr int TwinkleOff
Twinkle off animation.
Definition SpnEnums.hpp:4673
static constexpr int RgbFade
RGB Fade animation.
Definition SpnEnums.hpp:4657
constexpr auto operator<=>(Animation6TypeValue other) const
Definition SpnEnums.hpp:4687
constexpr bool operator==(Animation6TypeValue other) const
Definition SpnEnums.hpp:4683
static constexpr int Twinkle
Twinkle animation.
Definition SpnEnums.hpp:4669
static constexpr int Fire
Fire animation.
Definition SpnEnums.hpp:4645
static constexpr int Empty
No animation.
Definition SpnEnums.hpp:4637
static constexpr int Larson
Larson animation.
Definition SpnEnums.hpp:4649
static constexpr int Rainbow
Rainbow animation.
Definition SpnEnums.hpp:4653
constexpr Animation6TypeValue(int value)
Definition SpnEnums.hpp:4675
static constexpr int Strobe
Strobe animation.
Definition SpnEnums.hpp:4665
int value
Definition SpnEnums.hpp:4632
static constexpr int ColorFlow
Color flow animation.
Definition SpnEnums.hpp:4641
The type of animation running in slot 7 of the CANdle.
Definition SpnEnums.hpp:4725
static constexpr int Rainbow
Rainbow animation.
Definition SpnEnums.hpp:4747
constexpr auto operator<=>(Animation7TypeValue other) const
Definition SpnEnums.hpp:4781
CTREXPORT friend std::ostream & operator<<(std::ostream &os, Animation7TypeValue data)
int value
Definition SpnEnums.hpp:4726
static constexpr int TwinkleOff
Twinkle off animation.
Definition SpnEnums.hpp:4767
static constexpr int Larson
Larson animation.
Definition SpnEnums.hpp:4743
std::string Serialize() const override
Definition SpnEnums.hpp:4810
static constexpr int Fire
Fire animation.
Definition SpnEnums.hpp:4739
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4791
constexpr Animation7TypeValue()
Definition SpnEnums.hpp:4773
static constexpr int ColorFlow
Color flow animation.
Definition SpnEnums.hpp:4735
static constexpr int Twinkle
Twinkle animation.
Definition SpnEnums.hpp:4763
static constexpr int RgbFade
RGB Fade animation.
Definition SpnEnums.hpp:4751
constexpr Animation7TypeValue(int value)
Definition SpnEnums.hpp:4769
static constexpr int Strobe
Strobe animation.
Definition SpnEnums.hpp:4759
constexpr bool operator==(Animation7TypeValue other) const
Definition SpnEnums.hpp:4777
static constexpr int SingleFade
Single fade animation.
Definition SpnEnums.hpp:4755
static constexpr int Empty
No animation.
Definition SpnEnums.hpp:4731
Direction of the animation.
Definition SpnEnums.hpp:4819
constexpr AnimationDirectionValue()
Definition SpnEnums.hpp:4837
static constexpr int Backward
The animation starts at the specified LED end index and moves towards the LED start index.
Definition SpnEnums.hpp:4831
CTREXPORT friend std::ostream & operator<<(std::ostream &os, AnimationDirectionValue data)
int value
Definition SpnEnums.hpp:4820
constexpr AnimationDirectionValue(int value)
Definition SpnEnums.hpp:4833
static constexpr int Forward
The animation starts at the specified LED start index and moves towards the LED end index.
Definition SpnEnums.hpp:4826
std::string Serialize() const override
Definition SpnEnums.hpp:4866
constexpr auto operator<=>(AnimationDirectionValue other) const
Definition SpnEnums.hpp:4845
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4855
constexpr bool operator==(AnimationDirectionValue other) const
Definition SpnEnums.hpp:4841
The applied rotor polarity as seen from the front of the motor.
Definition SpnEnums.hpp:731
constexpr AppliedRotorPolarityValue(int value)
Definition SpnEnums.hpp:743
std::string Serialize() const override
Definition SpnEnums.hpp:776
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:765
constexpr bool operator==(AppliedRotorPolarityValue other) const
Definition SpnEnums.hpp:751
constexpr AppliedRotorPolarityValue()
Definition SpnEnums.hpp:747
constexpr auto operator<=>(AppliedRotorPolarityValue other) const
Definition SpnEnums.hpp:755
static constexpr int PositiveIsClockwise
Positive motor output results in clockwise motion.
Definition SpnEnums.hpp:741
CTREXPORT friend std::ostream & operator<<(std::ostream &os, AppliedRotorPolarityValue data)
static constexpr int PositiveIsCounterClockwise
Positive motor output results in counter-clockwise motion.
Definition SpnEnums.hpp:737
The applied output of the bridge.
Definition SpnEnums.hpp:2256
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2292
static constexpr int BridgeReq_VariableBrake
Definition SpnEnums.hpp:2268
static constexpr int BridgeReq_FaultCoast
Definition SpnEnums.hpp:2266
static constexpr int BridgeReq_FOCEasy
Definition SpnEnums.hpp:2264
CTREXPORT friend std::ostream & operator<<(std::ostream &os, BridgeOutputValue data)
static constexpr int BridgeReq_Trapez
Definition SpnEnums.hpp:2261
static constexpr int BridgeReq_ActiveBrake
Definition SpnEnums.hpp:2267
constexpr BridgeOutputValue(int value)
Definition SpnEnums.hpp:2270
static constexpr int BridgeReq_MusicTone
Definition SpnEnums.hpp:2263
constexpr auto operator<=>(BridgeOutputValue other) const
Definition SpnEnums.hpp:2282
constexpr bool operator==(BridgeOutputValue other) const
Definition SpnEnums.hpp:2278
std::string Serialize() const override
Definition SpnEnums.hpp:2311
static constexpr int BridgeReq_Brake
Definition SpnEnums.hpp:2260
static constexpr int BridgeReq_FOCTorque
Definition SpnEnums.hpp:2262
constexpr BridgeOutputValue()
Definition SpnEnums.hpp:2274
int value
Definition SpnEnums.hpp:2257
static constexpr int BridgeReq_FaultBrake
Definition SpnEnums.hpp:2265
static constexpr int BridgeReq_Coast
Definition SpnEnums.hpp:2259
If a brushed motor is selected with Motor Arrangement, this config determines which of three leads to...
Definition SpnEnums.hpp:3686
int value
Definition SpnEnums.hpp:3687
constexpr BrushedMotorWiringValue(int value)
Definition SpnEnums.hpp:3726
CTREXPORT friend std::ostream & operator<<(std::ostream &os, BrushedMotorWiringValue data)
static constexpr int Leads_A_and_B
Third party brushed DC motor with two leads.
Definition SpnEnums.hpp:3700
std::string Serialize() const override
Definition SpnEnums.hpp:3760
constexpr bool operator==(BrushedMotorWiringValue other) const
Definition SpnEnums.hpp:3734
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3748
constexpr auto operator<=>(BrushedMotorWiringValue other) const
Definition SpnEnums.hpp:3738
static constexpr int Leads_B_and_C
Third party brushed DC motor with two leads.
Definition SpnEnums.hpp:3724
static constexpr int Leads_A_and_C
Third party brushed DC motor with two leads.
Definition SpnEnums.hpp:3712
constexpr BrushedMotorWiringValue()
Definition SpnEnums.hpp:3730
The type of motor attached to the Talon.
Definition SpnEnums.hpp:2538
int value
Definition SpnEnums.hpp:2539
static constexpr int Falcon500_Integrated
Talon is attached to an integrated Falcon motor.
Definition SpnEnums.hpp:2548
static constexpr int NEO550_JST
Talon is connected to a third party NEO550 brushless three phase motor.
Definition SpnEnums.hpp:2585
static constexpr int KrakenX44_Integrated
Talon is attached to an integrated Kraken X44 motor.
Definition SpnEnums.hpp:2556
constexpr bool operator==(ConnectedMotorValue other) const
Definition SpnEnums.hpp:2605
static constexpr int Brushed_AC
Talon is connected to a third party brushed DC motor with leads A and C.
Definition SpnEnums.hpp:2571
CTREXPORT friend std::ostream & operator<<(std::ostream &os, ConnectedMotorValue data)
static constexpr int CustomBrushless
Talon is connected to a custom brushless three phase motor.
Definition SpnEnums.hpp:2595
constexpr auto operator<=>(ConnectedMotorValue other) const
Definition SpnEnums.hpp:2609
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2619
static constexpr int NEO_JST
Talon is connected to a third party NEO brushless three phase motor.
Definition SpnEnums.hpp:2580
static constexpr int Brushed_AB
Talon is connected to a third party brushed DC motor with leads A and B.
Definition SpnEnums.hpp:2566
static constexpr int Brushed_BC
Talon is connected to a third party brushed DC motor with leads B and C.
Definition SpnEnums.hpp:2576
std::string Serialize() const override
Definition SpnEnums.hpp:2640
constexpr ConnectedMotorValue(int value)
Definition SpnEnums.hpp:2597
static constexpr int Minion_JST
Talon is connected to a CTR Electronics Minion® brushless three phase motor.
Definition SpnEnums.hpp:2561
static constexpr int KrakenX60_Integrated
Talon is attached to an integrated Kraken X60 motor.
Definition SpnEnums.hpp:2552
constexpr ConnectedMotorValue()
Definition SpnEnums.hpp:2601
static constexpr int VORTEX_JST
Talon is connected to a third party VORTEX brushless three phase motor.
Definition SpnEnums.hpp:2590
static constexpr int Unknown
Talon could not determine the type of motor attached.
Definition SpnEnums.hpp:2544
The active control mode of the motor controller.
Definition SpnEnums.hpp:785
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:849
static constexpr int MotionMagicVoltage
Definition SpnEnums.hpp:802
static constexpr int PositionDutyCycle
Definition SpnEnums.hpp:792
static constexpr int Follower
Definition SpnEnums.hpp:811
static constexpr int MotionMagicExpoDutyCycleFOC
Definition SpnEnums.hpp:822
static constexpr int VelocityVoltage
Definition SpnEnums.hpp:801
static constexpr int VoltageFOC
Definition SpnEnums.hpp:803
static constexpr int MotionMagicDutyCycleFOC
Definition SpnEnums.hpp:798
static constexpr int DutyCycleFOC
Definition SpnEnums.hpp:795
static constexpr int MusicTone
Definition SpnEnums.hpp:815
static constexpr int VelocityDutyCycleFOC
Definition SpnEnums.hpp:797
int value
Definition SpnEnums.hpp:786
static constexpr int MotionMagicExpoDutyCycle
Definition SpnEnums.hpp:821
static constexpr int MotionMagicVoltageFOC
Definition SpnEnums.hpp:806
CTREXPORT friend std::ostream & operator<<(std::ostream &os, ControlModeValue data)
static constexpr int CoastOut
Definition SpnEnums.hpp:813
static constexpr int DisabledOutput
Definition SpnEnums.hpp:788
static constexpr int NeutralOut
Definition SpnEnums.hpp:789
static constexpr int MotionMagicVelocityVoltageFOC
Definition SpnEnums.hpp:819
static constexpr int MotionMagicExpoVoltage
Definition SpnEnums.hpp:823
static constexpr int VoltageOut
Definition SpnEnums.hpp:799
static constexpr int MotionMagicExpoTorqueCurrentFOC
Definition SpnEnums.hpp:825
std::string Serialize() const override
Definition SpnEnums.hpp:896
static constexpr int VelocityTorqueCurrentFOC
Definition SpnEnums.hpp:809
static constexpr int MotionMagicExpoVoltageFOC
Definition SpnEnums.hpp:824
constexpr ControlModeValue()
Definition SpnEnums.hpp:831
static constexpr int MotionMagicVelocityVoltage
Definition SpnEnums.hpp:818
static constexpr int MotionMagicVelocityDutyCycle
Definition SpnEnums.hpp:816
static constexpr int PositionVoltage
Definition SpnEnums.hpp:800
constexpr auto operator<=>(ControlModeValue other) const
Definition SpnEnums.hpp:839
static constexpr int PositionTorqueCurrentFOC
Definition SpnEnums.hpp:808
static constexpr int VelocityVoltageFOC
Definition SpnEnums.hpp:805
static constexpr int Reserved
Definition SpnEnums.hpp:812
static constexpr int MotionMagicTorqueCurrentFOC
Definition SpnEnums.hpp:810
static constexpr int PositionVoltageFOC
Definition SpnEnums.hpp:804
static constexpr int MotionMagicDutyCycle
Definition SpnEnums.hpp:794
constexpr bool operator==(ControlModeValue other) const
Definition SpnEnums.hpp:835
static constexpr int PositionDutyCycleFOC
Definition SpnEnums.hpp:796
static constexpr int TorqueCurrentFOC
Definition SpnEnums.hpp:807
static constexpr int UnauthorizedDevice
Definition SpnEnums.hpp:814
static constexpr int StaticBrake
Definition SpnEnums.hpp:790
static constexpr int MotionMagicVelocityTorqueCurrentFOC
Definition SpnEnums.hpp:820
static constexpr int VelocityDutyCycle
Definition SpnEnums.hpp:793
static constexpr int DutyCycleOut
Definition SpnEnums.hpp:791
constexpr ControlModeValue(int value)
Definition SpnEnums.hpp:827
static constexpr int MotionMagicVelocityDutyCycleFOC
Definition SpnEnums.hpp:817
Whether the device is enabled.
Definition SpnEnums.hpp:585
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:613
int value
Definition SpnEnums.hpp:586
constexpr auto operator<=>(DeviceEnableValue other) const
Definition SpnEnums.hpp:603
static constexpr int Enabled
Definition SpnEnums.hpp:588
std::string Serialize() const override
Definition SpnEnums.hpp:624
constexpr bool operator==(DeviceEnableValue other) const
Definition SpnEnums.hpp:599
constexpr DeviceEnableValue()
Definition SpnEnums.hpp:595
CTREXPORT friend std::ostream & operator<<(std::ostream &os, DeviceEnableValue data)
constexpr DeviceEnableValue(int value)
Definition SpnEnums.hpp:591
static constexpr int Disabled
Definition SpnEnums.hpp:589
The output mode of the differential PID controller.
Definition SpnEnums.hpp:1376
std::string Serialize() const override
Definition SpnEnums.hpp:1417
constexpr DiffPIDOutput_PIDOutputModeValue()
Definition SpnEnums.hpp:1387
static constexpr int TorqueCurrentFOC
Definition SpnEnums.hpp:1381
constexpr bool operator==(DiffPIDOutput_PIDOutputModeValue other) const
Definition SpnEnums.hpp:1391
constexpr auto operator<=>(DiffPIDOutput_PIDOutputModeValue other) const
Definition SpnEnums.hpp:1395
constexpr DiffPIDOutput_PIDOutputModeValue(int value)
Definition SpnEnums.hpp:1383
static constexpr int Voltage
Definition SpnEnums.hpp:1380
static constexpr int DutyCycle
Definition SpnEnums.hpp:1379
CTREXPORT friend std::ostream & operator<<(std::ostream &os, DiffPIDOutput_PIDOutputModeValue data)
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1405
Whether the closed-loop is running on position or velocity.
Definition SpnEnums.hpp:1328
std::string Serialize() const override
Definition SpnEnums.hpp:1367
CTREXPORT friend std::ostream & operator<<(std::ostream &os, DiffPIDRefPIDErr_ClosedLoopModeValue data)
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1356
constexpr DiffPIDRefPIDErr_ClosedLoopModeValue()
Definition SpnEnums.hpp:1338
static constexpr int Velocity
Definition SpnEnums.hpp:1332
constexpr DiffPIDRefPIDErr_ClosedLoopModeValue(int value)
Definition SpnEnums.hpp:1334
constexpr auto operator<=>(DiffPIDRefPIDErr_ClosedLoopModeValue other) const
Definition SpnEnums.hpp:1346
static constexpr int Position
Definition SpnEnums.hpp:1331
constexpr bool operator==(DiffPIDRefPIDErr_ClosedLoopModeValue other) const
Definition SpnEnums.hpp:1342
Whether the closed-loop is running on position or velocity.
Definition SpnEnums.hpp:1426
CTREXPORT friend std::ostream & operator<<(std::ostream &os, DiffPIDRefSlopeECUTime_ClosedLoopModeValue data)
static constexpr int Position
Definition SpnEnums.hpp:1429
constexpr DiffPIDRefSlopeECUTime_ClosedLoopModeValue()
Definition SpnEnums.hpp:1436
constexpr bool operator==(DiffPIDRefSlopeECUTime_ClosedLoopModeValue other) const
Definition SpnEnums.hpp:1440
constexpr DiffPIDRefSlopeECUTime_ClosedLoopModeValue(int value)
Definition SpnEnums.hpp:1432
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1454
constexpr auto operator<=>(DiffPIDRefSlopeECUTime_ClosedLoopModeValue other) const
Definition SpnEnums.hpp:1444
static constexpr int Velocity
Definition SpnEnums.hpp:1430
std::string Serialize() const override
Definition SpnEnums.hpp:1465
The active control mode of the differential controller.
Definition SpnEnums.hpp:1208
static constexpr int MotionMagicVoltage
Definition SpnEnums.hpp:1225
static constexpr int NeutralOut
Definition SpnEnums.hpp:1212
static constexpr int PositionDutyCycle
Definition SpnEnums.hpp:1215
static constexpr int MotionMagicVelocityVoltageFOC
Definition SpnEnums.hpp:1242
static constexpr int VelocityTorqueCurrentFOC
Definition SpnEnums.hpp:1232
static constexpr int MotionMagicVelocityDutyCycleFOC
Definition SpnEnums.hpp:1240
static constexpr int Reserved
Definition SpnEnums.hpp:1235
static constexpr int PositionVoltageFOC
Definition SpnEnums.hpp:1227
static constexpr int MotionMagicTorqueCurrentFOC
Definition SpnEnums.hpp:1233
static constexpr int MotionMagicVelocityDutyCycle
Definition SpnEnums.hpp:1239
static constexpr int VelocityDutyCycleFOC
Definition SpnEnums.hpp:1220
static constexpr int TorqueCurrentFOC
Definition SpnEnums.hpp:1230
static constexpr int MotionMagicExpoDutyCycleFOC
Definition SpnEnums.hpp:1245
static constexpr int VoltageOut
Definition SpnEnums.hpp:1222
static constexpr int VelocityVoltageFOC
Definition SpnEnums.hpp:1228
static constexpr int MotionMagicDutyCycleFOC
Definition SpnEnums.hpp:1221
static constexpr int MusicTone
Definition SpnEnums.hpp:1238
static constexpr int MotionMagicVoltageFOC
Definition SpnEnums.hpp:1229
constexpr bool operator==(DifferentialControlModeValue other) const
Definition SpnEnums.hpp:1258
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1272
static constexpr int MotionMagicExpoTorqueCurrentFOC
Definition SpnEnums.hpp:1248
static constexpr int Follower
Definition SpnEnums.hpp:1234
static constexpr int UnauthorizedDevice
Definition SpnEnums.hpp:1237
static constexpr int MotionMagicExpoVoltage
Definition SpnEnums.hpp:1246
static constexpr int MotionMagicVelocityVoltage
Definition SpnEnums.hpp:1241
static constexpr int MotionMagicExpoDutyCycle
Definition SpnEnums.hpp:1244
static constexpr int DisabledOutput
Definition SpnEnums.hpp:1211
static constexpr int VoltageFOC
Definition SpnEnums.hpp:1226
constexpr DifferentialControlModeValue()
Definition SpnEnums.hpp:1254
static constexpr int DutyCycleOut
Definition SpnEnums.hpp:1214
CTREXPORT friend std::ostream & operator<<(std::ostream &os, DifferentialControlModeValue data)
static constexpr int MotionMagicExpoVoltageFOC
Definition SpnEnums.hpp:1247
static constexpr int PositionVoltage
Definition SpnEnums.hpp:1223
static constexpr int StaticBrake
Definition SpnEnums.hpp:1213
static constexpr int PositionTorqueCurrentFOC
Definition SpnEnums.hpp:1231
static constexpr int MotionMagicVelocityTorqueCurrentFOC
Definition SpnEnums.hpp:1243
static constexpr int MotionMagicDutyCycle
Definition SpnEnums.hpp:1217
constexpr auto operator<=>(DifferentialControlModeValue other) const
Definition SpnEnums.hpp:1262
static constexpr int VelocityDutyCycle
Definition SpnEnums.hpp:1216
static constexpr int PositionDutyCycleFOC
Definition SpnEnums.hpp:1219
std::string Serialize() const override
Definition SpnEnums.hpp:1319
static constexpr int CoastOut
Definition SpnEnums.hpp:1236
static constexpr int DutyCycleFOC
Definition SpnEnums.hpp:1218
constexpr DifferentialControlModeValue(int value)
Definition SpnEnums.hpp:1250
static constexpr int VelocityVoltage
Definition SpnEnums.hpp:1224
Choose what sensor source is used for differential control of a mechanism.
Definition SpnEnums.hpp:2343
static constexpr int Disabled
Disable differential control.
Definition SpnEnums.hpp:2349
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:2388
constexpr bool operator==(DifferentialSensorSourceValue other) const
Definition SpnEnums.hpp:2422
CTREXPORT friend std::ostream & operator<<(std::ostream &os, DifferentialSensorSourceValue data)
std::string Serialize() const override
Definition SpnEnums.hpp:2454
static constexpr int RemoteCANdiPWM2
Use a pulse-width encoder remotely attached to the Sensor Input 2 (S2IN) on the CTR Electronics' CANd...
Definition SpnEnums.hpp:2404
static constexpr int RemoteCANdiPWM1
Use a pulse-width encoder remotely attached to the Sensor Input 1 (S1IN) on the CTR Electronics' CANd...
Definition SpnEnums.hpp:2396
static constexpr int RemoteTalonFX_HalfDiff
Use another TalonFX on the same CAN bus.
Definition SpnEnums.hpp:2357
static constexpr int RemoteCANdiQuadrature
Use a quadrature encoder remotely attached to the two Sensor Inputs on the CTR Electronics' CANdi™ (t...
Definition SpnEnums.hpp:2412
static constexpr int RemotePigeon2Yaw
Use another Pigeon2 on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:2365
static constexpr int RemotePigeon2Roll
Use another Pigeon2 on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:2381
constexpr DifferentialSensorSourceValue()
Definition SpnEnums.hpp:2418
constexpr auto operator<=>(DifferentialSensorSourceValue other) const
Definition SpnEnums.hpp:2426
static constexpr int RemotePigeon2Pitch
Use another Pigeon2 on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:2373
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2436
constexpr DifferentialSensorSourceValue(int value)
Definition SpnEnums.hpp:2414
Whether the 5V rail is enabled.
Definition SpnEnums.hpp:3898
CTREXPORT friend std::ostream & operator<<(std::ostream &os, Enable5VRailValue data)
std::string Serialize() const override
Definition SpnEnums.hpp:3943
constexpr auto operator<=>(Enable5VRailValue other) const
Definition SpnEnums.hpp:3922
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3932
static constexpr int Enabled
The 5V rail is enabled, allowing for LED control.
Definition SpnEnums.hpp:3904
static constexpr int Disabled
The 5V rail is disabled.
Definition SpnEnums.hpp:3908
int value
Definition SpnEnums.hpp:3899
constexpr Enable5VRailValue(int value)
Definition SpnEnums.hpp:3910
constexpr Enable5VRailValue()
Definition SpnEnums.hpp:3914
constexpr bool operator==(Enable5VRailValue other) const
Definition SpnEnums.hpp:3918
Choose what sensor source is reported via API and used by closed-loop and limit features.
Definition SpnEnums.hpp:3271
static constexpr int RemotePigeon2Yaw
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:3291
static constexpr int RemoteCANdiQuadrature
Use a quadrature encoder remotely attached to the two Sensor Inputs on CANdi™ (this also requires set...
Definition SpnEnums.hpp:3358
static constexpr int SyncCANcoder
Requires Phoenix Pro; Talon will synchronize its commutation sensor position against another CANcoder...
Definition SpnEnums.hpp:3325
static constexpr int FusedCANdiPWM2
Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely attached to the Sensor Input 2 (...
Definition SpnEnums.hpp:3374
constexpr auto operator<=>(ExternalFeedbackSensorSourceValue other) const
Definition SpnEnums.hpp:3419
std::string Serialize() const override
Definition SpnEnums.hpp:3455
static constexpr int SyncCANdiPWM1
Requires Phoenix Pro; Talon will synchronize its internal rotor position against the pulse-width enco...
Definition SpnEnums.hpp:3393
CTREXPORT friend std::ostream & operator<<(std::ostream &os, ExternalFeedbackSensorSourceValue data)
static constexpr int FusedCANdiQuadrature
Requires Phoenix Pro; Talon will fuse a qaudrature encoder remotely attached to the two Sensor Inputs...
Definition SpnEnums.hpp:3381
static constexpr int RemoteCANdiPWM1
Use a pulse-width encoder remotely attached to the Sensor Input 1 (S1IN) on CANdi™ (this also require...
Definition SpnEnums.hpp:3343
static constexpr int SyncCANdiPWM2
Requires Phoenix Pro; Talon will synchronize its internal rotor position against the pulse-width enco...
Definition SpnEnums.hpp:3405
constexpr ExternalFeedbackSensorSourceValue()
Definition SpnEnums.hpp:3411
static constexpr int RemotePigeon2Roll
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:3305
static constexpr int Commutation
Use the external sensor used for motor commutation.
Definition SpnEnums.hpp:3277
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:3284
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3429
constexpr bool operator==(ExternalFeedbackSensorSourceValue other) const
Definition SpnEnums.hpp:3415
static constexpr int FusedCANdiPWM1
Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely attached to the Sensor Input 1 (...
Definition SpnEnums.hpp:3366
constexpr ExternalFeedbackSensorSourceValue(int value)
Definition SpnEnums.hpp:3407
static constexpr int RemotePigeon2Pitch
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:3298
static constexpr int FusedCANcoder
Requires Phoenix Pro; Talon will fuse another CANcoder's information with the commutation sensor,...
Definition SpnEnums.hpp:3313
static constexpr int RemoteCANdiPWM2
Use a pulse-width encoder remotely attached to the Sensor Input 2 (S2IN) on CANdi™ (this also require...
Definition SpnEnums.hpp:3351
static constexpr int Quadrature
Use a quadrature encoder directly attached to the Talon data port.
Definition SpnEnums.hpp:3330
static constexpr int PulseWidth
Use a pulse-width encoder directly attached to the Talon data port.
Definition SpnEnums.hpp:3335
Status of the temperature sensor of the external motor.
Definition SpnEnums.hpp:905
constexpr auto operator<=>(ExternalMotorTempStatusValue other) const
Definition SpnEnums.hpp:947
std::string Serialize() const override
Definition SpnEnums.hpp:972
static constexpr int Normal
Temperature sensor is normal.
Definition SpnEnums.hpp:923
static constexpr int Collecting
Talon is collecting information on the sensor.
Definition SpnEnums.hpp:911
static constexpr int NotUsed
Temperature sensor is present but is not used.
Definition SpnEnums.hpp:928
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:957
static constexpr int TooHot
Temperature sensor is too hot to allow motor operation.
Definition SpnEnums.hpp:919
static constexpr int WrongMotorOrShorted
Temperature sensor appears to be for the wrong motor arrangement, or signals are shorted.
Definition SpnEnums.hpp:933
static constexpr int Disconnected
Temperature sensor appears to be disconnected.
Definition SpnEnums.hpp:915
CTREXPORT friend std::ostream & operator<<(std::ostream &os, ExternalMotorTempStatusValue data)
constexpr ExternalMotorTempStatusValue(int value)
Definition SpnEnums.hpp:935
constexpr bool operator==(ExternalMotorTempStatusValue other) const
Definition SpnEnums.hpp:943
constexpr ExternalMotorTempStatusValue()
Definition SpnEnums.hpp:939
Choose what sensor source is reported via API and used by closed-loop and limit features.
Definition SpnEnums.hpp:1686
constexpr FeedbackSensorSourceValue(int value)
Definition SpnEnums.hpp:1813
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:1699
static constexpr int FusedCANdiQuadrature
Requires Phoenix Pro; Talon will fuse a qaudrature encoder remotely attached to the two Sensor Inputs...
Definition SpnEnums.hpp:1787
static constexpr int RemotePigeon2Pitch
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:1713
static constexpr int RemotePigeon2Yaw
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:1706
constexpr bool operator==(FeedbackSensorSourceValue other) const
Definition SpnEnums.hpp:1821
static constexpr int SyncCANdiPWM2
Requires Phoenix Pro; Talon will synchronize its internal rotor position against the pulse-width enco...
Definition SpnEnums.hpp:1811
static constexpr int RemoteCANdiPWM2
Use a pulse-width encoder remotely attached to the Sensor Input 2 (S2IN) on the CTR Electronics' CANd...
Definition SpnEnums.hpp:1756
constexpr FeedbackSensorSourceValue()
Definition SpnEnums.hpp:1817
static constexpr int RemoteCANdiQuadrature
Use a quadrature encoder remotely attached to the two Sensor Inputs on the CTR Electronics' CANdi™ (t...
Definition SpnEnums.hpp:1764
CTREXPORT friend std::ostream & operator<<(std::ostream &os, FeedbackSensorSourceValue data)
constexpr auto operator<=>(FeedbackSensorSourceValue other) const
Definition SpnEnums.hpp:1825
static constexpr int SyncCANdiPWM1
Requires Phoenix Pro; Talon will synchronize its internal rotor position against the pulse-width enco...
Definition SpnEnums.hpp:1799
static constexpr int SyncCANcoder
Requires Phoenix Pro; Talon will synchronize its internal rotor position against another CANcoder,...
Definition SpnEnums.hpp:1740
static constexpr int RemoteCANdiPWM1
Use a pulse-width encoder remotely attached to the Sensor Input 1 (S1IN) on the CTR Electronics' CANd...
Definition SpnEnums.hpp:1748
static constexpr int FusedCANdiPWM1
Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely attached to the Sensor Input 1 (...
Definition SpnEnums.hpp:1772
static constexpr int RotorSensor
Use the internal rotor sensor in the Talon.
Definition SpnEnums.hpp:1692
static constexpr int FusedCANcoder
Requires Phoenix Pro; Talon will fuse another CANcoder's information with the internal rotor,...
Definition SpnEnums.hpp:1728
static constexpr int FusedCANdiPWM2
Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely attached to the Sensor Input 2 (...
Definition SpnEnums.hpp:1780
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1835
std::string Serialize() const override
Definition SpnEnums.hpp:1859
static constexpr int RemotePigeon2Roll
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:1720
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
std::string Serialize() const override
Definition SpnEnums.hpp:2019
static constexpr int RemoteCANdiS1
Use another CTR Electronics' CANdi™ on the same CAN bus (this also requires setting ForwardLimitRemot...
Definition SpnEnums.hpp:1967
static constexpr int RemoteTalonFX
Use the forward limit switch attached to another Talon FX on the same CAN bus (this also requires set...
Definition SpnEnums.hpp:1942
constexpr auto operator<=>(ForwardLimitSourceValue other) const
Definition SpnEnums.hpp:1992
constexpr ForwardLimitSourceValue(int value)
Definition SpnEnums.hpp:1980
constexpr ForwardLimitSourceValue()
Definition SpnEnums.hpp:1984
CTREXPORT friend std::ostream & operator<<(std::ostream &os, ForwardLimitSourceValue data)
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2002
static constexpr int RemoteCANifier
Use the forward limit switch attached to another CANifier on the same CAN bus (this also requires set...
Definition SpnEnums.hpp:1947
constexpr bool operator==(ForwardLimitSourceValue other) const
Definition SpnEnums.hpp:1988
static constexpr int RemoteCANdiS2
Use another CTR Electronics' CANdi™ on the same CAN bus (this also requires setting ForwardLimitRemot...
Definition SpnEnums.hpp:1974
int value
Definition SpnEnums.hpp:1932
static constexpr int Disabled
Disable the forward limit switch.
Definition SpnEnums.hpp:1978
static constexpr int RemoteCANrange
Use another CANrange on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Definition SpnEnums.hpp:1960
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Definition SpnEnums.hpp:1954
Determines if the forward limit switch is normally-open (default) or normally-closed.
Definition SpnEnums.hpp:1869
std::string Serialize() const override
Definition SpnEnums.hpp:1908
constexpr bool operator==(ForwardLimitTypeValue other) const
Definition SpnEnums.hpp:1883
static constexpr int NormallyClosed
Definition SpnEnums.hpp:1873
constexpr ForwardLimitTypeValue()
Definition SpnEnums.hpp:1879
constexpr ForwardLimitTypeValue(int value)
Definition SpnEnums.hpp:1875
constexpr auto operator<=>(ForwardLimitTypeValue other) const
Definition SpnEnums.hpp:1887
static constexpr int NormallyOpen
Definition SpnEnums.hpp:1872
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1897
CTREXPORT friend std::ostream & operator<<(std::ostream &os, ForwardLimitTypeValue data)
int value
Definition SpnEnums.hpp:1870
Forward Limit Pin.
Definition SpnEnums.hpp:633
CTREXPORT friend std::ostream & operator<<(std::ostream &os, ForwardLimitValue data)
constexpr ForwardLimitValue(int value)
Definition SpnEnums.hpp:639
std::string Serialize() const override
Definition SpnEnums.hpp:672
static constexpr int ClosedToGround
Definition SpnEnums.hpp:636
constexpr ForwardLimitValue()
Definition SpnEnums.hpp:643
constexpr bool operator==(ForwardLimitValue other) const
Definition SpnEnums.hpp:647
constexpr auto operator<=>(ForwardLimitValue other) const
Definition SpnEnums.hpp:651
int value
Definition SpnEnums.hpp:634
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:661
static constexpr int Open
Definition SpnEnums.hpp:637
Whether device is locked by FRC.
Definition SpnEnums.hpp:249
constexpr auto operator<=>(FrcLockValue other) const
Definition SpnEnums.hpp:267
static constexpr int Frc_Locked
Definition SpnEnums.hpp:252
CTREXPORT friend std::ostream & operator<<(std::ostream &os, FrcLockValue data)
constexpr FrcLockValue(int value)
Definition SpnEnums.hpp:255
static constexpr int Frc_Unlocked
Definition SpnEnums.hpp:253
int value
Definition SpnEnums.hpp:250
constexpr FrcLockValue()
Definition SpnEnums.hpp:259
constexpr bool operator==(FrcLockValue other) const
Definition SpnEnums.hpp:263
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:277
std::string Serialize() const override
Definition SpnEnums.hpp:288
The behavior of the gain scheduler on this slot.
Definition SpnEnums.hpp:5059
constexpr GainSchedBehaviorValue(int value)
Definition SpnEnums.hpp:5084
static constexpr int Inactive
No gain scheduling will occur.
Definition SpnEnums.hpp:5065
CTREXPORT friend std::ostream & operator<<(std::ostream &os, GainSchedBehaviorValue data)
static constexpr int UseSlot0
Switch to Slot 0 while within the configured GainSchedErrorThreshold.
Definition SpnEnums.hpp:5074
constexpr auto operator<=>(GainSchedBehaviorValue other) const
Definition SpnEnums.hpp:5096
static constexpr int ZeroOutput
The output of the PID controller will be completely zeroed, except for kG and the user FeedForward co...
Definition SpnEnums.hpp:5070
constexpr bool operator==(GainSchedBehaviorValue other) const
Definition SpnEnums.hpp:5092
int value
Definition SpnEnums.hpp:5060
static constexpr int UseSlot1
Switch to Slot 1 while within the configured GainSchedErrorThreshold.
Definition SpnEnums.hpp:5078
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:5106
constexpr GainSchedBehaviorValue()
Definition SpnEnums.hpp:5088
std::string Serialize() const override
Definition SpnEnums.hpp:5120
static constexpr int UseSlot2
Switch to Slot 2 while within the configured GainSchedErrorThreshold.
Definition SpnEnums.hpp:5082
The behavior of kP output as the error crosses the GainSchedErrorThreshold during gain scheduling.
Definition SpnEnums.hpp:4995
static constexpr int Discontinuous
The gain scheduler will allow for a discontinuity in the kP output.
Definition SpnEnums.hpp:5010
constexpr bool operator==(GainSchedKpBehaviorValue other) const
Definition SpnEnums.hpp:5020
std::string Serialize() const override
Definition SpnEnums.hpp:5045
static constexpr int Continuous
The gain scheduler will maintain continuity in the kP output as the error crosses the gain threshold.
Definition SpnEnums.hpp:5004
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:5034
constexpr GainSchedKpBehaviorValue()
Definition SpnEnums.hpp:5016
constexpr auto operator<=>(GainSchedKpBehaviorValue other) const
Definition SpnEnums.hpp:5024
constexpr GainSchedKpBehaviorValue(int value)
Definition SpnEnums.hpp:5012
CTREXPORT friend std::ostream & operator<<(std::ostream &os, GainSchedKpBehaviorValue data)
Gravity feedforward/feedback type.
Definition SpnEnums.hpp:1488
constexpr bool operator==(GravityTypeValue other) const
Definition SpnEnums.hpp:1514
constexpr GravityTypeValue()
Definition SpnEnums.hpp:1510
constexpr auto operator<=>(GravityTypeValue other) const
Definition SpnEnums.hpp:1518
constexpr GravityTypeValue(int value)
Definition SpnEnums.hpp:1506
static constexpr int Elevator_Static
The system's gravity feedforward is constant, such as an elevator.
Definition SpnEnums.hpp:1495
int value
Definition SpnEnums.hpp:1489
std::string Serialize() const override
Definition SpnEnums.hpp:1539
CTREXPORT friend std::ostream & operator<<(std::ostream &os, GravityTypeValue data)
static constexpr int Arm_Cosine
The system's gravity feedback is dependent on the angular position of the mechanism,...
Definition SpnEnums.hpp:1504
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1528
Invert state of the device as seen from the front of the motor.
Definition SpnEnums.hpp:1548
CTREXPORT friend std::ostream & operator<<(std::ostream &os, InvertedValue data)
static constexpr int CounterClockwise_Positive
Positive motor output results in counter-clockwise motion.
Definition SpnEnums.hpp:1554
constexpr InvertedValue(int value)
Definition SpnEnums.hpp:1560
int value
Definition SpnEnums.hpp:1549
constexpr bool operator==(InvertedValue other) const
Definition SpnEnums.hpp:1568
static constexpr int Clockwise_Positive
Positive motor output results in clockwise motion.
Definition SpnEnums.hpp:1558
constexpr InvertedValue()
Definition SpnEnums.hpp:1564
std::string Serialize() const override
Definition SpnEnums.hpp:1593
constexpr auto operator<=>(InvertedValue other) const
Definition SpnEnums.hpp:1572
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1582
Whether the device is Pro licensed.
Definition SpnEnums.hpp:98
static constexpr int NotLicensed
Definition SpnEnums.hpp:101
int value
Definition SpnEnums.hpp:99
static constexpr int Licensed
Definition SpnEnums.hpp:102
constexpr auto operator<=>(IsPROLicensedValue other) const
Definition SpnEnums.hpp:116
constexpr IsPROLicensedValue(int value)
Definition SpnEnums.hpp:104
constexpr IsPROLicensedValue()
Definition SpnEnums.hpp:108
std::string Serialize() const override
Definition SpnEnums.hpp:137
CTREXPORT friend std::ostream & operator<<(std::ostream &os, IsPROLicensedValue data)
constexpr bool operator==(IsPROLicensedValue other) const
Definition SpnEnums.hpp:112
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:126
The behavior of the larson animation pocket of light when it reaches the end of the strip.
Definition SpnEnums.hpp:4876
static constexpr int Back
The animation bounces once all LEDs are off the strip.
Definition SpnEnums.hpp:4891
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4915
static constexpr int Center
The animation bounces once it is midway through the end of the strip.
Definition SpnEnums.hpp:4887
int value
Definition SpnEnums.hpp:4877
constexpr LarsonBounceValue()
Definition SpnEnums.hpp:4897
static constexpr int Front
The animation bounces as soon as the first LED reaches the end of the strip.
Definition SpnEnums.hpp:4883
constexpr bool operator==(LarsonBounceValue other) const
Definition SpnEnums.hpp:4901
constexpr LarsonBounceValue(int value)
Definition SpnEnums.hpp:4893
CTREXPORT friend std::ostream & operator<<(std::ostream &os, LarsonBounceValue data)
std::string Serialize() const override
Definition SpnEnums.hpp:4927
constexpr auto operator<=>(LarsonBounceValue other) const
Definition SpnEnums.hpp:4905
The Color of LED1 when it's "Off".
Definition SpnEnums.hpp:405
constexpr auto operator<=>(Led1OffColorValue other) const
Definition SpnEnums.hpp:429
constexpr Led1OffColorValue()
Definition SpnEnums.hpp:421
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:439
static constexpr int Orange
Definition SpnEnums.hpp:411
CTREXPORT friend std::ostream & operator<<(std::ostream &os, Led1OffColorValue data)
constexpr bool operator==(Led1OffColorValue other) const
Definition SpnEnums.hpp:425
static constexpr int Red
Definition SpnEnums.hpp:409
static constexpr int White
Definition SpnEnums.hpp:415
static constexpr int Off
Definition SpnEnums.hpp:408
static constexpr int Blue
Definition SpnEnums.hpp:412
static constexpr int Cyan
Definition SpnEnums.hpp:414
std::string Serialize() const override
Definition SpnEnums.hpp:456
int value
Definition SpnEnums.hpp:406
static constexpr int Pink
Definition SpnEnums.hpp:413
constexpr Led1OffColorValue(int value)
Definition SpnEnums.hpp:417
static constexpr int Green
Definition SpnEnums.hpp:410
The Color of LED1 when it's "On".
Definition SpnEnums.hpp:345
constexpr bool operator==(Led1OnColorValue other) const
Definition SpnEnums.hpp:365
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:379
static constexpr int Cyan
Definition SpnEnums.hpp:354
std::string Serialize() const override
Definition SpnEnums.hpp:396
constexpr Led1OnColorValue()
Definition SpnEnums.hpp:361
static constexpr int Pink
Definition SpnEnums.hpp:353
constexpr Led1OnColorValue(int value)
Definition SpnEnums.hpp:357
constexpr auto operator<=>(Led1OnColorValue other) const
Definition SpnEnums.hpp:369
static constexpr int Blue
Definition SpnEnums.hpp:352
static constexpr int White
Definition SpnEnums.hpp:355
static constexpr int Green
Definition SpnEnums.hpp:350
static constexpr int Red
Definition SpnEnums.hpp:349
static constexpr int Off
Definition SpnEnums.hpp:348
static constexpr int Orange
Definition SpnEnums.hpp:351
CTREXPORT friend std::ostream & operator<<(std::ostream &os, Led1OnColorValue data)
int value
Definition SpnEnums.hpp:346
The Color of LED2 when it's "Off".
Definition SpnEnums.hpp:525
std::string Serialize() const override
Definition SpnEnums.hpp:576
static constexpr int Pink
Definition SpnEnums.hpp:533
static constexpr int Red
Definition SpnEnums.hpp:529
static constexpr int Blue
Definition SpnEnums.hpp:532
constexpr Led2OffColorValue()
Definition SpnEnums.hpp:541
static constexpr int Cyan
Definition SpnEnums.hpp:534
int value
Definition SpnEnums.hpp:526
static constexpr int Off
Definition SpnEnums.hpp:528
constexpr auto operator<=>(Led2OffColorValue other) const
Definition SpnEnums.hpp:549
static constexpr int White
Definition SpnEnums.hpp:535
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:559
CTREXPORT friend std::ostream & operator<<(std::ostream &os, Led2OffColorValue data)
constexpr Led2OffColorValue(int value)
Definition SpnEnums.hpp:537
constexpr bool operator==(Led2OffColorValue other) const
Definition SpnEnums.hpp:545
static constexpr int Orange
Definition SpnEnums.hpp:531
static constexpr int Green
Definition SpnEnums.hpp:530
The Color of LED2 when it's "On".
Definition SpnEnums.hpp:465
static constexpr int Red
Definition SpnEnums.hpp:469
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:499
static constexpr int Green
Definition SpnEnums.hpp:470
static constexpr int Pink
Definition SpnEnums.hpp:473
static constexpr int Cyan
Definition SpnEnums.hpp:474
constexpr bool operator==(Led2OnColorValue other) const
Definition SpnEnums.hpp:485
CTREXPORT friend std::ostream & operator<<(std::ostream &os, Led2OnColorValue data)
constexpr auto operator<=>(Led2OnColorValue other) const
Definition SpnEnums.hpp:489
static constexpr int Blue
Definition SpnEnums.hpp:472
static constexpr int Orange
Definition SpnEnums.hpp:471
std::string Serialize() const override
Definition SpnEnums.hpp:516
static constexpr int White
Definition SpnEnums.hpp:475
static constexpr int Off
Definition SpnEnums.hpp:468
int value
Definition SpnEnums.hpp:466
constexpr Led2OnColorValue(int value)
Definition SpnEnums.hpp:477
constexpr Led2OnColorValue()
Definition SpnEnums.hpp:481
Whether the device is Season Pass licensed.
Definition SpnEnums.hpp:146
std::string Serialize() const override
Definition SpnEnums.hpp:185
static constexpr int NotLicensed
Definition SpnEnums.hpp:149
CTREXPORT friend std::ostream & operator<<(std::ostream &os, Licensing_IsSeasonPassedValue data)
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:174
constexpr bool operator==(Licensing_IsSeasonPassedValue other) const
Definition SpnEnums.hpp:160
constexpr Licensing_IsSeasonPassedValue()
Definition SpnEnums.hpp:156
constexpr auto operator<=>(Licensing_IsSeasonPassedValue other) const
Definition SpnEnums.hpp:164
constexpr Licensing_IsSeasonPassedValue(int value)
Definition SpnEnums.hpp:152
static constexpr int Licensed
Definition SpnEnums.hpp:150
The behavior of the LEDs when the control signal is lost.
Definition SpnEnums.hpp:3843
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3877
static constexpr int DisableLEDs
LEDs and animations are disabled after the control signal is lost.
Definition SpnEnums.hpp:3853
CTREXPORT friend std::ostream & operator<<(std::ostream &os, LossOfSignalBehaviorValue data)
constexpr auto operator<=>(LossOfSignalBehaviorValue other) const
Definition SpnEnums.hpp:3867
static constexpr int KeepRunning
LEDs remain enabled, and animations continue to run.
Definition SpnEnums.hpp:3849
constexpr LossOfSignalBehaviorValue()
Definition SpnEnums.hpp:3859
constexpr LossOfSignalBehaviorValue(int value)
Definition SpnEnums.hpp:3855
std::string Serialize() const override
Definition SpnEnums.hpp:3888
constexpr bool operator==(LossOfSignalBehaviorValue other) const
Definition SpnEnums.hpp:3863
Magnet health as measured by CANcoder.
Definition SpnEnums.hpp:2192
std::string Serialize() const override
Definition SpnEnums.hpp:2247
static constexpr int Magnet_Orange
Magnet health is adequate but with reduced accuracy.
Definition SpnEnums.hpp:2202
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2234
static constexpr int Magnet_Red
The magnet is too close or too far from the CANcoder.
Definition SpnEnums.hpp:2198
static constexpr int Magnet_Green
Magnet health is ideal.
Definition SpnEnums.hpp:2206
CTREXPORT friend std::ostream & operator<<(std::ostream &os, MagnetHealthValue data)
constexpr MagnetHealthValue()
Definition SpnEnums.hpp:2216
int value
Definition SpnEnums.hpp:2193
static constexpr int Magnet_Invalid
The accuracy cannot be determined.
Definition SpnEnums.hpp:2210
constexpr MagnetHealthValue(int value)
Definition SpnEnums.hpp:2212
constexpr auto operator<=>(MagnetHealthValue other) const
Definition SpnEnums.hpp:2224
constexpr bool operator==(MagnetHealthValue other) const
Definition SpnEnums.hpp:2220
Health of the distance measurement.
Definition SpnEnums.hpp:2649
std::string Serialize() const override
Definition SpnEnums.hpp:2700
static constexpr int Good
Measurement is good.
Definition SpnEnums.hpp:2655
constexpr MeasurementHealthValue(int value)
Definition SpnEnums.hpp:2666
CTREXPORT friend std::ostream & operator<<(std::ostream &os, MeasurementHealthValue data)
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2688
static constexpr int Limited
Measurement is likely okay, but the target is either very far away or moving very quickly.
Definition SpnEnums.hpp:2660
constexpr auto operator<=>(MeasurementHealthValue other) const
Definition SpnEnums.hpp:2678
constexpr bool operator==(MeasurementHealthValue other) const
Definition SpnEnums.hpp:2674
static constexpr int Bad
Measurement is compromised.
Definition SpnEnums.hpp:2664
constexpr MeasurementHealthValue()
Definition SpnEnums.hpp:2670
int value
Definition SpnEnums.hpp:2650
The relationship between two motors in a mechanism.
Definition SpnEnums.hpp:5130
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:5166
static constexpr int Opposed
The two motor directions are opposed.
Definition SpnEnums.hpp:5142
constexpr bool operator==(MotorAlignmentValue other) const
Definition SpnEnums.hpp:5152
constexpr auto operator<=>(MotorAlignmentValue other) const
Definition SpnEnums.hpp:5156
constexpr MotorAlignmentValue(int value)
Definition SpnEnums.hpp:5144
int value
Definition SpnEnums.hpp:5131
constexpr MotorAlignmentValue()
Definition SpnEnums.hpp:5148
CTREXPORT friend std::ostream & operator<<(std::ostream &os, MotorAlignmentValue data)
static constexpr int Aligned
The two motor directions are aligned.
Definition SpnEnums.hpp:5137
std::string Serialize() const override
Definition SpnEnums.hpp:5177
Selects the motor and motor connections used with Talon.
Definition SpnEnums.hpp:2839
std::string Serialize() const override
Definition SpnEnums.hpp:2964
int value
Definition SpnEnums.hpp:2840
static constexpr int NEO_JST
Third party NEO brushless three phase motor (~6000 RPM at 12V).
Definition SpnEnums.hpp:2883
static constexpr int CustomBrushless
Third party custom brushless three phase motor.
Definition SpnEnums.hpp:2924
static constexpr int NEO550_JST
Third party NEO550 brushless three phase motor (~11000 RPM at 12V).
Definition SpnEnums.hpp:2895
constexpr bool operator==(MotorArrangementValue other) const
Definition SpnEnums.hpp:2934
static constexpr int Brushed_DC
Third party brushed DC motor with two leads.
Definition SpnEnums.hpp:2871
static constexpr int Minion_JST
CTR Electronics Minion® brushless three phase motor.
Definition SpnEnums.hpp:2859
constexpr MotorArrangementValue(int value)
Definition SpnEnums.hpp:2926
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2948
static constexpr int VORTEX_JST
Third party VORTEX brushless three phase motor.
Definition SpnEnums.hpp:2907
constexpr auto operator<=>(MotorArrangementValue other) const
Definition SpnEnums.hpp:2938
CTREXPORT friend std::ostream & operator<<(std::ostream &os, MotorArrangementValue data)
constexpr MotorArrangementValue()
Definition SpnEnums.hpp:2930
static constexpr int Disabled
Motor is not selected.
Definition SpnEnums.hpp:2847
Assess the status of the motor output with respect to load and supply.
Definition SpnEnums.hpp:1130
CTREXPORT friend std::ostream & operator<<(std::ostream &os, MotorOutputStatusValue data)
constexpr MotorOutputStatusValue()
Definition SpnEnums.hpp:1166
std::string Serialize() const override
Definition SpnEnums.hpp:1199
static constexpr int RegenBraking
The motor is braking in such a way where motor current is traveling back to the supply (typically a b...
Definition SpnEnums.hpp:1160
static constexpr int Off
Motor output is disabled.
Definition SpnEnums.hpp:1140
static constexpr int Motoring
The motor is loaded in a typical fashion, drawing current from the supply, and successfully turning t...
Definition SpnEnums.hpp:1150
constexpr MotorOutputStatusValue(int value)
Definition SpnEnums.hpp:1162
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1184
constexpr bool operator==(MotorOutputStatusValue other) const
Definition SpnEnums.hpp:1170
constexpr auto operator<=>(MotorOutputStatusValue other) const
Definition SpnEnums.hpp:1174
static constexpr int StaticBraking
The motor is in neutral-brake.
Definition SpnEnums.hpp:1144
int value
Definition SpnEnums.hpp:1131
static constexpr int Unknown
The status of motor output could not be determined.
Definition SpnEnums.hpp:1136
static constexpr int DiscordantMotoring
The same as Motoring, except the rotor is being backdriven as the motor output is not enough to defea...
Definition SpnEnums.hpp:1155
The state of the motor controller bridge when output is neutral or disabled.
Definition SpnEnums.hpp:1603
constexpr NeutralModeValue(int value)
Definition SpnEnums.hpp:1609
constexpr auto operator<=>(NeutralModeValue other) const
Definition SpnEnums.hpp:1621
CTREXPORT friend std::ostream & operator<<(std::ostream &os, NeutralModeValue data)
static constexpr int Brake
Definition SpnEnums.hpp:1607
constexpr NeutralModeValue()
Definition SpnEnums.hpp:1613
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1631
std::string Serialize() const override
Definition SpnEnums.hpp:1642
int value
Definition SpnEnums.hpp:1604
static constexpr int Coast
Definition SpnEnums.hpp:1606
constexpr bool operator==(NeutralModeValue other) const
Definition SpnEnums.hpp:1617
The output mode of the PID controller.
Definition SpnEnums.hpp:1029
constexpr auto operator<=>(PIDOutput_PIDOutputModeValue other) const
Definition SpnEnums.hpp:1048
static constexpr int TorqueCurrentFOC
Definition SpnEnums.hpp:1034
constexpr bool operator==(PIDOutput_PIDOutputModeValue other) const
Definition SpnEnums.hpp:1044
constexpr PIDOutput_PIDOutputModeValue(int value)
Definition SpnEnums.hpp:1036
static constexpr int Voltage
Definition SpnEnums.hpp:1033
std::string Serialize() const override
Definition SpnEnums.hpp:1070
constexpr PIDOutput_PIDOutputModeValue()
Definition SpnEnums.hpp:1040
CTREXPORT friend std::ostream & operator<<(std::ostream &os, PIDOutput_PIDOutputModeValue data)
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1058
static constexpr int DutyCycle
Definition SpnEnums.hpp:1032
Whether the closed-loop is running on position or velocity.
Definition SpnEnums.hpp:981
static constexpr int Position
Definition SpnEnums.hpp:984
constexpr PIDRefPIDErr_ClosedLoopModeValue()
Definition SpnEnums.hpp:991
constexpr auto operator<=>(PIDRefPIDErr_ClosedLoopModeValue other) const
Definition SpnEnums.hpp:999
CTREXPORT friend std::ostream & operator<<(std::ostream &os, PIDRefPIDErr_ClosedLoopModeValue data)
constexpr PIDRefPIDErr_ClosedLoopModeValue(int value)
Definition SpnEnums.hpp:987
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1009
static constexpr int Velocity
Definition SpnEnums.hpp:985
std::string Serialize() const override
Definition SpnEnums.hpp:1020
constexpr bool operator==(PIDRefPIDErr_ClosedLoopModeValue other) const
Definition SpnEnums.hpp:995
Whether the closed-loop is running on position or velocity.
Definition SpnEnums.hpp:1079
CTREXPORT friend std::ostream & operator<<(std::ostream &os, PIDRefSlopeECUTime_ClosedLoopModeValue data)
std::string Serialize() const override
Definition SpnEnums.hpp:1118
constexpr PIDRefSlopeECUTime_ClosedLoopModeValue()
Definition SpnEnums.hpp:1089
constexpr bool operator==(PIDRefSlopeECUTime_ClosedLoopModeValue other) const
Definition SpnEnums.hpp:1093
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1107
static constexpr int Velocity
Definition SpnEnums.hpp:1083
constexpr PIDRefSlopeECUTime_ClosedLoopModeValue(int value)
Definition SpnEnums.hpp:1085
static constexpr int Position
Definition SpnEnums.hpp:1082
constexpr auto operator<=>(PIDRefSlopeECUTime_ClosedLoopModeValue other) const
Definition SpnEnums.hpp:1097
Determines where to poll the reverse limit switch.
Definition SpnEnums.hpp:2091
static constexpr int RemoteCANdiS2
Use another CTR Electronics' CANdi™ on the same CAN bus (this also requires setting ForwardLimitRemot...
Definition SpnEnums.hpp:2134
std::string Serialize() const override
Definition SpnEnums.hpp:2179
static constexpr int RemoteTalonFX
Use the reverse limit switch attached to another Talon FX on the same CAN bus (this also requires set...
Definition SpnEnums.hpp:2102
constexpr ReverseLimitSourceValue(int value)
Definition SpnEnums.hpp:2140
static constexpr int RemoteCANrange
Use another CANrange on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).
Definition SpnEnums.hpp:2120
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).
Definition SpnEnums.hpp:2114
static constexpr int RemoteCANdiS1
Use another CTR Electronics' CANdi™ on the same CAN bus (this also requires setting ForwardLimitRemot...
Definition SpnEnums.hpp:2127
int value
Definition SpnEnums.hpp:2092
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2162
static constexpr int RemoteCANifier
Use the reverse limit switch attached to another CANifier on the same CAN bus (this also requires set...
Definition SpnEnums.hpp:2107
constexpr auto operator<=>(ReverseLimitSourceValue other) const
Definition SpnEnums.hpp:2152
static constexpr int LimitSwitchPin
Use the reverse limit switch pin on the limit switch connector.
Definition SpnEnums.hpp:2097
constexpr bool operator==(ReverseLimitSourceValue other) const
Definition SpnEnums.hpp:2148
constexpr ReverseLimitSourceValue()
Definition SpnEnums.hpp:2144
CTREXPORT friend std::ostream & operator<<(std::ostream &os, ReverseLimitSourceValue data)
static constexpr int Disabled
Disable the reverse limit switch.
Definition SpnEnums.hpp:2138
Determines if the reverse limit switch is normally-open (default) or normally-closed.
Definition SpnEnums.hpp:2029
static constexpr int NormallyClosed
Definition SpnEnums.hpp:2033
constexpr auto operator<=>(ReverseLimitTypeValue other) const
Definition SpnEnums.hpp:2047
CTREXPORT friend std::ostream & operator<<(std::ostream &os, ReverseLimitTypeValue data)
constexpr ReverseLimitTypeValue()
Definition SpnEnums.hpp:2039
static constexpr int NormallyOpen
Definition SpnEnums.hpp:2032
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2057
std::string Serialize() const override
Definition SpnEnums.hpp:2068
int value
Definition SpnEnums.hpp:2030
constexpr ReverseLimitTypeValue(int value)
Definition SpnEnums.hpp:2035
constexpr bool operator==(ReverseLimitTypeValue other) const
Definition SpnEnums.hpp:2043
Reverse Limit Pin.
Definition SpnEnums.hpp:681
constexpr auto operator<=>(ReverseLimitValue other) const
Definition SpnEnums.hpp:699
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:709
static constexpr int Open
Definition SpnEnums.hpp:685
int value
Definition SpnEnums.hpp:682
std::string Serialize() const override
Definition SpnEnums.hpp:720
CTREXPORT friend std::ostream & operator<<(std::ostream &os, ReverseLimitValue data)
static constexpr int ClosedToGround
Definition SpnEnums.hpp:684
constexpr ReverseLimitValue()
Definition SpnEnums.hpp:691
constexpr bool operator==(ReverseLimitValue other) const
Definition SpnEnums.hpp:695
constexpr ReverseLimitValue(int value)
Definition SpnEnums.hpp:687
Whether the robot is enabled.
Definition SpnEnums.hpp:297
constexpr auto operator<=>(RobotEnableValue other) const
Definition SpnEnums.hpp:315
static constexpr int Disabled
Definition SpnEnums.hpp:301
constexpr bool operator==(RobotEnableValue other) const
Definition SpnEnums.hpp:311
constexpr RobotEnableValue(int value)
Definition SpnEnums.hpp:303
constexpr RobotEnableValue()
Definition SpnEnums.hpp:307
static constexpr int Enabled
Definition SpnEnums.hpp:300
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:325
CTREXPORT friend std::ostream & operator<<(std::ostream &os, RobotEnableValue data)
int value
Definition SpnEnums.hpp:298
std::string Serialize() const override
Definition SpnEnums.hpp:336
What value the Signal 1 input (S1IN) needs to be for the CTR Electronics' CANdi™ to detect as Closed.
Definition SpnEnums.hpp:3533
int value
Definition SpnEnums.hpp:3534
constexpr auto operator<=>(S1CloseStateValue other) const
Definition SpnEnums.hpp:3573
static constexpr int CloseWhenNotHigh
The S1 input will be treated as closed when it is not High.
Definition SpnEnums.hpp:3547
static constexpr int CloseWhenNotFloating
The S1 input will be treated as closed when it is not floating.
Definition SpnEnums.hpp:3539
static constexpr int CloseWhenFloating
The S1 input will be treated as closed when it is floating.
Definition SpnEnums.hpp:3543
static constexpr int CloseWhenNotLow
The S1 input will be treated as closed when it is not Low.
Definition SpnEnums.hpp:3555
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3583
static constexpr int CloseWhenLow
The S1 input will be treated as closed when it is Low.
Definition SpnEnums.hpp:3559
constexpr S1CloseStateValue(int value)
Definition SpnEnums.hpp:3561
std::string Serialize() const override
Definition SpnEnums.hpp:3598
CTREXPORT friend std::ostream & operator<<(std::ostream &os, S1CloseStateValue data)
constexpr S1CloseStateValue()
Definition SpnEnums.hpp:3565
static constexpr int CloseWhenHigh
The S1 input will be treated as closed when it is High.
Definition SpnEnums.hpp:3551
constexpr bool operator==(S1CloseStateValue other) const
Definition SpnEnums.hpp:3569
The floating state of the Signal 1 input (S1IN).
Definition SpnEnums.hpp:3091
constexpr bool operator==(S1FloatStateValue other) const
Definition SpnEnums.hpp:3123
CTREXPORT friend std::ostream & operator<<(std::ostream &os, S1FloatStateValue data)
int value
Definition SpnEnums.hpp:3092
static constexpr int PullHigh
The input will be pulled high when not loaded by an outside device.
Definition SpnEnums.hpp:3103
constexpr S1FloatStateValue()
Definition SpnEnums.hpp:3119
constexpr S1FloatStateValue(int value)
Definition SpnEnums.hpp:3115
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3137
static constexpr int BusKeeper
The input will pull in the direction of the last measured state.
Definition SpnEnums.hpp:3113
static constexpr int PullLow
The input will be pulled low when not loaded by an outside device.
Definition SpnEnums.hpp:3108
std::string Serialize() const override
Definition SpnEnums.hpp:3150
constexpr auto operator<=>(S1FloatStateValue other) const
Definition SpnEnums.hpp:3127
static constexpr int FloatDetect
The input will attempt to detect when it is floating.
Definition SpnEnums.hpp:3098
State of the Signal 1 input (S1IN).
Definition SpnEnums.hpp:2973
constexpr S1StateValue(int value)
Definition SpnEnums.hpp:2989
static constexpr int Low
Input is driven low (below 0.5V).
Definition SpnEnums.hpp:2983
constexpr S1StateValue()
Definition SpnEnums.hpp:2993
std::string Serialize() const override
Definition SpnEnums.hpp:3023
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3011
int value
Definition SpnEnums.hpp:2974
CTREXPORT friend std::ostream & operator<<(std::ostream &os, S1StateValue data)
constexpr bool operator==(S1StateValue other) const
Definition SpnEnums.hpp:2997
static constexpr int High
Input is driven high (above 3V).
Definition SpnEnums.hpp:2987
static constexpr int Floating
Input is not driven high or low, it is disconnected from load.
Definition SpnEnums.hpp:2979
constexpr auto operator<=>(S1StateValue other) const
Definition SpnEnums.hpp:3001
What value the Signal 2 input (S2IN) needs to be for the CTR Electronics' CANdi™ to detect as Closed.
Definition SpnEnums.hpp:3611
constexpr S2CloseStateValue()
Definition SpnEnums.hpp:3643
constexpr auto operator<=>(S2CloseStateValue other) const
Definition SpnEnums.hpp:3651
constexpr bool operator==(S2CloseStateValue other) const
Definition SpnEnums.hpp:3647
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3661
static constexpr int CloseWhenNotLow
The S2 input will be treated as closed when it is not Low.
Definition SpnEnums.hpp:3633
int value
Definition SpnEnums.hpp:3612
static constexpr int CloseWhenNotHigh
The S2 input will be treated as closed when it is not High.
Definition SpnEnums.hpp:3625
std::string Serialize() const override
Definition SpnEnums.hpp:3676
constexpr S2CloseStateValue(int value)
Definition SpnEnums.hpp:3639
static constexpr int CloseWhenLow
The S2 input will be treated as closed when it is Low.
Definition SpnEnums.hpp:3637
static constexpr int CloseWhenHigh
The S2 input will be treated as closed when it is High.
Definition SpnEnums.hpp:3629
static constexpr int CloseWhenFloating
The S2 input will be treated as closed when it is floating.
Definition SpnEnums.hpp:3621
static constexpr int CloseWhenNotFloating
The S2 input will be treated as closed when it is not floating.
Definition SpnEnums.hpp:3617
CTREXPORT friend std::ostream & operator<<(std::ostream &os, S2CloseStateValue data)
The floating state of the Signal 2 input (S2IN).
Definition SpnEnums.hpp:3159
std::string Serialize() const override
Definition SpnEnums.hpp:3218
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3205
static constexpr int PullHigh
The input will be pulled high when not loaded by an outside device.
Definition SpnEnums.hpp:3171
constexpr auto operator<=>(S2FloatStateValue other) const
Definition SpnEnums.hpp:3195
constexpr bool operator==(S2FloatStateValue other) const
Definition SpnEnums.hpp:3191
static constexpr int BusKeeper
The input will pull in the direction of the last measured state.
Definition SpnEnums.hpp:3181
constexpr S2FloatStateValue(int value)
Definition SpnEnums.hpp:3183
CTREXPORT friend std::ostream & operator<<(std::ostream &os, S2FloatStateValue data)
static constexpr int PullLow
The input will be pulled low when not loaded by an outside device.
Definition SpnEnums.hpp:3176
int value
Definition SpnEnums.hpp:3160
constexpr S2FloatStateValue()
Definition SpnEnums.hpp:3187
static constexpr int FloatDetect
The input will attempt to detect when it is floating.
Definition SpnEnums.hpp:3166
State of the Signal 2 input (S2IN).
Definition SpnEnums.hpp:3032
constexpr bool operator==(S2StateValue other) const
Definition SpnEnums.hpp:3056
static constexpr int High
Input is driven high (above 3V).
Definition SpnEnums.hpp:3046
int value
Definition SpnEnums.hpp:3033
CTREXPORT friend std::ostream & operator<<(std::ostream &os, S2StateValue data)
constexpr S2StateValue(int value)
Definition SpnEnums.hpp:3048
constexpr S2StateValue()
Definition SpnEnums.hpp:3052
static constexpr int Floating
Input is not driven high or low, it is disconnected from load.
Definition SpnEnums.hpp:3038
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3070
static constexpr int Low
Input is driven low (below 0.5V).
Definition SpnEnums.hpp:3042
constexpr auto operator<=>(S2StateValue other) const
Definition SpnEnums.hpp:3060
std::string Serialize() const override
Definition SpnEnums.hpp:3082
Direction of the sensor to determine positive rotation, as seen facing the LED side of the CANcoder.
Definition SpnEnums.hpp:195
static constexpr int CounterClockwise_Positive
Counter-clockwise motion reports positive rotation.
Definition SpnEnums.hpp:201
CTREXPORT friend std::ostream & operator<<(std::ostream &os, SensorDirectionValue data)
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:229
constexpr SensorDirectionValue(int value)
Definition SpnEnums.hpp:207
constexpr auto operator<=>(SensorDirectionValue other) const
Definition SpnEnums.hpp:219
static constexpr int Clockwise_Positive
Clockwise motion reports positive rotation.
Definition SpnEnums.hpp:205
std::string Serialize() const override
Definition SpnEnums.hpp:240
int value
Definition SpnEnums.hpp:196
constexpr bool operator==(SensorDirectionValue other) const
Definition SpnEnums.hpp:215
constexpr SensorDirectionValue()
Definition SpnEnums.hpp:211
The relationship between the motor controlled by a Talon and the external sensor connected to the dat...
Definition SpnEnums.hpp:3475
constexpr bool operator==(SensorPhaseValue other) const
Definition SpnEnums.hpp:3495
int value
Definition SpnEnums.hpp:3476
CTREXPORT friend std::ostream & operator<<(std::ostream &os, SensorPhaseValue data)
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3509
constexpr SensorPhaseValue(int value)
Definition SpnEnums.hpp:3487
static constexpr int Aligned
The sensor direction is normally aligned with the motor.
Definition SpnEnums.hpp:3481
static constexpr int Opposed
The sensor direction is normally opposed to the motor.
Definition SpnEnums.hpp:3485
std::string Serialize() const override
Definition SpnEnums.hpp:3520
constexpr SensorPhaseValue()
Definition SpnEnums.hpp:3491
constexpr auto operator<=>(SensorPhaseValue other) const
Definition SpnEnums.hpp:3499
Static feedforward sign during position closed loop.
Definition SpnEnums.hpp:2475
constexpr bool operator==(StaticFeedforwardSignValue other) const
Definition SpnEnums.hpp:2500
constexpr auto operator<=>(StaticFeedforwardSignValue other) const
Definition SpnEnums.hpp:2504
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2514
static constexpr int UseVelocitySign
Use the velocity reference sign.
Definition SpnEnums.hpp:2483
CTREXPORT friend std::ostream & operator<<(std::ostream &os, StaticFeedforwardSignValue data)
constexpr StaticFeedforwardSignValue()
Definition SpnEnums.hpp:2496
std::string Serialize() const override
Definition SpnEnums.hpp:2525
static constexpr int UseClosedLoopSign
Use the sign of closed loop error.
Definition SpnEnums.hpp:2490
constexpr StaticFeedforwardSignValue(int value)
Definition SpnEnums.hpp:2492
Whether the Status LED is enabled when the CANdle is actively being controlled.
Definition SpnEnums.hpp:4013
constexpr StatusLedWhenActiveValue(int value)
Definition SpnEnums.hpp:4025
CTREXPORT friend std::ostream & operator<<(std::ostream &os, StatusLedWhenActiveValue data)
constexpr auto operator<=>(StatusLedWhenActiveValue other) const
Definition SpnEnums.hpp:4037
std::string Serialize() const override
Definition SpnEnums.hpp:4058
constexpr StatusLedWhenActiveValue()
Definition SpnEnums.hpp:4029
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4047
static constexpr int Disabled
The status LED is disabled during control.
Definition SpnEnums.hpp:4023
static constexpr int Enabled
The status LED is enabled during control.
Definition SpnEnums.hpp:4019
constexpr bool operator==(StatusLedWhenActiveValue other) const
Definition SpnEnums.hpp:4033
The type of LEDs that are being controlled.
Definition SpnEnums.hpp:3769
static constexpr int GRB
LEDs that are controlled by Green-Red-Blue values.
Definition SpnEnums.hpp:3775
constexpr StripTypeValue()
Definition SpnEnums.hpp:3801
constexpr bool operator==(StripTypeValue other) const
Definition SpnEnums.hpp:3805
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3819
static constexpr int BRG
LEDs that are controlled by Blue-Red-Green values.
Definition SpnEnums.hpp:3783
std::string Serialize() const override
Definition SpnEnums.hpp:3834
static constexpr int RGB
LEDs that are controlled by Red-Green-Blue values.
Definition SpnEnums.hpp:3779
constexpr StripTypeValue(int value)
Definition SpnEnums.hpp:3797
int value
Definition SpnEnums.hpp:3770
static constexpr int RGBW
LEDs that are controlled by Red-Green-Blue-White values.
Definition SpnEnums.hpp:3791
static constexpr int GRBW
LEDs that are controlled by Green-Red-Blue-White values.
Definition SpnEnums.hpp:3787
CTREXPORT friend std::ostream & operator<<(std::ostream &os, StripTypeValue data)
static constexpr int BRGW
LEDs that are controlled by Blue-Red-Green-White values.
Definition SpnEnums.hpp:3795
constexpr auto operator<=>(StripTypeValue other) const
Definition SpnEnums.hpp:3809
System state of the device.
Definition SpnEnums.hpp:22
static constexpr int Bootup_3
Definition SpnEnums.hpp:28
static constexpr int ControlEnabled
Definition SpnEnums.hpp:35
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:64
static constexpr int Production
Definition SpnEnums.hpp:40
static constexpr int Bootup_4
Definition SpnEnums.hpp:29
std::string Serialize() const override
Definition SpnEnums.hpp:89
static constexpr int ControlDisabled
Definition SpnEnums.hpp:34
static constexpr int NotLicensed
Definition SpnEnums.hpp:39
static constexpr int Recover
Definition SpnEnums.hpp:38
static constexpr int Bootup_1
Definition SpnEnums.hpp:26
static constexpr int Bootup_0
Definition SpnEnums.hpp:25
static constexpr int BootBeep
Definition SpnEnums.hpp:33
static constexpr int Bootup_6
Definition SpnEnums.hpp:31
int value
Definition SpnEnums.hpp:23
static constexpr int Fault
Definition SpnEnums.hpp:37
static constexpr int ControlEnabled_11
Definition SpnEnums.hpp:36
constexpr auto operator<=>(System_StateValue other) const
Definition SpnEnums.hpp:54
constexpr System_StateValue(int value)
Definition SpnEnums.hpp:42
constexpr bool operator==(System_StateValue other) const
Definition SpnEnums.hpp:50
static constexpr int Bootup_5
Definition SpnEnums.hpp:30
CTREXPORT friend std::ostream & operator<<(std::ostream &os, System_StateValue data)
static constexpr int Bootup_7
Definition SpnEnums.hpp:32
constexpr System_StateValue()
Definition SpnEnums.hpp:46
static constexpr int Bootup_2
Definition SpnEnums.hpp:27
Whether a temperature sensor should be required for motor control.
Definition SpnEnums.hpp:4938
static constexpr int Required
Temperature sensor is required for motor control.
Definition SpnEnums.hpp:4944
constexpr bool operator==(TempSensorRequiredValue other) const
Definition SpnEnums.hpp:4958
CTREXPORT friend std::ostream & operator<<(std::ostream &os, TempSensorRequiredValue data)
constexpr TempSensorRequiredValue()
Definition SpnEnums.hpp:4954
constexpr TempSensorRequiredValue(int value)
Definition SpnEnums.hpp:4950
std::string Serialize() const override
Definition SpnEnums.hpp:4983
int value
Definition SpnEnums.hpp:4939
static constexpr int Not_Required
Temperature sensor is not required for motor control.
Definition SpnEnums.hpp:4948
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4972
constexpr auto operator<=>(TempSensorRequiredValue other) const
Definition SpnEnums.hpp:4962
Update mode of the CANrange.
Definition SpnEnums.hpp:2710
constexpr UpdateModeValue()
Definition SpnEnums.hpp:2732
int value
Definition SpnEnums.hpp:2711
static constexpr int ShortRangeUserFreq
Uses short-range detection mode for improved detection under high ambient infrared light conditions.
Definition SpnEnums.hpp:2722
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2750
std::string Serialize() const override
Definition SpnEnums.hpp:2762
constexpr bool operator==(UpdateModeValue other) const
Definition SpnEnums.hpp:2736
static constexpr int ShortRange100Hz
Updates distance/proximity at 100hz using short-range detection mode.
Definition SpnEnums.hpp:2716
constexpr UpdateModeValue(int value)
Definition SpnEnums.hpp:2728
static constexpr int LongRangeUserFreq
Uses long-range detection mode and user-specified update frequency.
Definition SpnEnums.hpp:2726
CTREXPORT friend std::ostream & operator<<(std::ostream &os, UpdateModeValue data)
constexpr auto operator<=>(UpdateModeValue other) const
Definition SpnEnums.hpp:2740
The behavior of the VBat output.
Definition SpnEnums.hpp:3953
constexpr std::string_view ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3991
static constexpr int On
VBat output is on at full power.
Definition SpnEnums.hpp:3959
constexpr bool operator==(VBatOutputModeValue other) const
Definition SpnEnums.hpp:3977
int value
Definition SpnEnums.hpp:3954
constexpr VBatOutputModeValue(int value)
Definition SpnEnums.hpp:3969
std::string Serialize() const override
Definition SpnEnums.hpp:4003
static constexpr int Off
VBat output is off.
Definition SpnEnums.hpp:3963
CTREXPORT friend std::ostream & operator<<(std::ostream &os, VBatOutputModeValue data)
constexpr auto operator<=>(VBatOutputModeValue other) const
Definition SpnEnums.hpp:3981
static constexpr int Modulated
VBat output is on at the specified modulation.
Definition SpnEnums.hpp:3967
constexpr VBatOutputModeValue()
Definition SpnEnums.hpp:3973