CTRE Phoenix 6 C++ 26.70.0-alpha-2
Loading...
Searching...
No Matches
CoreCANdle.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
13
30#include <wpi/units/current.hpp>
31#include <wpi/units/dimensionless.hpp>
32#include <wpi/units/temperature.hpp>
33#include <wpi/units/voltage.hpp>
34
35namespace ctre {
36namespace phoenix6 {
37
38namespace hardware {
39namespace core {
40 class CoreCANdle;
41}
42}
43
44namespace configs {
45
46/**
47 * All configurations for the hardware#CANdle.
48 */
50{
51public:
52 constexpr CANdleConfiguration() = default;
53
54 /**
55 * \brief True if we should factory default newer unsupported configs,
56 * false to leave newer unsupported configs alone.
57 *
58 * \details This flag addresses a corner case where the device may have
59 * firmware with newer configs that didn't exist when this
60 * version of the API was built. If this occurs and this
61 * flag is true, unsupported new configs will be factory
62 * defaulted to avoid unexpected behavior.
63 *
64 * This is also the behavior in Phoenix 5, so this flag
65 * is defaulted to true to match.
66 */
68
69
70 /**
71 * \brief Custom Params.
72 *
73 * \details Custom paramaters that have no real impact on controller.
74 *
75 * Parameter list:
76 *
77 * - CustomParamsConfigs#CustomParam0
78 * - CustomParamsConfigs#CustomParam1
79 *
80 */
82
83 /**
84 * \brief Configs related to CANdle LED control.
85 *
86 * \details All the configs related to controlling LEDs with the
87 * CANdle, including LED strip type and brightness.
88 *
89 * Parameter list:
90 *
91 * - LEDConfigs#StripType
92 * - LEDConfigs#BrightnessScalar
93 * - LEDConfigs#LossOfSignalBehavior
94 *
95 */
97
98 /**
99 * \brief Configs related to general CANdle features.
100 *
101 * \details This includes configs such as disabling the 5V rail and
102 * the behavior of VBat output.
103 *
104 * Parameter list:
105 *
106 * - CANdleFeaturesConfigs#Enable5VRail
107 * - CANdleFeaturesConfigs#VBatOutputMode
108 * - CANdleFeaturesConfigs#StatusLedWhenActive
109 *
110 */
112
113 /**
114 * \brief Modifies this configuration's CustomParams parameter and returns itself for
115 * method-chaining and easier to use config API.
116 *
117 * Custom Params.
118 *
119 * \details Custom paramaters that have no real impact on controller.
120 *
121 * Parameter list:
122 *
123 * - CustomParamsConfigs#CustomParam0
124 * - CustomParamsConfigs#CustomParam1
125 *
126 *
127 * \param newCustomParams Parameter to modify
128 * \returns Itself
129 */
131 {
132 CustomParams = std::move(newCustomParams);
133 return *this;
134 }
135
136 /**
137 * \brief Modifies this configuration's LED parameter and returns itself for
138 * method-chaining and easier to use config API.
139 *
140 * Configs related to CANdle LED control.
141 *
142 * \details All the configs related to controlling LEDs with the
143 * CANdle, including LED strip type and brightness.
144 *
145 * Parameter list:
146 *
147 * - LEDConfigs#StripType
148 * - LEDConfigs#BrightnessScalar
149 * - LEDConfigs#LossOfSignalBehavior
150 *
151 *
152 * \param newLED Parameter to modify
153 * \returns Itself
154 */
156 {
157 LED = std::move(newLED);
158 return *this;
159 }
160
161 /**
162 * \brief Modifies this configuration's CANdleFeatures parameter and returns itself for
163 * method-chaining and easier to use config API.
164 *
165 * Configs related to general CANdle features.
166 *
167 * \details This includes configs such as disabling the 5V rail and
168 * the behavior of VBat output.
169 *
170 * Parameter list:
171 *
172 * - CANdleFeaturesConfigs#Enable5VRail
173 * - CANdleFeaturesConfigs#VBatOutputMode
174 * - CANdleFeaturesConfigs#StatusLedWhenActive
175 *
176 *
177 * \param newCANdleFeatures Parameter to modify
178 * \returns Itself
179 */
181 {
182 CANdleFeatures = std::move(newCANdleFeatures);
183 return *this;
184 }
185
186 /**
187 * \brief Get the string representation of this configuration
188 */
189 std::string ToString() const override;
190
191 /**
192 * \brief Get the serialized form of this configuration
193 */
194 std::string Serialize() const final;
195 /**
196 * \brief Take a string and deserialize it to this configuration
197 */
198 ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final;
199};
200
201/**
202 * Handles applying and refreshing configurations for the hardware#CANdle.
203 */
204class CANdleConfigurator : public ParentConfigurator
205{
206private:
207 CANdleConfigurator(hardware::DeviceIdentifier id) :
208 ParentConfigurator{std::move(id)}
209 {}
210
212
213public:
214 /**
215 * \brief Applies the contents of the specified config to the device.
216 *
217 * This will wait up to #DefaultTimeoutSeconds.
218 *
219 * \details Call to apply the selected configs.
220 *
221 * \param configs Configs to apply against.
222 * \returns Status code of applying the configs
223 */
228
229 /**
230 * \brief Applies the contents of the specified config to the device.
231 *
232 * \details Call to apply the selected configs.
233 *
234 * \param configs Configs to apply against.
235 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
236 * \returns Status code of applying the configs
237 */
238 ctre::phoenix::StatusCode Apply(const CANdleConfiguration &configs, wpi::units::second_t timeoutSeconds)
239 {
240 return SetConfigsPrivate(configs.Serialize(), timeoutSeconds, configs.FutureProofConfigs, false);
241 }
242
243 /**
244 * \brief Applies the contents of the specified config to the device.
245 *
246 * This will wait up to #DefaultTimeoutSeconds.
247 *
248 * \details Call to apply the selected configs.
249 *
250 * \param configs Configs to apply against.
251 * \returns Status code of applying the configs
252 */
257
258 /**
259 * \brief Applies the contents of the specified config to the device.
260 *
261 * \details Call to apply the selected configs.
262 *
263 * \param configs Configs to apply against.
264 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
265 * \returns Status code of applying the configs
266 */
267 ctre::phoenix::StatusCode Apply(const CustomParamsConfigs &configs, wpi::units::second_t timeoutSeconds)
268 {
269 return SetConfigsPrivate(configs.Serialize(), timeoutSeconds, false, false);
270 }
271
272 /**
273 * \brief Applies the contents of the specified config to the device.
274 *
275 * This will wait up to #DefaultTimeoutSeconds.
276 *
277 * \details Call to apply the selected configs.
278 *
279 * \param configs Configs to apply against.
280 * \returns Status code of applying the configs
281 */
286
287 /**
288 * \brief Applies the contents of the specified config to the device.
289 *
290 * \details Call to apply the selected configs.
291 *
292 * \param configs Configs to apply against.
293 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
294 * \returns Status code of applying the configs
295 */
296 ctre::phoenix::StatusCode Apply(const LEDConfigs &configs, wpi::units::second_t timeoutSeconds)
297 {
298 return SetConfigsPrivate(configs.Serialize(), timeoutSeconds, false, false);
299 }
300
301 /**
302 * \brief Applies the contents of the specified config to the device.
303 *
304 * This will wait up to #DefaultTimeoutSeconds.
305 *
306 * \details Call to apply the selected configs.
307 *
308 * \param configs Configs to apply against.
309 * \returns Status code of applying the configs
310 */
315
316 /**
317 * \brief Applies the contents of the specified config to the device.
318 *
319 * \details Call to apply the selected configs.
320 *
321 * \param configs Configs to apply against.
322 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
323 * \returns Status code of applying the configs
324 */
325 ctre::phoenix::StatusCode Apply(const CANdleFeaturesConfigs &configs, wpi::units::second_t timeoutSeconds)
326 {
327 return SetConfigsPrivate(configs.Serialize(), timeoutSeconds, false, false);
328 }
329
330 /**
331 * \brief Refreshes the values of the specified config group.
332 *
333 * This will wait up to #DefaultTimeoutSeconds.
334 *
335 * \details Call to refresh the selected configs from the device.
336 *
337 * \param configs The configs to refresh
338 * \returns Status code of refreshing the configs
339 */
344
345 /**
346 * \brief Refreshes the values of the specified config group.
347 *
348 * \details Call to refresh the selected configs from the device.
349 *
350 * \param configs The configs to refresh
351 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
352 * \returns Status code of refreshing the configs
353 */
354 ctre::phoenix::StatusCode Refresh(CANdleConfiguration &configs, wpi::units::second_t timeoutSeconds) const
355 {
356 std::string ref;
357 ctre::phoenix::StatusCode ret = GetConfigsPrivate(ref, timeoutSeconds);
358 configs.Deserialize(ref);
359 return ret;
360 }
361
362 /**
363 * \brief Refreshes the values of the specified config group.
364 *
365 * This will wait up to #DefaultTimeoutSeconds.
366 *
367 * \details Call to refresh the selected configs from the device.
368 *
369 * \param configs The configs to refresh
370 * \returns Status code of refreshing the configs
371 */
376 /**
377 * \brief Refreshes the values of the specified config group.
378 *
379 * \details Call to refresh the selected configs from the device.
380 *
381 * \param configs The configs to refresh
382 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
383 * \returns Status code of refreshing the configs
384 */
385 ctre::phoenix::StatusCode Refresh(CustomParamsConfigs &configs, wpi::units::second_t timeoutSeconds) const
386 {
387 std::string ref;
388 ctre::phoenix::StatusCode ret = GetConfigsPrivate(ref, timeoutSeconds);
389 configs.Deserialize(ref);
390 return ret;
391 }
392
393 /**
394 * \brief Refreshes the values of the specified config group.
395 *
396 * This will wait up to #DefaultTimeoutSeconds.
397 *
398 * \details Call to refresh the selected configs from the device.
399 *
400 * \param configs The configs to refresh
401 * \returns Status code of refreshing the configs
402 */
407 /**
408 * \brief Refreshes the values of the specified config group.
409 *
410 * \details Call to refresh the selected configs from the device.
411 *
412 * \param configs The configs to refresh
413 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
414 * \returns Status code of refreshing the configs
415 */
416 ctre::phoenix::StatusCode Refresh(LEDConfigs &configs, wpi::units::second_t timeoutSeconds) const
417 {
418 std::string ref;
419 ctre::phoenix::StatusCode ret = GetConfigsPrivate(ref, timeoutSeconds);
420 configs.Deserialize(ref);
421 return ret;
422 }
423
424 /**
425 * \brief Refreshes the values of the specified config group.
426 *
427 * This will wait up to #DefaultTimeoutSeconds.
428 *
429 * \details Call to refresh the selected configs from the device.
430 *
431 * \param configs The configs to refresh
432 * \returns Status code of refreshing the configs
433 */
438 /**
439 * \brief Refreshes the values of the specified config group.
440 *
441 * \details Call to refresh the selected configs from the device.
442 *
443 * \param configs The configs to refresh
444 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
445 * \returns Status code of refreshing the configs
446 */
447 ctre::phoenix::StatusCode Refresh(CANdleFeaturesConfigs &configs, wpi::units::second_t timeoutSeconds) const
448 {
449 std::string ref;
450 ctre::phoenix::StatusCode ret = GetConfigsPrivate(ref, timeoutSeconds);
451 configs.Deserialize(ref);
452 return ret;
453 }
454
455
456 /**
457 * \brief Clear the sticky faults in the device.
458 *
459 * \details This typically has no impact on the device functionality.
460 * Instead, it just clears telemetry faults that are accessible via
461 * API and Tuner Self-Test.
462 *
463 * This will wait up to #DefaultTimeoutSeconds.
464 *
465 * This is available in the configurator in case the user wants
466 * to initialize their device entirely without passing a device
467 * reference down to the code that performs the initialization.
468 * In this case, the user passes down the configurator object
469 * and performs all the initialization code on the object.
470 *
471 * \returns StatusCode of the set command
472 */
477 /**
478 * \brief Clear the sticky faults in the device.
479 *
480 * \details This typically has no impact on the device functionality.
481 * Instead, it just clears telemetry faults that are accessible via
482 * API and Tuner Self-Test.
483 *
484 * This is available in the configurator in case the user wants
485 * to initialize their device entirely without passing a device
486 * reference down to the code that performs the initialization.
487 * In this case, the user passes down the configurator object
488 * and performs all the initialization code on the object.
489 *
490 * \param timeoutSeconds Maximum time to wait up to in seconds.
491 * \returns StatusCode of the set command
492 */
493 ctre::phoenix::StatusCode ClearStickyFaults(wpi::units::second_t timeoutSeconds);
494
495 /**
496 * \brief Clear sticky fault: Hardware fault occurred
497 *
498 * This will wait up to #DefaultTimeoutSeconds.
499 *
500 * This is available in the configurator in case the user wants
501 * to initialize their device entirely without passing a device
502 * reference down to the code that performs the initialization.
503 * In this case, the user passes down the configurator object
504 * and performs all the initialization code on the object.
505 *
506 * \returns StatusCode of the set command
507 */
512 /**
513 * \brief Clear sticky fault: Hardware fault occurred
514 *
515 * This is available in the configurator in case the user wants
516 * to initialize their device entirely without passing a device
517 * reference down to the code that performs the initialization.
518 * In this case, the user passes down the configurator object
519 * and performs all the initialization code on the object.
520 *
521 * \param timeoutSeconds Maximum time to wait up to in seconds.
522 * \returns StatusCode of the set command
523 */
524 ctre::phoenix::StatusCode ClearStickyFault_Hardware(wpi::units::second_t timeoutSeconds);
525
526 /**
527 * \brief Clear sticky fault: Device supply voltage dropped to near
528 * brownout levels
529 *
530 * This will wait up to #DefaultTimeoutSeconds.
531 *
532 * This is available in the configurator in case the user wants
533 * to initialize their device entirely without passing a device
534 * reference down to the code that performs the initialization.
535 * In this case, the user passes down the configurator object
536 * and performs all the initialization code on the object.
537 *
538 * \returns StatusCode of the set command
539 */
544 /**
545 * \brief Clear sticky fault: Device supply voltage dropped to near
546 * brownout levels
547 *
548 * This is available in the configurator in case the user wants
549 * to initialize their device entirely without passing a device
550 * reference down to the code that performs the initialization.
551 * In this case, the user passes down the configurator object
552 * and performs all the initialization code on the object.
553 *
554 * \param timeoutSeconds Maximum time to wait up to in seconds.
555 * \returns StatusCode of the set command
556 */
557 ctre::phoenix::StatusCode ClearStickyFault_Undervoltage(wpi::units::second_t timeoutSeconds);
558
559 /**
560 * \brief Clear sticky fault: Device boot while detecting the enable
561 * signal
562 *
563 * This will wait up to #DefaultTimeoutSeconds.
564 *
565 * This is available in the configurator in case the user wants
566 * to initialize their device entirely without passing a device
567 * reference down to the code that performs the initialization.
568 * In this case, the user passes down the configurator object
569 * and performs all the initialization code on the object.
570 *
571 * \returns StatusCode of the set command
572 */
577 /**
578 * \brief Clear sticky fault: Device boot while detecting the enable
579 * signal
580 *
581 * This is available in the configurator in case the user wants
582 * to initialize their device entirely without passing a device
583 * reference down to the code that performs the initialization.
584 * In this case, the user passes down the configurator object
585 * and performs all the initialization code on the object.
586 *
587 * \param timeoutSeconds Maximum time to wait up to in seconds.
588 * \returns StatusCode of the set command
589 */
591
592 /**
593 * \brief Clear sticky fault: An unlicensed feature is in use, device
594 * may not behave as expected.
595 *
596 * This will wait up to #DefaultTimeoutSeconds.
597 *
598 * This is available in the configurator in case the user wants
599 * to initialize their device entirely without passing a device
600 * reference down to the code that performs the initialization.
601 * In this case, the user passes down the configurator object
602 * and performs all the initialization code on the object.
603 *
604 * \returns StatusCode of the set command
605 */
610 /**
611 * \brief Clear sticky fault: An unlicensed feature is in use, device
612 * may not behave as expected.
613 *
614 * This is available in the configurator in case the user wants
615 * to initialize their device entirely without passing a device
616 * reference down to the code that performs the initialization.
617 * In this case, the user passes down the configurator object
618 * and performs all the initialization code on the object.
619 *
620 * \param timeoutSeconds Maximum time to wait up to in seconds.
621 * \returns StatusCode of the set command
622 */
624
625 /**
626 * \brief Clear sticky fault: Device supply voltage is too high (above
627 * 30 V).
628 *
629 * This will wait up to #DefaultTimeoutSeconds.
630 *
631 * This is available in the configurator in case the user wants
632 * to initialize their device entirely without passing a device
633 * reference down to the code that performs the initialization.
634 * In this case, the user passes down the configurator object
635 * and performs all the initialization code on the object.
636 *
637 * \returns StatusCode of the set command
638 */
643 /**
644 * \brief Clear sticky fault: Device supply voltage is too high (above
645 * 30 V).
646 *
647 * This is available in the configurator in case the user wants
648 * to initialize their device entirely without passing a device
649 * reference down to the code that performs the initialization.
650 * In this case, the user passes down the configurator object
651 * and performs all the initialization code on the object.
652 *
653 * \param timeoutSeconds Maximum time to wait up to in seconds.
654 * \returns StatusCode of the set command
655 */
656 ctre::phoenix::StatusCode ClearStickyFault_Overvoltage(wpi::units::second_t timeoutSeconds);
657
658 /**
659 * \brief Clear sticky fault: Device 5V line is too high (above 6 V).
660 *
661 * This will wait up to #DefaultTimeoutSeconds.
662 *
663 * This is available in the configurator in case the user wants
664 * to initialize their device entirely without passing a device
665 * reference down to the code that performs the initialization.
666 * In this case, the user passes down the configurator object
667 * and performs all the initialization code on the object.
668 *
669 * \returns StatusCode of the set command
670 */
675 /**
676 * \brief Clear sticky fault: Device 5V line is too high (above 6 V).
677 *
678 * This is available in the configurator in case the user wants
679 * to initialize their device entirely without passing a device
680 * reference down to the code that performs the initialization.
681 * In this case, the user passes down the configurator object
682 * and performs all the initialization code on the object.
683 *
684 * \param timeoutSeconds Maximum time to wait up to in seconds.
685 * \returns StatusCode of the set command
686 */
687 ctre::phoenix::StatusCode ClearStickyFault_5VTooHigh(wpi::units::second_t timeoutSeconds);
688
689 /**
690 * \brief Clear sticky fault: Device 5V line is too low (below 4 V).
691 *
692 * This will wait up to #DefaultTimeoutSeconds.
693 *
694 * This is available in the configurator in case the user wants
695 * to initialize their device entirely without passing a device
696 * reference down to the code that performs the initialization.
697 * In this case, the user passes down the configurator object
698 * and performs all the initialization code on the object.
699 *
700 * \returns StatusCode of the set command
701 */
706 /**
707 * \brief Clear sticky fault: Device 5V line is too low (below 4 V).
708 *
709 * This is available in the configurator in case the user wants
710 * to initialize their device entirely without passing a device
711 * reference down to the code that performs the initialization.
712 * In this case, the user passes down the configurator object
713 * and performs all the initialization code on the object.
714 *
715 * \param timeoutSeconds Maximum time to wait up to in seconds.
716 * \returns StatusCode of the set command
717 */
718 ctre::phoenix::StatusCode ClearStickyFault_5VTooLow(wpi::units::second_t timeoutSeconds);
719
720 /**
721 * \brief Clear sticky fault: Device temperature exceeded limit.
722 *
723 * This will wait up to #DefaultTimeoutSeconds.
724 *
725 * This is available in the configurator in case the user wants
726 * to initialize their device entirely without passing a device
727 * reference down to the code that performs the initialization.
728 * In this case, the user passes down the configurator object
729 * and performs all the initialization code on the object.
730 *
731 * \returns StatusCode of the set command
732 */
737 /**
738 * \brief Clear sticky fault: Device temperature exceeded limit.
739 *
740 * This is available in the configurator in case the user wants
741 * to initialize their device entirely without passing a device
742 * reference down to the code that performs the initialization.
743 * In this case, the user passes down the configurator object
744 * and performs all the initialization code on the object.
745 *
746 * \param timeoutSeconds Maximum time to wait up to in seconds.
747 * \returns StatusCode of the set command
748 */
749 ctre::phoenix::StatusCode ClearStickyFault_Thermal(wpi::units::second_t timeoutSeconds);
750
751 /**
752 * \brief Clear sticky fault: CANdle output current exceeded the 6 A
753 * limit.
754 *
755 * This will wait up to #DefaultTimeoutSeconds.
756 *
757 * This is available in the configurator in case the user wants
758 * to initialize their device entirely without passing a device
759 * reference down to the code that performs the initialization.
760 * In this case, the user passes down the configurator object
761 * and performs all the initialization code on the object.
762 *
763 * \returns StatusCode of the set command
764 */
769 /**
770 * \brief Clear sticky fault: CANdle output current exceeded the 6 A
771 * limit.
772 *
773 * This is available in the configurator in case the user wants
774 * to initialize their device entirely without passing a device
775 * reference down to the code that performs the initialization.
776 * In this case, the user passes down the configurator object
777 * and performs all the initialization code on the object.
778 *
779 * \param timeoutSeconds Maximum time to wait up to in seconds.
780 * \returns StatusCode of the set command
781 */
782 ctre::phoenix::StatusCode ClearStickyFault_SoftwareFuse(wpi::units::second_t timeoutSeconds);
783
784 /**
785 * \brief Clear sticky fault: CANdle has detected the output pin is
786 * shorted.
787 *
788 * This will wait up to #DefaultTimeoutSeconds.
789 *
790 * This is available in the configurator in case the user wants
791 * to initialize their device entirely without passing a device
792 * reference down to the code that performs the initialization.
793 * In this case, the user passes down the configurator object
794 * and performs all the initialization code on the object.
795 *
796 * \returns StatusCode of the set command
797 */
802 /**
803 * \brief Clear sticky fault: CANdle has detected the output pin is
804 * shorted.
805 *
806 * This is available in the configurator in case the user wants
807 * to initialize their device entirely without passing a device
808 * reference down to the code that performs the initialization.
809 * In this case, the user passes down the configurator object
810 * and performs all the initialization code on the object.
811 *
812 * \param timeoutSeconds Maximum time to wait up to in seconds.
813 * \returns StatusCode of the set command
814 */
815 ctre::phoenix::StatusCode ClearStickyFault_ShortCircuit(wpi::units::second_t timeoutSeconds);
816};
817
818}
819
820namespace hardware {
821namespace core {
822
823#if defined(_WIN32) || defined(_WIN64)
824#pragma warning(push)
825#pragma warning(disable : 4250)
826#endif
827
828/**
829 * Class for CTR Electronics' CANdle® branded device, a device that controls
830 * LEDs over the CAN bus.
831 */
833{
834private:
836
837public:
838 /**
839 * \brief The configuration class for this device.
840 */
842
843 /**
844 * Constructs a new CANdle object.
845 *
846 * \param deviceId ID of the device, as configured in Phoenix Tuner
847 * \param canbus The CAN bus this device is on
848 */
849 CoreCANdle(int deviceId, CANBus canbus);
850
851 /**
852 * \brief Constructs a stubbed-out CoreCANdle, where all status signals, controls,
853 * configs, etc. perform no action and immediately return OK. This can be used to
854 * silence error messages for devices that have been completely removed from the robot.
855 *
856 * \returns Stubbed-out CoreCANdle
857 */
859 {
860 return CoreCANdle{-1, CANBus{}};
861 }
862
863 /**
864 * \brief Gets the configurator for this CANdle. Users may use this to refresh
865 * and apply configs.
866 *
867 * \returns Configurator for this CANdle
868 */
870 {
871 return _configs;
872 }
873
874 /**
875 * \brief Gets the configurator for this CANdle
876 *
877 * \details Gets the configurator for this CANdle
878 *
879 * \returns Configurator for this CANdle
880 */
882 {
883 return _configs;
884 }
885
886
887private:
888 std::unique_ptr<sim::CANdleSimState> _simState{};
889public:
890 /**
891 * \brief Get the simulation state for this device.
892 *
893 * \details This function reuses an allocated simulation
894 * state object, so it is safe to call this function multiple
895 * times in a robot loop.
896 *
897 * \returns Simulation state
898 */
900 {
901 if (_simState == nullptr)
902 _simState = std::make_unique<sim::CANdleSimState>(*this);
903 return *_simState;
904 }
905
906
907
908 /**
909 * \brief App Major Version number.
910 *
911 * - Minimum Value: 0
912 * - Maximum Value: 255
913 * - Default Value: 0
914 * - Units:
915 *
916 * Default Rates:
917 * - CAN: 4.0 Hz
918 *
919 * This refreshes and returns a cached StatusSignal object.
920 *
921 * \param refresh Whether to refresh the StatusSignal before returning it;
922 * defaults to true
923 * \returns VersionMajor Status Signal Object
924 */
925 StatusSignal<int> &GetVersionMajor(bool refresh = true);
926
927 /**
928 * \brief App Minor Version number.
929 *
930 * - Minimum Value: 0
931 * - Maximum Value: 255
932 * - Default Value: 0
933 * - Units:
934 *
935 * Default Rates:
936 * - CAN: 4.0 Hz
937 *
938 * This refreshes and returns a cached StatusSignal object.
939 *
940 * \param refresh Whether to refresh the StatusSignal before returning it;
941 * defaults to true
942 * \returns VersionMinor Status Signal Object
943 */
944 StatusSignal<int> &GetVersionMinor(bool refresh = true);
945
946 /**
947 * \brief App Bugfix Version number.
948 *
949 * - Minimum Value: 0
950 * - Maximum Value: 255
951 * - Default Value: 0
952 * - Units:
953 *
954 * Default Rates:
955 * - CAN: 4.0 Hz
956 *
957 * This refreshes and returns a cached StatusSignal object.
958 *
959 * \param refresh Whether to refresh the StatusSignal before returning it;
960 * defaults to true
961 * \returns VersionBugfix Status Signal Object
962 */
963 StatusSignal<int> &GetVersionBugfix(bool refresh = true);
964
965 /**
966 * \brief App Build Version number.
967 *
968 * - Minimum Value: 0
969 * - Maximum Value: 255
970 * - Default Value: 0
971 * - Units:
972 *
973 * Default Rates:
974 * - CAN: 4.0 Hz
975 *
976 * This refreshes and returns a cached StatusSignal object.
977 *
978 * \param refresh Whether to refresh the StatusSignal before returning it;
979 * defaults to true
980 * \returns VersionBuild Status Signal Object
981 */
982 StatusSignal<int> &GetVersionBuild(bool refresh = true);
983
984 /**
985 * \brief Full Version of firmware in device. The format is a four
986 * byte value.
987 *
988 * - Minimum Value: 0
989 * - Maximum Value: 4294967295
990 * - Default Value: 0
991 * - Units:
992 *
993 * Default Rates:
994 * - CAN: 4.0 Hz
995 *
996 * This refreshes and returns a cached StatusSignal object.
997 *
998 * \param refresh Whether to refresh the StatusSignal before returning it;
999 * defaults to true
1000 * \returns Version Status Signal Object
1001 */
1002 StatusSignal<int> &GetVersion(bool refresh = true);
1003
1004 /**
1005 * \brief Integer representing all fault flags reported by the device.
1006 *
1007 * \details These are device specific and are not used directly in
1008 * typical applications. Use the signal specific GetFault_*() methods
1009 * instead.
1010 *
1011 * - Minimum Value: 0
1012 * - Maximum Value: 4294967295
1013 * - Default Value: 0
1014 * - Units:
1015 *
1016 * Default Rates:
1017 * - CAN: 4.0 Hz
1018 *
1019 * This refreshes and returns a cached StatusSignal object.
1020 *
1021 * \param refresh Whether to refresh the StatusSignal before returning it;
1022 * defaults to true
1023 * \returns FaultField Status Signal Object
1024 */
1025 StatusSignal<int> &GetFaultField(bool refresh = true);
1026
1027 /**
1028 * \brief Integer representing all (persistent) sticky fault flags
1029 * reported by the device.
1030 *
1031 * \details These are device specific and are not used directly in
1032 * typical applications. Use the signal specific GetStickyFault_*()
1033 * methods instead.
1034 *
1035 * - Minimum Value: 0
1036 * - Maximum Value: 4294967295
1037 * - Default Value: 0
1038 * - Units:
1039 *
1040 * Default Rates:
1041 * - CAN: 4.0 Hz
1042 *
1043 * This refreshes and returns a cached StatusSignal object.
1044 *
1045 * \param refresh Whether to refresh the StatusSignal before returning it;
1046 * defaults to true
1047 * \returns StickyFaultField Status Signal Object
1048 */
1050
1051 /**
1052 * \brief Whether the device is Phoenix Pro licensed.
1053 *
1054 * - Default Value: False
1055 *
1056 * Default Rates:
1057 * - CAN: 4.0 Hz
1058 *
1059 * This refreshes and returns a cached StatusSignal object.
1060 *
1061 * \param refresh Whether to refresh the StatusSignal before returning it;
1062 * defaults to true
1063 * \returns IsProLicensed Status Signal Object
1064 */
1066
1067 /**
1068 * \brief Measured supply voltage to the CANdle.
1069 *
1070 * - Minimum Value: 0.0
1071 * - Maximum Value: 32.767
1072 * - Default Value: 0
1073 * - Units: V
1074 *
1075 * Default Rates:
1076 * - CAN 2.0: 10.0 Hz
1077 * - CAN FD: 10.0 Hz (TimeSynced with Pro)
1078 *
1079 * This refreshes and returns a cached StatusSignal object.
1080 *
1081 * \param refresh Whether to refresh the StatusSignal before returning it;
1082 * defaults to true
1083 * \returns SupplyVoltage Status Signal Object
1084 */
1086
1087 /**
1088 * \brief The measured voltage of the 5V rail line.
1089 *
1090 * - Minimum Value: 0.0
1091 * - Maximum Value: 10.23
1092 * - Default Value: 0
1093 * - Units: V
1094 *
1095 * Default Rates:
1096 * - CAN 2.0: 10.0 Hz
1097 * - CAN FD: 10.0 Hz (TimeSynced with Pro)
1098 *
1099 * This refreshes and returns a cached StatusSignal object.
1100 *
1101 * \param refresh Whether to refresh the StatusSignal before returning it;
1102 * defaults to true
1103 * \returns FiveVRailVoltage Status Signal Object
1104 */
1106
1107 /**
1108 * \brief The measured output current. This includes both VBat and 5V
1109 * output current.
1110 *
1111 * - Minimum Value: 0.0
1112 * - Maximum Value: 10.23
1113 * - Default Value: 0
1114 * - Units: A
1115 *
1116 * Default Rates:
1117 * - CAN 2.0: 10.0 Hz
1118 * - CAN FD: 10.0 Hz (TimeSynced with Pro)
1119 *
1120 * This refreshes and returns a cached StatusSignal object.
1121 *
1122 * \param refresh Whether to refresh the StatusSignal before returning it;
1123 * defaults to true
1124 * \returns OutputCurrent Status Signal Object
1125 */
1127
1128 /**
1129 * \brief The temperature that the CANdle measures itself to be at.
1130 *
1131 * - Minimum Value: -128
1132 * - Maximum Value: 127
1133 * - Default Value: 0
1134 * - Units: ℃
1135 *
1136 * Default Rates:
1137 * - CAN 2.0: 10.0 Hz
1138 * - CAN FD: 10.0 Hz (TimeSynced with Pro)
1139 *
1140 * This refreshes and returns a cached StatusSignal object.
1141 *
1142 * \param refresh Whether to refresh the StatusSignal before returning it;
1143 * defaults to true
1144 * \returns DeviceTemp Status Signal Object
1145 */
1147
1148 /**
1149 * \brief The applied VBat modulation duty cycle.
1150 *
1151 * This signal will report 1.0 if the VBatOutputMode is configured to
1152 * be always on, and 0.0 if configured to be always off. Otherwise,
1153 * this will report the applied modulation from the last
1154 * ModulateVBatOut request.
1155 *
1156 * - Minimum Value: 0.0
1157 * - Maximum Value: 1.0
1158 * - Default Value: 0
1159 * - Units: frac
1160 *
1161 * Default Rates:
1162 * - CAN 2.0: 10.0 Hz
1163 * - CAN FD: 10.0 Hz (TimeSynced with Pro)
1164 *
1165 * This refreshes and returns a cached StatusSignal object.
1166 *
1167 * \param refresh Whether to refresh the StatusSignal before returning it;
1168 * defaults to true
1169 * \returns VBatModulation Status Signal Object
1170 */
1172
1173 /**
1174 * \brief The maximum number of simultaneous animations supported by
1175 * the current version of CANdle firmware.
1176 *
1177 * Any control request using an animation slot greater than or equal
1178 * to this signal will be ignored.
1179 *
1180 * - Minimum Value: 0
1181 * - Maximum Value: 31
1182 * - Default Value: 0
1183 * - Units:
1184 *
1185 * Default Rates:
1186 * - CAN 2.0: 10.0 Hz
1187 * - CAN FD: 10.0 Hz (TimeSynced with Pro)
1188 *
1189 * This refreshes and returns a cached StatusSignal object.
1190 *
1191 * \param refresh Whether to refresh the StatusSignal before returning it;
1192 * defaults to true
1193 * \returns MaxSimultaneousAnimationCount Status Signal Object
1194 */
1196
1197 /**
1198 * \brief Hardware fault occurred
1199 *
1200 * - Default Value: False
1201 *
1202 * Default Rates:
1203 * - CAN: 4.0 Hz
1204 *
1205 * This refreshes and returns a cached StatusSignal object.
1206 *
1207 * \param refresh Whether to refresh the StatusSignal before returning it;
1208 * defaults to true
1209 * \returns Fault_Hardware Status Signal Object
1210 */
1212
1213 /**
1214 * \brief Hardware fault occurred
1215 *
1216 * - Default Value: False
1217 *
1218 * Default Rates:
1219 * - CAN: 4.0 Hz
1220 *
1221 * This refreshes and returns a cached StatusSignal object.
1222 *
1223 * \param refresh Whether to refresh the StatusSignal before returning it;
1224 * defaults to true
1225 * \returns StickyFault_Hardware Status Signal Object
1226 */
1228
1229 /**
1230 * \brief Device supply voltage dropped to near brownout levels
1231 *
1232 * - Default Value: False
1233 *
1234 * Default Rates:
1235 * - CAN: 4.0 Hz
1236 *
1237 * This refreshes and returns a cached StatusSignal object.
1238 *
1239 * \param refresh Whether to refresh the StatusSignal before returning it;
1240 * defaults to true
1241 * \returns Fault_Undervoltage Status Signal Object
1242 */
1244
1245 /**
1246 * \brief Device supply voltage dropped to near brownout levels
1247 *
1248 * - Default Value: False
1249 *
1250 * Default Rates:
1251 * - CAN: 4.0 Hz
1252 *
1253 * This refreshes and returns a cached StatusSignal object.
1254 *
1255 * \param refresh Whether to refresh the StatusSignal before returning it;
1256 * defaults to true
1257 * \returns StickyFault_Undervoltage Status Signal Object
1258 */
1260
1261 /**
1262 * \brief Device boot while detecting the enable signal
1263 *
1264 * - Default Value: False
1265 *
1266 * Default Rates:
1267 * - CAN: 4.0 Hz
1268 *
1269 * This refreshes and returns a cached StatusSignal object.
1270 *
1271 * \param refresh Whether to refresh the StatusSignal before returning it;
1272 * defaults to true
1273 * \returns Fault_BootDuringEnable Status Signal Object
1274 */
1276
1277 /**
1278 * \brief Device boot while detecting the enable signal
1279 *
1280 * - Default Value: False
1281 *
1282 * Default Rates:
1283 * - CAN: 4.0 Hz
1284 *
1285 * This refreshes and returns a cached StatusSignal object.
1286 *
1287 * \param refresh Whether to refresh the StatusSignal before returning it;
1288 * defaults to true
1289 * \returns StickyFault_BootDuringEnable Status Signal Object
1290 */
1292
1293 /**
1294 * \brief An unlicensed feature is in use, device may not behave as
1295 * expected.
1296 *
1297 * - Default Value: False
1298 *
1299 * Default Rates:
1300 * - CAN: 4.0 Hz
1301 *
1302 * This refreshes and returns a cached StatusSignal object.
1303 *
1304 * \param refresh Whether to refresh the StatusSignal before returning it;
1305 * defaults to true
1306 * \returns Fault_UnlicensedFeatureInUse Status Signal Object
1307 */
1309
1310 /**
1311 * \brief An unlicensed feature is in use, device may not behave as
1312 * expected.
1313 *
1314 * - Default Value: False
1315 *
1316 * Default Rates:
1317 * - CAN: 4.0 Hz
1318 *
1319 * This refreshes and returns a cached StatusSignal object.
1320 *
1321 * \param refresh Whether to refresh the StatusSignal before returning it;
1322 * defaults to true
1323 * \returns StickyFault_UnlicensedFeatureInUse Status Signal Object
1324 */
1326
1327 /**
1328 * \brief Device supply voltage is too high (above 30 V).
1329 *
1330 * - Default Value: False
1331 *
1332 * Default Rates:
1333 * - CAN: 4.0 Hz
1334 *
1335 * This refreshes and returns a cached StatusSignal object.
1336 *
1337 * \param refresh Whether to refresh the StatusSignal before returning it;
1338 * defaults to true
1339 * \returns Fault_Overvoltage Status Signal Object
1340 */
1342
1343 /**
1344 * \brief Device supply voltage is too high (above 30 V).
1345 *
1346 * - Default Value: False
1347 *
1348 * Default Rates:
1349 * - CAN: 4.0 Hz
1350 *
1351 * This refreshes and returns a cached StatusSignal object.
1352 *
1353 * \param refresh Whether to refresh the StatusSignal before returning it;
1354 * defaults to true
1355 * \returns StickyFault_Overvoltage Status Signal Object
1356 */
1358
1359 /**
1360 * \brief Device 5V line is too high (above 6 V).
1361 *
1362 * - Default Value: False
1363 *
1364 * Default Rates:
1365 * - CAN: 4.0 Hz
1366 *
1367 * This refreshes and returns a cached StatusSignal object.
1368 *
1369 * \param refresh Whether to refresh the StatusSignal before returning it;
1370 * defaults to true
1371 * \returns Fault_5VTooHigh Status Signal Object
1372 */
1374
1375 /**
1376 * \brief Device 5V line is too high (above 6 V).
1377 *
1378 * - Default Value: False
1379 *
1380 * Default Rates:
1381 * - CAN: 4.0 Hz
1382 *
1383 * This refreshes and returns a cached StatusSignal object.
1384 *
1385 * \param refresh Whether to refresh the StatusSignal before returning it;
1386 * defaults to true
1387 * \returns StickyFault_5VTooHigh Status Signal Object
1388 */
1390
1391 /**
1392 * \brief Device 5V line is too low (below 4 V).
1393 *
1394 * - Default Value: False
1395 *
1396 * Default Rates:
1397 * - CAN: 4.0 Hz
1398 *
1399 * This refreshes and returns a cached StatusSignal object.
1400 *
1401 * \param refresh Whether to refresh the StatusSignal before returning it;
1402 * defaults to true
1403 * \returns Fault_5VTooLow Status Signal Object
1404 */
1406
1407 /**
1408 * \brief Device 5V line is too low (below 4 V).
1409 *
1410 * - Default Value: False
1411 *
1412 * Default Rates:
1413 * - CAN: 4.0 Hz
1414 *
1415 * This refreshes and returns a cached StatusSignal object.
1416 *
1417 * \param refresh Whether to refresh the StatusSignal before returning it;
1418 * defaults to true
1419 * \returns StickyFault_5VTooLow Status Signal Object
1420 */
1422
1423 /**
1424 * \brief Device temperature exceeded limit.
1425 *
1426 * - Default Value: False
1427 *
1428 * Default Rates:
1429 * - CAN: 4.0 Hz
1430 *
1431 * This refreshes and returns a cached StatusSignal object.
1432 *
1433 * \param refresh Whether to refresh the StatusSignal before returning it;
1434 * defaults to true
1435 * \returns Fault_Thermal Status Signal Object
1436 */
1438
1439 /**
1440 * \brief Device temperature exceeded limit.
1441 *
1442 * - Default Value: False
1443 *
1444 * Default Rates:
1445 * - CAN: 4.0 Hz
1446 *
1447 * This refreshes and returns a cached StatusSignal object.
1448 *
1449 * \param refresh Whether to refresh the StatusSignal before returning it;
1450 * defaults to true
1451 * \returns StickyFault_Thermal Status Signal Object
1452 */
1454
1455 /**
1456 * \brief CANdle output current exceeded the 6 A limit.
1457 *
1458 * - Default Value: False
1459 *
1460 * Default Rates:
1461 * - CAN: 4.0 Hz
1462 *
1463 * This refreshes and returns a cached StatusSignal object.
1464 *
1465 * \param refresh Whether to refresh the StatusSignal before returning it;
1466 * defaults to true
1467 * \returns Fault_SoftwareFuse Status Signal Object
1468 */
1470
1471 /**
1472 * \brief CANdle output current exceeded the 6 A limit.
1473 *
1474 * - Default Value: False
1475 *
1476 * Default Rates:
1477 * - CAN: 4.0 Hz
1478 *
1479 * This refreshes and returns a cached StatusSignal object.
1480 *
1481 * \param refresh Whether to refresh the StatusSignal before returning it;
1482 * defaults to true
1483 * \returns StickyFault_SoftwareFuse Status Signal Object
1484 */
1486
1487 /**
1488 * \brief CANdle has detected the output pin is shorted.
1489 *
1490 * - Default Value: False
1491 *
1492 * Default Rates:
1493 * - CAN: 4.0 Hz
1494 *
1495 * This refreshes and returns a cached StatusSignal object.
1496 *
1497 * \param refresh Whether to refresh the StatusSignal before returning it;
1498 * defaults to true
1499 * \returns Fault_ShortCircuit Status Signal Object
1500 */
1502
1503 /**
1504 * \brief CANdle has detected the output pin is shorted.
1505 *
1506 * - Default Value: False
1507 *
1508 * Default Rates:
1509 * - CAN: 4.0 Hz
1510 *
1511 * This refreshes and returns a cached StatusSignal object.
1512 *
1513 * \param refresh Whether to refresh the StatusSignal before returning it;
1514 * defaults to true
1515 * \returns StickyFault_ShortCircuit Status Signal Object
1516 */
1518
1519
1520 /**
1521 * \brief Modulates the CANdle VBat output to the specified duty
1522 * cycle. This can be used to control a single-color LED strip.
1523 *
1524 * Note that configs::CANdleFeaturesConfigs::VBatOutputMode must be
1525 * set to signals::VBatOutputModeValue::Modulated.
1526 *
1527 * - ModulateVBatOut Parameters:
1528 * - Output: Proportion of VBat to output in fractional units between 0.0 and
1529 * 1.0.
1530 *
1531 * \param request Control object to request of the device
1532 * \returns Status code of the request
1533 */
1535
1536 /**
1537 * \brief Sets LEDs to a solid color.
1538 *
1539 * - SolidColor Parameters:
1540 * - LEDStartIndex: The index of the first LED this animation controls
1541 * (inclusive). Indices 0-7 control the onboard LEDs, and
1542 * 8-399 control an attached LED strip.
1543 * - LEDEndIndex: The index of the last LED this animation controls
1544 * (inclusive). Indices 0-7 control the onboard LEDs, and 8-399
1545 * control an attached LED strip.
1546 * - Color: The color to apply to the LEDs.
1547 *
1548 * \param request Control object to request of the device
1549 * \returns Status code of the request
1550 */
1552
1553 /**
1554 * \brief An empty animation, clearing any animation in the specified
1555 * slot.
1556 *
1557 * - EmptyAnimation Parameters:
1558 * - Slot: The slot of this animation, within [0, 7]. Each slot on the CANdle
1559 * can store and run one animation.
1560 *
1561 * \param request Control object to request of the device
1562 * \returns Status code of the request
1563 */
1565
1566 /**
1567 * \brief Animation that gradually lights the entire LED strip one LED
1568 * at a time.
1569 *
1570 * - ColorFlowAnimation Parameters:
1571 * - LEDStartIndex: The index of the first LED this animation controls
1572 * (inclusive). Indices 0-7 control the onboard LEDs, and
1573 * 8-399 control an attached LED strip
1574 *
1575 * If the start index is greater than the end index, the
1576 * direction will be reversed. The direction can also be
1577 * changed using the Direction parameter.
1578 * - LEDEndIndex: The index of the last LED this animation controls
1579 * (inclusive). Indices 0-7 control the onboard LEDs, and 8-399
1580 * control an attached LED strip.
1581 *
1582 * If the end index is less than the start index, the direction
1583 * will be reversed. The direction can also be changed using
1584 * the Direction parameter.
1585 * - Slot: The slot of this animation, within [0, 7]. Each slot on the CANdle
1586 * can store and run one animation.
1587 * - Color: The color to use in the animation.
1588 * - Direction: The direction of the animation.
1589 * - FrameRate: The frame rate of the animation, from [2, 1000] Hz. This
1590 * determines the speed of the animation.
1591 *
1592 * A frame is defined as a transition in the state of the LEDs,
1593 * turning one on or off.
1594 *
1595 * \param request Control object to request of the device
1596 * \returns Status code of the request
1597 */
1599
1600 /**
1601 * \brief Animation that looks similar to a flame flickering.
1602 *
1603 * - FireAnimation Parameters:
1604 * - LEDStartIndex: The index of the first LED this animation controls
1605 * (inclusive). Indices 0-7 control the onboard LEDs, and
1606 * 8-399 control an attached LED strip
1607 *
1608 * If the start index is greater than the end index, the
1609 * direction will be reversed. The direction can also be
1610 * changed using the Direction parameter.
1611 * - LEDEndIndex: The index of the last LED this animation controls
1612 * (inclusive). Indices 0-7 control the onboard LEDs, and 8-399
1613 * control an attached LED strip.
1614 *
1615 * If the end index is less than the start index, the direction
1616 * will be reversed. The direction can also be changed using
1617 * the Direction parameter.
1618 * - Slot: The slot of this animation, within [0, 7]. Each slot on the CANdle
1619 * can store and run one animation.
1620 * - Brightness: The brightness of the animation, as a scalar from 0.0 to 1.0.
1621 * - Direction: The direction of the animation.
1622 * - Sparking: The proportion of time in which sparks reignite the fire, as a
1623 * scalar from 0.0 to 1.0.
1624 * - Cooling: The rate at which the fire cools along the travel, as a scalar
1625 * from 0.0 to 1.0.
1626 * - FrameRate: The frame rate of the animation, from [2, 1000] Hz. This
1627 * determines the speed of the animation.
1628 *
1629 * A frame is defined as a transition in the state of the LEDs,
1630 * advancing the animation of the fire.
1631 *
1632 * \param request Control object to request of the device
1633 * \returns Status code of the request
1634 */
1636
1637 /**
1638 * \brief Animation that bounces a pocket of light across the LED
1639 * strip.
1640 *
1641 * - LarsonAnimation Parameters:
1642 * - LEDStartIndex: The index of the first LED this animation controls
1643 * (inclusive). Indices 0-7 control the onboard LEDs, and
1644 * 8-399 control an attached LED strip.
1645 * - LEDEndIndex: The index of the last LED this animation controls
1646 * (inclusive). Indices 0-7 control the onboard LEDs, and 8-399
1647 * control an attached LED strip.
1648 * - Slot: The slot of this animation, within [0, 7]. Each slot on the CANdle
1649 * can store and run one animation.
1650 * - Color: The color to use in the animation.
1651 * - Size: The number of LEDs in the pocket of light, up to 15.
1652 * - BounceMode: The behavior of the pocket of light when it reaches the end
1653 * of the strip.
1654 * - FrameRate: The frame rate of the animation, from [2, 1000] Hz. This
1655 * determines the speed of the animation.
1656 *
1657 * A frame is defined as a transition in the state of the LEDs,
1658 * advancing the pocket of light by one LED.
1659 *
1660 * \param request Control object to request of the device
1661 * \returns Status code of the request
1662 */
1664
1665 /**
1666 * \brief Animation that creates a rainbow throughout all the LEDs.
1667 *
1668 * - RainbowAnimation Parameters:
1669 * - LEDStartIndex: The index of the first LED this animation controls
1670 * (inclusive). Indices 0-7 control the onboard LEDs, and
1671 * 8-399 control an attached LED strip
1672 *
1673 * If the start index is greater than the end index, the
1674 * direction will be reversed. The direction can also be
1675 * changed using the Direction parameter.
1676 * - LEDEndIndex: The index of the last LED this animation controls
1677 * (inclusive). Indices 0-7 control the onboard LEDs, and 8-399
1678 * control an attached LED strip.
1679 *
1680 * If the end index is less than the start index, the direction
1681 * will be reversed. The direction can also be changed using
1682 * the Direction parameter.
1683 * - Slot: The slot of this animation, within [0, 7]. Each slot on the CANdle
1684 * can store and run one animation.
1685 * - Brightness: The brightness of the animation, as a scalar from 0.0 to 1.0.
1686 * - Direction: The direction of the animation.
1687 * - FrameRate: The frame rate of the animation, from [2, 1000] Hz. This
1688 * determines the speed of the animation.
1689 *
1690 * A frame is defined as a transition in the state of the LEDs,
1691 * advancing the rainbow by about 3 degrees of hue (out of 360
1692 * degrees).
1693 *
1694 * \param request Control object to request of the device
1695 * \returns Status code of the request
1696 */
1698
1699 /**
1700 * \brief Animation that fades all the LEDs of a strip simultaneously
1701 * between Red, Green, and Blue.
1702 *
1703 * - RgbFadeAnimation Parameters:
1704 * - LEDStartIndex: The index of the first LED this animation controls
1705 * (inclusive). Indices 0-7 control the onboard LEDs, and
1706 * 8-399 control an attached LED strip.
1707 * - LEDEndIndex: The index of the last LED this animation controls
1708 * (inclusive). Indices 0-7 control the onboard LEDs, and 8-399
1709 * control an attached LED strip.
1710 * - Slot: The slot of this animation, within [0, 7]. Each slot on the CANdle
1711 * can store and run one animation.
1712 * - Brightness: The brightness of the animation, as a scalar from 0.0 to 1.0.
1713 * - FrameRate: The frame rate of the animation, from [2, 1000] Hz. This
1714 * determines the speed of the animation.
1715 *
1716 * A frame is defined as a transition in the state of the LEDs,
1717 * adjusting the brightness of the LEDs by 1%.
1718 *
1719 * \param request Control object to request of the device
1720 * \returns Status code of the request
1721 */
1723
1724 /**
1725 * \brief Animation that fades into and out of a specified color.
1726 *
1727 * - SingleFadeAnimation Parameters:
1728 * - LEDStartIndex: The index of the first LED this animation controls
1729 * (inclusive). Indices 0-7 control the onboard LEDs, and
1730 * 8-399 control an attached LED strip.
1731 * - LEDEndIndex: The index of the last LED this animation controls
1732 * (inclusive). Indices 0-7 control the onboard LEDs, and 8-399
1733 * control an attached LED strip.
1734 * - Slot: The slot of this animation, within [0, 7]. Each slot on the CANdle
1735 * can store and run one animation.
1736 * - Color: The color to use in the animation.
1737 * - FrameRate: The frame rate of the animation, from [2, 1000] Hz. This
1738 * determines the speed of the animation.
1739 *
1740 * A frame is defined as a transition in the state of the LEDs,
1741 * adjusting the brightness of the LEDs by 1%.
1742 *
1743 * \param request Control object to request of the device
1744 * \returns Status code of the request
1745 */
1747
1748 /**
1749 * \brief Animation that strobes the LEDs a specified color.
1750 *
1751 * - StrobeAnimation Parameters:
1752 * - LEDStartIndex: The index of the first LED this animation controls
1753 * (inclusive). Indices 0-7 control the onboard LEDs, and
1754 * 8-399 control an attached LED strip.
1755 * - LEDEndIndex: The index of the last LED this animation controls
1756 * (inclusive). Indices 0-7 control the onboard LEDs, and 8-399
1757 * control an attached LED strip.
1758 * - Slot: The slot of this animation, within [0, 7]. Each slot on the CANdle
1759 * can store and run one animation.
1760 * - Color: The color to use in the animation.
1761 * - FrameRate: The frame rate of the animation, from [1, 500] Hz. This
1762 * determines the speed of the animation.
1763 *
1764 * A frame is defined as a transition in the state of the LEDs,
1765 * turning all LEDs on or off.
1766 *
1767 * \param request Control object to request of the device
1768 * \returns Status code of the request
1769 */
1771
1772 /**
1773 * \brief Animation that randomly turns LEDs on and off to a certain
1774 * color.
1775 *
1776 * - TwinkleAnimation Parameters:
1777 * - LEDStartIndex: The index of the first LED this animation controls
1778 * (inclusive). Indices 0-7 control the onboard LEDs, and
1779 * 8-399 control an attached LED strip.
1780 * - LEDEndIndex: The index of the last LED this animation controls
1781 * (inclusive). Indices 0-7 control the onboard LEDs, and 8-399
1782 * control an attached LED strip.
1783 * - Slot: The slot of this animation, within [0, 7]. Each slot on the CANdle
1784 * can store and run one animation.
1785 * - Color: The color to use in the animation.
1786 * - MaxLEDsOnProportion: The max proportion of LEDs that can be on, in the
1787 * range [0.1, 1.0].
1788 * - FrameRate: The frame rate of the animation, from [2, 1000] Hz. This
1789 * determines the speed of the animation.
1790 *
1791 * A frame is defined as a transition in the state of the LEDs,
1792 * turning one on or off.
1793 *
1794 * \param request Control object to request of the device
1795 * \returns Status code of the request
1796 */
1798
1799 /**
1800 * \brief Animation that randomly turns on LEDs until it reaches the
1801 * maximum count, and then turns them all off.
1802 *
1803 * - TwinkleOffAnimation Parameters:
1804 * - LEDStartIndex: The index of the first LED this animation controls
1805 * (inclusive). Indices 0-7 control the onboard LEDs, and
1806 * 8-399 control an attached LED strip.
1807 * - LEDEndIndex: The index of the last LED this animation controls
1808 * (inclusive). Indices 0-7 control the onboard LEDs, and 8-399
1809 * control an attached LED strip.
1810 * - Slot: The slot of this animation, within [0, 7]. Each slot on the CANdle
1811 * can store and run one animation.
1812 * - Color: The color to use in the animation.
1813 * - MaxLEDsOnProportion: The max proportion of LEDs that can be on, in the
1814 * range [0.1, 1.0].
1815 * - FrameRate: The frame rate of the animation, from [2, 1000] Hz. This
1816 * determines the speed of the animation.
1817 *
1818 * A frame is defined as a transition in the state of the LEDs,
1819 * turning one LED on or all LEDs off.
1820 *
1821 * \param request Control object to request of the device
1822 * \returns Status code of the request
1823 */
1825
1826 /**
1827 * \brief Apply a generic empty control used to do nothing.
1828 *
1829 * \param request Control object to request of the device
1830 * \returns Status code of the request
1831 */
1833
1834 /**
1835 * \brief Control device with generic control request object. User must make
1836 * sure the specified object is castable to a valid control request,
1837 * otherwise this function will fail at run-time and return the NotSupported
1838 * StatusCode
1839 *
1840 * \param request Control object to request of the device
1841 * \returns Status code of the request
1842 */
1844
1845
1846 /**
1847 * \brief Clear the sticky faults in the device.
1848 *
1849 * \details This typically has no impact on the device functionality.
1850 * Instead, it just clears telemetry faults that are accessible via
1851 * API and Tuner Self-Test.
1852 *
1853 * \param timeoutSeconds Maximum time to wait up to in seconds.
1854 * \returns StatusCode of the set command
1855 */
1856 ctre::phoenix::StatusCode ClearStickyFaults(wpi::units::second_t timeoutSeconds)
1857 {
1858 return GetConfigurator().ClearStickyFaults(timeoutSeconds);
1859 }
1860 /**
1861 * \brief Clear the sticky faults in the device.
1862 *
1863 * \details This typically has no impact on the device functionality.
1864 * Instead, it just clears telemetry faults that are accessible via
1865 * API and Tuner Self-Test.
1866 *
1867 * This will wait up to 0.100 seconds (100ms) by default.
1868 *
1869 * \returns StatusCode of the set command
1870 */
1875
1876 /**
1877 * \brief Clear sticky fault: Hardware fault occurred
1878 *
1879 * \param timeoutSeconds Maximum time to wait up to in seconds.
1880 * \returns StatusCode of the set command
1881 */
1882 ctre::phoenix::StatusCode ClearStickyFault_Hardware(wpi::units::second_t timeoutSeconds)
1883 {
1884 return GetConfigurator().ClearStickyFault_Hardware(timeoutSeconds);
1885 }
1886 /**
1887 * \brief Clear sticky fault: Hardware fault occurred
1888 *
1889 * This will wait up to 0.100 seconds (100ms) by default.
1890 *
1891 * \returns StatusCode of the set command
1892 */
1897
1898 /**
1899 * \brief Clear sticky fault: Device supply voltage dropped to near
1900 * brownout levels
1901 *
1902 * \param timeoutSeconds Maximum time to wait up to in seconds.
1903 * \returns StatusCode of the set command
1904 */
1906 {
1907 return GetConfigurator().ClearStickyFault_Undervoltage(timeoutSeconds);
1908 }
1909 /**
1910 * \brief Clear sticky fault: Device supply voltage dropped to near
1911 * brownout levels
1912 *
1913 * This will wait up to 0.100 seconds (100ms) by default.
1914 *
1915 * \returns StatusCode of the set command
1916 */
1921
1922 /**
1923 * \brief Clear sticky fault: Device boot while detecting the enable
1924 * signal
1925 *
1926 * \param timeoutSeconds Maximum time to wait up to in seconds.
1927 * \returns StatusCode of the set command
1928 */
1930 {
1931 return GetConfigurator().ClearStickyFault_BootDuringEnable(timeoutSeconds);
1932 }
1933 /**
1934 * \brief Clear sticky fault: Device boot while detecting the enable
1935 * signal
1936 *
1937 * This will wait up to 0.100 seconds (100ms) by default.
1938 *
1939 * \returns StatusCode of the set command
1940 */
1945
1946 /**
1947 * \brief Clear sticky fault: An unlicensed feature is in use, device
1948 * may not behave as expected.
1949 *
1950 * \param timeoutSeconds Maximum time to wait up to in seconds.
1951 * \returns StatusCode of the set command
1952 */
1954 {
1955 return GetConfigurator().ClearStickyFault_UnlicensedFeatureInUse(timeoutSeconds);
1956 }
1957 /**
1958 * \brief Clear sticky fault: An unlicensed feature is in use, device
1959 * may not behave as expected.
1960 *
1961 * This will wait up to 0.100 seconds (100ms) by default.
1962 *
1963 * \returns StatusCode of the set command
1964 */
1969
1970 /**
1971 * \brief Clear sticky fault: Device supply voltage is too high (above
1972 * 30 V).
1973 *
1974 * \param timeoutSeconds Maximum time to wait up to in seconds.
1975 * \returns StatusCode of the set command
1976 */
1977 ctre::phoenix::StatusCode ClearStickyFault_Overvoltage(wpi::units::second_t timeoutSeconds)
1978 {
1979 return GetConfigurator().ClearStickyFault_Overvoltage(timeoutSeconds);
1980 }
1981 /**
1982 * \brief Clear sticky fault: Device supply voltage is too high (above
1983 * 30 V).
1984 *
1985 * This will wait up to 0.100 seconds (100ms) by default.
1986 *
1987 * \returns StatusCode of the set command
1988 */
1993
1994 /**
1995 * \brief Clear sticky fault: Device 5V line is too high (above 6 V).
1996 *
1997 * \param timeoutSeconds Maximum time to wait up to in seconds.
1998 * \returns StatusCode of the set command
1999 */
2000 ctre::phoenix::StatusCode ClearStickyFault_5VTooHigh(wpi::units::second_t timeoutSeconds)
2001 {
2002 return GetConfigurator().ClearStickyFault_5VTooHigh(timeoutSeconds);
2003 }
2004 /**
2005 * \brief Clear sticky fault: Device 5V line is too high (above 6 V).
2006 *
2007 * This will wait up to 0.100 seconds (100ms) by default.
2008 *
2009 * \returns StatusCode of the set command
2010 */
2015
2016 /**
2017 * \brief Clear sticky fault: Device 5V line is too low (below 4 V).
2018 *
2019 * \param timeoutSeconds Maximum time to wait up to in seconds.
2020 * \returns StatusCode of the set command
2021 */
2022 ctre::phoenix::StatusCode ClearStickyFault_5VTooLow(wpi::units::second_t timeoutSeconds)
2023 {
2024 return GetConfigurator().ClearStickyFault_5VTooLow(timeoutSeconds);
2025 }
2026 /**
2027 * \brief Clear sticky fault: Device 5V line is too low (below 4 V).
2028 *
2029 * This will wait up to 0.100 seconds (100ms) by default.
2030 *
2031 * \returns StatusCode of the set command
2032 */
2037
2038 /**
2039 * \brief Clear sticky fault: Device temperature exceeded limit.
2040 *
2041 * \param timeoutSeconds Maximum time to wait up to in seconds.
2042 * \returns StatusCode of the set command
2043 */
2044 ctre::phoenix::StatusCode ClearStickyFault_Thermal(wpi::units::second_t timeoutSeconds)
2045 {
2046 return GetConfigurator().ClearStickyFault_Thermal(timeoutSeconds);
2047 }
2048 /**
2049 * \brief Clear sticky fault: Device temperature exceeded limit.
2050 *
2051 * This will wait up to 0.100 seconds (100ms) by default.
2052 *
2053 * \returns StatusCode of the set command
2054 */
2059
2060 /**
2061 * \brief Clear sticky fault: CANdle output current exceeded the 6 A
2062 * limit.
2063 *
2064 * \param timeoutSeconds Maximum time to wait up to in seconds.
2065 * \returns StatusCode of the set command
2066 */
2068 {
2069 return GetConfigurator().ClearStickyFault_SoftwareFuse(timeoutSeconds);
2070 }
2071 /**
2072 * \brief Clear sticky fault: CANdle output current exceeded the 6 A
2073 * limit.
2074 *
2075 * This will wait up to 0.100 seconds (100ms) by default.
2076 *
2077 * \returns StatusCode of the set command
2078 */
2083
2084 /**
2085 * \brief Clear sticky fault: CANdle has detected the output pin is
2086 * shorted.
2087 *
2088 * \param timeoutSeconds Maximum time to wait up to in seconds.
2089 * \returns StatusCode of the set command
2090 */
2092 {
2093 return GetConfigurator().ClearStickyFault_ShortCircuit(timeoutSeconds);
2094 }
2095 /**
2096 * \brief Clear sticky fault: CANdle has detected the output pin is
2097 * shorted.
2098 *
2099 * This will wait up to 0.100 seconds (100ms) by default.
2100 *
2101 * \returns StatusCode of the set command
2102 */
2107
2108 void RegisterAlerts(AlertableCollection &collection) override;
2109};
2110
2111#if defined(_WIN32) || defined(_WIN64)
2112#pragma warning(pop)
2113#endif
2114
2115}
2116}
2117
2118}
2119}
2120
Collection of objects that can report alerts.
Definition Alertable.hpp:109
Class for getting information about an available CAN bus.
Definition CANBus.hpp:142
Represents a status signal with data of type T, and operations available to retrieve information abou...
Definition StatusSignal.hpp:523
All configurations for the hardware::CANdle.
Definition CoreCANdle.hpp:50
bool FutureProofConfigs
True if we should factory default newer unsupported configs, false to leave newer unsupported configs...
Definition CoreCANdle.hpp:67
CANdleFeaturesConfigs CANdleFeatures
Configs related to general CANdle features.
Definition CoreCANdle.hpp:111
std::string Serialize() const final
Get the serialized form of this configuration.
constexpr CANdleConfiguration & WithLED(LEDConfigs newLED)
Modifies this configuration's LED parameter and returns itself for method-chaining and easier to use ...
Definition CoreCANdle.hpp:155
LEDConfigs LED
Configs related to CANdle LED control.
Definition CoreCANdle.hpp:96
std::string ToString() const override
Get the string representation of this configuration.
constexpr CANdleConfiguration & WithCustomParams(CustomParamsConfigs newCustomParams)
Modifies this configuration's CustomParams parameter and returns itself for method-chaining and easie...
Definition CoreCANdle.hpp:130
constexpr CANdleConfiguration & WithCANdleFeatures(CANdleFeaturesConfigs newCANdleFeatures)
Modifies this configuration's CANdleFeatures parameter and returns itself for method-chaining and eas...
Definition CoreCANdle.hpp:180
CustomParamsConfigs CustomParams
Custom Params.
Definition CoreCANdle.hpp:81
ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final
Take a string and deserialize it to this configuration.
Handles applying and refreshing configurations for the hardware::CANdle.
Definition CoreCANdle.hpp:205
ctre::phoenix::StatusCode ClearStickyFault_ShortCircuit(wpi::units::second_t timeoutSeconds)
Clear sticky fault: CANdle has detected the output pin is shorted.
ctre::phoenix::StatusCode Apply(const CustomParamsConfigs &configs)
Applies the contents of the specified config to the device.
Definition CoreCANdle.hpp:253
ctre::phoenix::StatusCode ClearStickyFault_5VTooHigh()
Clear sticky fault: Device 5V line is too high (above 6 V).
Definition CoreCANdle.hpp:671
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device boot while detecting the enable signal.
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device supply voltage dropped to near brownout levels.
ctre::phoenix::StatusCode ClearStickyFault_SoftwareFuse(wpi::units::second_t timeoutSeconds)
Clear sticky fault: CANdle output current exceeded the 6 A limit.
ctre::phoenix::StatusCode Refresh(LEDConfigs &configs) const
Refreshes the values of the specified config group.
Definition CoreCANdle.hpp:403
ctre::phoenix::StatusCode ClearStickyFault_SoftwareFuse()
Clear sticky fault: CANdle output current exceeded the 6 A limit.
Definition CoreCANdle.hpp:765
ctre::phoenix::StatusCode ClearStickyFault_Thermal()
Clear sticky fault: Device temperature exceeded limit.
Definition CoreCANdle.hpp:733
ctre::phoenix::StatusCode ClearStickyFault_Hardware(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Hardware fault occurred.
ctre::phoenix::StatusCode ClearStickyFault_Overvoltage()
Clear sticky fault: Device supply voltage is too high (above 30 V).
Definition CoreCANdle.hpp:639
ctre::phoenix::StatusCode ClearStickyFaults(wpi::units::second_t timeoutSeconds)
Clear the sticky faults in the device.
ctre::phoenix::StatusCode ClearStickyFault_UnlicensedFeatureInUse(wpi::units::second_t timeoutSeconds)
Clear sticky fault: An unlicensed feature is in use, device may not behave as expected.
ctre::phoenix::StatusCode ClearStickyFault_5VTooLow(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device 5V line is too low (below 4 V).
ctre::phoenix::StatusCode Refresh(CANdleConfiguration &configs, wpi::units::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition CoreCANdle.hpp:354
ctre::phoenix::StatusCode ClearStickyFault_ShortCircuit()
Clear sticky fault: CANdle has detected the output pin is shorted.
Definition CoreCANdle.hpp:798
ctre::phoenix::StatusCode Apply(const CANdleConfiguration &configs, wpi::units::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition CoreCANdle.hpp:238
ctre::phoenix::StatusCode Refresh(CANdleConfiguration &configs) const
Refreshes the values of the specified config group.
Definition CoreCANdle.hpp:340
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage()
Clear sticky fault: Device supply voltage dropped to near brownout levels.
Definition CoreCANdle.hpp:540
ctre::phoenix::StatusCode ClearStickyFault_UnlicensedFeatureInUse()
Clear sticky fault: An unlicensed feature is in use, device may not behave as expected.
Definition CoreCANdle.hpp:606
ctre::phoenix::StatusCode Apply(const LEDConfigs &configs, wpi::units::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition CoreCANdle.hpp:296
ctre::phoenix::StatusCode Apply(const CustomParamsConfigs &configs, wpi::units::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition CoreCANdle.hpp:267
ctre::phoenix::StatusCode ClearStickyFault_Thermal(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device temperature exceeded limit.
ctre::phoenix::StatusCode ClearStickyFault_5VTooHigh(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device 5V line is too high (above 6 V).
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable()
Clear sticky fault: Device boot while detecting the enable signal.
Definition CoreCANdle.hpp:573
ctre::phoenix::StatusCode Refresh(LEDConfigs &configs, wpi::units::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition CoreCANdle.hpp:416
ctre::phoenix::StatusCode Refresh(CustomParamsConfigs &configs) const
Refreshes the values of the specified config group.
Definition CoreCANdle.hpp:372
ctre::phoenix::StatusCode ClearStickyFault_5VTooLow()
Clear sticky fault: Device 5V line is too low (below 4 V).
Definition CoreCANdle.hpp:702
ctre::phoenix::StatusCode Apply(const CANdleFeaturesConfigs &configs, wpi::units::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition CoreCANdle.hpp:325
ctre::phoenix::StatusCode ClearStickyFault_Hardware()
Clear sticky fault: Hardware fault occurred.
Definition CoreCANdle.hpp:508
ctre::phoenix::StatusCode ClearStickyFaults()
Clear the sticky faults in the device.
Definition CoreCANdle.hpp:473
ctre::phoenix::StatusCode Refresh(CustomParamsConfigs &configs, wpi::units::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition CoreCANdle.hpp:385
ctre::phoenix::StatusCode ClearStickyFault_Overvoltage(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device supply voltage is too high (above 30 V).
ctre::phoenix::StatusCode Refresh(CANdleFeaturesConfigs &configs) const
Refreshes the values of the specified config group.
Definition CoreCANdle.hpp:434
ctre::phoenix::StatusCode Apply(const CANdleFeaturesConfigs &configs)
Applies the contents of the specified config to the device.
Definition CoreCANdle.hpp:311
ctre::phoenix::StatusCode Apply(const LEDConfigs &configs)
Applies the contents of the specified config to the device.
Definition CoreCANdle.hpp:282
ctre::phoenix::StatusCode Refresh(CANdleFeaturesConfigs &configs, wpi::units::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition CoreCANdle.hpp:447
ctre::phoenix::StatusCode Apply(const CANdleConfiguration &configs)
Applies the contents of the specified config to the device.
Definition CoreCANdle.hpp:224
Configs related to general CANdle features.
Definition CANdleFeaturesConfigs.hpp:24
Custom Params.
Definition CustomParamsConfigs.hpp:23
Configs related to CANdle LED control.
Definition LEDConfigs.hpp:25
Common interface for all configuration objects.
Definition Configuration.hpp:20
ctre::phoenix::StatusCode SetConfigsPrivate(std::string_view serializedString, wpi::units::second_t timeoutSeconds, bool futureProofConfigs, bool overrideIfDuplicate)
wpi::units::second_t DefaultTimeoutSeconds
The default maximum amount of time to wait for a config.
Definition Configurator.hpp:27
ParentConfigurator(hardware::DeviceIdentifier deviceIdentifier)
ctre::phoenix::StatusCode GetConfigsPrivate(std::string &serializedString, wpi::units::second_t timeoutSeconds) const
Animation that gradually lights the entire LED strip one LED at a time.
Definition ColorFlowAnimation.hpp:22
Common interface implemented by all control requests.
Definition ControlRequest.hpp:27
An empty animation, clearing any animation in the specified slot.
Definition EmptyAnimation.hpp:20
Generic Empty Control class used to do nothing.
Definition ControlRequest.hpp:65
Animation that looks similar to a flame flickering.
Definition FireAnimation.hpp:22
Animation that bounces a pocket of light across the LED strip.
Definition LarsonAnimation.hpp:22
Modulates the CANdle VBat output to the specified duty cycle.
Definition ModulateVBatOut.hpp:25
Animation that creates a rainbow throughout all the LEDs.
Definition RainbowAnimation.hpp:22
Animation that fades all the LEDs of a strip simultaneously between Red, Green, and Blue.
Definition RgbFadeAnimation.hpp:22
Animation that fades into and out of a specified color.
Definition SingleFadeAnimation.hpp:21
Sets LEDs to a solid color.
Definition SolidColor.hpp:21
Animation that strobes the LEDs a specified color.
Definition StrobeAnimation.hpp:21
Animation that randomly turns LEDs on and off to a certain color.
Definition TwinkleAnimation.hpp:22
Animation that randomly turns on LEDs until it reaches the maximum count, and then turns them all off...
Definition TwinkleOffAnimation.hpp:23
The unique identifier for a device.
Definition DeviceIdentifier.hpp:19
ParentDevice(int deviceID, std::string model, CANBus canbus)
Class for CTR Electronics' CANdle® branded device, a device that controls LEDs over the CAN bus.
Definition CoreCANdle.hpp:833
StatusSignal< wpi::units::scalar_t > & GetVBatModulation(bool refresh=true)
The applied VBat modulation duty cycle.
StatusSignal< wpi::units::volt_t > & GetSupplyVoltage(bool refresh=true)
Measured supply voltage to the CANdle.
StatusSignal< bool > & GetFault_Undervoltage(bool refresh=true)
Device supply voltage dropped to near brownout levels.
configs::CANdleConfigurator & GetConfigurator()
Gets the configurator for this CANdle.
Definition CoreCANdle.hpp:869
ctre::phoenix::StatusCode ClearStickyFault_Thermal(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device temperature exceeded limit.
Definition CoreCANdle.hpp:2044
StatusSignal< bool > & GetIsProLicensed(bool refresh=true)
Whether the device is Phoenix Pro licensed.
ctre::phoenix::StatusCode ClearStickyFaults(wpi::units::second_t timeoutSeconds)
Clear the sticky faults in the device.
Definition CoreCANdle.hpp:1856
ctre::phoenix::StatusCode SetControl(controls::ControlRequest const &request)
Control device with generic control request object.
ctre::phoenix::StatusCode SetControl(controls::EmptyAnimation const &request)
An empty animation, clearing any animation in the specified slot.
StatusSignal< bool > & GetFault_Hardware(bool refresh=true)
Hardware fault occurred.
ctre::phoenix::StatusCode ClearStickyFault_SoftwareFuse(wpi::units::second_t timeoutSeconds)
Clear sticky fault: CANdle output current exceeded the 6 A limit.
Definition CoreCANdle.hpp:2067
ctre::phoenix::StatusCode SetControl(controls::SolidColor const &request)
Sets LEDs to a solid color.
StatusSignal< bool > & GetStickyFault_ShortCircuit(bool refresh=true)
CANdle has detected the output pin is shorted.
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage()
Clear sticky fault: Device supply voltage dropped to near brownout levels.
Definition CoreCANdle.hpp:1917
ctre::phoenix::StatusCode SetControl(controls::RainbowAnimation const &request)
Animation that creates a rainbow throughout all the LEDs.
ctre::phoenix::StatusCode SetControl(controls::ModulateVBatOut const &request)
Modulates the CANdle VBat output to the specified duty cycle.
ctre::phoenix::StatusCode ClearStickyFaults()
Clear the sticky faults in the device.
Definition CoreCANdle.hpp:1871
StatusSignal< bool > & GetStickyFault_UnlicensedFeatureInUse(bool refresh=true)
An unlicensed feature is in use, device may not behave as expected.
StatusSignal< bool > & GetFault_Thermal(bool refresh=true)
Device temperature exceeded limit.
ctre::phoenix::StatusCode ClearStickyFault_ShortCircuit(wpi::units::second_t timeoutSeconds)
Clear sticky fault: CANdle has detected the output pin is shorted.
Definition CoreCANdle.hpp:2091
StatusSignal< bool > & GetStickyFault_Overvoltage(bool refresh=true)
Device supply voltage is too high (above 30 V).
ctre::phoenix::StatusCode SetControl(controls::ColorFlowAnimation const &request)
Animation that gradually lights the entire LED strip one LED at a time.
StatusSignal< int > & GetMaxSimultaneousAnimationCount(bool refresh=true)
The maximum number of simultaneous animations supported by the current version of CANdle firmware.
ctre::phoenix::StatusCode SetControl(controls::RgbFadeAnimation const &request)
Animation that fades all the LEDs of a strip simultaneously between Red, Green, and Blue.
void RegisterAlerts(AlertableCollection &collection) override
Registers all alerts for this type to the provided collection.
ctre::phoenix::StatusCode ClearStickyFault_Hardware()
Clear sticky fault: Hardware fault occurred.
Definition CoreCANdle.hpp:1893
ctre::phoenix::StatusCode SetControl(controls::FireAnimation const &request)
Animation that looks similar to a flame flickering.
ctre::phoenix::StatusCode ClearStickyFault_5VTooLow()
Clear sticky fault: Device 5V line is too low (below 4 V).
Definition CoreCANdle.hpp:2033
ctre::phoenix::StatusCode ClearStickyFault_Hardware(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Hardware fault occurred.
Definition CoreCANdle.hpp:1882
configs::CANdleConfiguration Configuration
The configuration class for this device.
Definition CoreCANdle.hpp:841
StatusSignal< bool > & GetStickyFault_Hardware(bool refresh=true)
Hardware fault occurred.
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable()
Clear sticky fault: Device boot while detecting the enable signal.
Definition CoreCANdle.hpp:1941
ctre::phoenix::StatusCode SetControl(controls::StrobeAnimation const &request)
Animation that strobes the LEDs a specified color.
StatusSignal< wpi::units::ampere_t > & GetOutputCurrent(bool refresh=true)
The measured output current.
ctre::phoenix::StatusCode ClearStickyFault_SoftwareFuse()
Clear sticky fault: CANdle output current exceeded the 6 A limit.
Definition CoreCANdle.hpp:2079
CoreCANdle(int deviceId, CANBus canbus)
Constructs a new CANdle object.
ctre::phoenix::StatusCode ClearStickyFault_UnlicensedFeatureInUse(wpi::units::second_t timeoutSeconds)
Clear sticky fault: An unlicensed feature is in use, device may not behave as expected.
Definition CoreCANdle.hpp:1953
StatusSignal< bool > & GetFault_UnlicensedFeatureInUse(bool refresh=true)
An unlicensed feature is in use, device may not behave as expected.
ctre::phoenix::StatusCode SetControl(controls::EmptyControl const &request)
Apply a generic empty control used to do nothing.
StatusSignal< bool > & GetStickyFault_5VTooHigh(bool refresh=true)
Device 5V line is too high (above 6 V).
StatusSignal< bool > & GetFault_Overvoltage(bool refresh=true)
Device supply voltage is too high (above 30 V).
StatusSignal< int > & GetStickyFaultField(bool refresh=true)
Integer representing all (persistent) sticky fault flags reported by the device.
ctre::phoenix::StatusCode ClearStickyFault_Overvoltage()
Clear sticky fault: Device supply voltage is too high (above 30 V).
Definition CoreCANdle.hpp:1989
StatusSignal< int > & GetVersion(bool refresh=true)
Full Version of firmware in device.
StatusSignal< bool > & GetFault_5VTooLow(bool refresh=true)
Device 5V line is too low (below 4 V).
ctre::phoenix::StatusCode ClearStickyFault_Thermal()
Clear sticky fault: Device temperature exceeded limit.
Definition CoreCANdle.hpp:2055
StatusSignal< bool > & GetFault_5VTooHigh(bool refresh=true)
Device 5V line is too high (above 6 V).
ctre::phoenix::StatusCode ClearStickyFault_5VTooHigh(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device 5V line is too high (above 6 V).
Definition CoreCANdle.hpp:2000
StatusSignal< bool > & GetFault_BootDuringEnable(bool refresh=true)
Device boot while detecting the enable signal.
ctre::phoenix::StatusCode ClearStickyFault_UnlicensedFeatureInUse()
Clear sticky fault: An unlicensed feature is in use, device may not behave as expected.
Definition CoreCANdle.hpp:1965
StatusSignal< bool > & GetStickyFault_Thermal(bool refresh=true)
Device temperature exceeded limit.
StatusSignal< bool > & GetStickyFault_SoftwareFuse(bool refresh=true)
CANdle output current exceeded the 6 A limit.
ctre::phoenix::StatusCode ClearStickyFault_Overvoltage(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device supply voltage is too high (above 30 V).
Definition CoreCANdle.hpp:1977
ctre::phoenix::StatusCode SetControl(controls::SingleFadeAnimation const &request)
Animation that fades into and out of a specified color.
ctre::phoenix::StatusCode SetControl(controls::TwinkleOffAnimation const &request)
Animation that randomly turns on LEDs until it reaches the maximum count, and then turns them all off...
StatusSignal< int > & GetVersionMajor(bool refresh=true)
App Major Version number.
StatusSignal< bool > & GetStickyFault_BootDuringEnable(bool refresh=true)
Device boot while detecting the enable signal.
ctre::phoenix::StatusCode ClearStickyFault_5VTooHigh()
Clear sticky fault: Device 5V line is too high (above 6 V).
Definition CoreCANdle.hpp:2011
ctre::phoenix::StatusCode ClearStickyFault_ShortCircuit()
Clear sticky fault: CANdle has detected the output pin is shorted.
Definition CoreCANdle.hpp:2103
sim::CANdleSimState & GetSimState()
Get the simulation state for this device.
Definition CoreCANdle.hpp:899
StatusSignal< int > & GetVersionBuild(bool refresh=true)
App Build Version number.
StatusSignal< int > & GetVersionMinor(bool refresh=true)
App Minor Version number.
StatusSignal< int > & GetFaultField(bool refresh=true)
Integer representing all fault flags reported by the device.
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device boot while detecting the enable signal.
Definition CoreCANdle.hpp:1929
ctre::phoenix::StatusCode SetControl(controls::TwinkleAnimation const &request)
Animation that randomly turns LEDs on and off to a certain color.
StatusSignal< bool > & GetFault_SoftwareFuse(bool refresh=true)
CANdle output current exceeded the 6 A limit.
ctre::phoenix::StatusCode SetControl(controls::LarsonAnimation const &request)
Animation that bounces a pocket of light across the LED strip.
configs::CANdleConfigurator const & GetConfigurator() const
Gets the configurator for this CANdle.
Definition CoreCANdle.hpp:881
StatusSignal< wpi::units::volt_t > & GetFiveVRailVoltage(bool refresh=true)
The measured voltage of the 5V rail line.
StatusSignal< bool > & GetStickyFault_5VTooLow(bool refresh=true)
Device 5V line is too low (below 4 V).
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device supply voltage dropped to near brownout levels.
Definition CoreCANdle.hpp:1905
StatusSignal< bool > & GetFault_ShortCircuit(bool refresh=true)
CANdle has detected the output pin is shorted.
StatusSignal< bool > & GetStickyFault_Undervoltage(bool refresh=true)
Device supply voltage dropped to near brownout levels.
static CoreCANdle None()
Constructs a stubbed-out CoreCANdle, where all status signals, controls, configs, etc.
Definition CoreCANdle.hpp:858
ctre::phoenix::StatusCode ClearStickyFault_5VTooLow(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device 5V line is too low (below 4 V).
Definition CoreCANdle.hpp:2022
StatusSignal< wpi::units::celsius_t > & GetDeviceTemp(bool refresh=true)
The temperature that the CANdle measures itself to be at.
StatusSignal< int > & GetVersionBugfix(bool refresh=true)
App Bugfix Version number.
Class to control the state of a simulated hardware::CANdle.
Definition CANdleSimState.hpp:32
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:28
Definition ExternalFeedbackConfigs.hpp:21
Definition ExternalFeedbackConfigs.hpp:17
Definition ExternalFeedbackConfigs.hpp:17
Definition ExternalFeedbackConfigs.hpp:16
Definition StatusCodes.h:22
Definition motor_constants.h:14