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