CTRE Phoenix 6 C++ 26.50.0-alpha-1
Loading...
Searching...
No Matches
CANdleFeaturesConfigs.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) Cross The Road Electronics.  All rights reserved.
3 * License information can be found in CTRE_LICENSE.txt
4 * For support and suggestions contact support@ctr-electronics.com or file
5 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
6 */
7#pragma once
8
11
12namespace ctre {
13namespace phoenix6 {
14
15
16namespace configs {
17
18/**
19 * \brief Configs related to general CANdle features.
20 *
21 * \details This includes configs such as disabling the 5V rail and
22 * the behavior of VBat output.
23 */
25public:
26 constexpr CANdleFeaturesConfigs() = default;
27
28 /**
29 * \brief Whether the 5V rail is enabled. Disabling the 5V rail will
30 * also turn off the onboard LEDs.
31 *
32 * - Default Value: signals#Enable5VRailValue#Enabled
33 */
35 /**
36 * \brief The behavior of the VBat output. CANdle supports modulating
37 * VBat output for single-color LED strips.
38 *
39 * - Default Value: signals#VBatOutputModeValue#On
40 */
42 /**
43 * \brief Whether the Status LED is enabled when the CANdle is
44 * actively being controlled.
45 *
46 * - Default Value: signals#StatusLedWhenActiveValue#Enabled
47 */
49
50 /**
51 * \brief Modifies this configuration's Enable5VRail parameter and returns itself for
52 * method-chaining and easier to use config API.
53 *
54 * Whether the 5V rail is enabled. Disabling the 5V rail will also
55 * turn off the onboard LEDs.
56 *
57 * - Default Value: signals#Enable5VRailValue#Enabled
58 *
59 * \param newEnable5VRail Parameter to modify
60 * \returns Itself
61 */
63 {
64 Enable5VRail = std::move(newEnable5VRail);
65 return *this;
66 }
67
68 /**
69 * \brief Modifies this configuration's VBatOutputMode parameter and returns itself for
70 * method-chaining and easier to use config API.
71 *
72 * The behavior of the VBat output. CANdle supports modulating VBat
73 * output for single-color LED strips.
74 *
75 * - Default Value: signals#VBatOutputModeValue#On
76 *
77 * \param newVBatOutputMode Parameter to modify
78 * \returns Itself
79 */
81 {
82 VBatOutputMode = std::move(newVBatOutputMode);
83 return *this;
84 }
85
86 /**
87 * \brief Modifies this configuration's StatusLedWhenActive parameter and returns itself for
88 * method-chaining and easier to use config API.
89 *
90 * Whether the Status LED is enabled when the CANdle is actively being
91 * controlled.
92 *
93 * - Default Value: signals#StatusLedWhenActiveValue#Enabled
94 *
95 * \param newStatusLedWhenActive Parameter to modify
96 * \returns Itself
97 */
99 {
100 StatusLedWhenActive = std::move(newStatusLedWhenActive);
101 return *this;
102 }
103
104
105
106 std::string ToString() const override;
107
108 std::string Serialize() const final;
109 ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final;
110};
111
112}
113}
114}
constexpr CANdleFeaturesConfigs & WithVBatOutputMode(signals::VBatOutputModeValue newVBatOutputMode)
Modifies this configuration's VBatOutputMode parameter and returns itself for method-chaining and eas...
Definition CANdleFeaturesConfigs.hpp:80
ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final
signals::Enable5VRailValue Enable5VRail
Whether the 5V rail is enabled.
Definition CANdleFeaturesConfigs.hpp:34
signals::VBatOutputModeValue VBatOutputMode
The behavior of the VBat output.
Definition CANdleFeaturesConfigs.hpp:41
constexpr CANdleFeaturesConfigs & WithStatusLedWhenActive(signals::StatusLedWhenActiveValue newStatusLedWhenActive)
Modifies this configuration's StatusLedWhenActive parameter and returns itself for method-chaining an...
Definition CANdleFeaturesConfigs.hpp:98
signals::StatusLedWhenActiveValue StatusLedWhenActive
Whether the Status LED is enabled when the CANdle is actively being controlled.
Definition CANdleFeaturesConfigs.hpp:48
constexpr CANdleFeaturesConfigs & WithEnable5VRail(signals::Enable5VRailValue newEnable5VRail)
Modifies this configuration's Enable5VRail parameter and returns itself for method-chaining and easie...
Definition CANdleFeaturesConfigs.hpp:62
Definition Configuration.hpp:17
Definition ExternalFeedbackConfigs.hpp:21
Definition ExternalFeedbackConfigs.hpp:16
Definition FrcUsageReport.hpp:12
Definition motor_constants.h:14
Whether the 5V rail is enabled.
Definition SpnEnums.hpp:3898
static constexpr int Enabled
The 5V rail is enabled, allowing for LED control.
Definition SpnEnums.hpp:3904
Whether the Status LED is enabled when the CANdle is actively being controlled.
Definition SpnEnums.hpp:4013
static constexpr int Enabled
The status LED is enabled during control.
Definition SpnEnums.hpp:4019
The behavior of the VBat output.
Definition SpnEnums.hpp:3953
static constexpr int On
VBat output is on at full power.
Definition SpnEnums.hpp:3959