CTRE Phoenix 6 C++ 26.0.0-beta-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 */
34 /**
35 * \brief The behavior of the VBat output. CANdle supports modulating
36 * VBat output for single-color LED strips.
37 *
38 */
40 /**
41 * \brief Whether the Status LED is enabled when the CANdle is
42 * actively being controlled.
43 *
44 */
46
47 /**
48 * \brief Modifies this configuration's Enable5VRail parameter and returns itself for
49 * method-chaining and easier to use config API.
50 *
51 * Whether the 5V rail is enabled. Disabling the 5V rail will also
52 * turn off the onboard LEDs.
53 *
54 *
55 * \param newEnable5VRail Parameter to modify
56 * \returns Itself
57 */
59 {
60 Enable5VRail = std::move(newEnable5VRail);
61 return *this;
62 }
63
64 /**
65 * \brief Modifies this configuration's VBatOutputMode parameter and returns itself for
66 * method-chaining and easier to use config API.
67 *
68 * The behavior of the VBat output. CANdle supports modulating VBat
69 * output for single-color LED strips.
70 *
71 *
72 * \param newVBatOutputMode Parameter to modify
73 * \returns Itself
74 */
76 {
77 VBatOutputMode = std::move(newVBatOutputMode);
78 return *this;
79 }
80
81 /**
82 * \brief Modifies this configuration's StatusLedWhenActive parameter and returns itself for
83 * method-chaining and easier to use config API.
84 *
85 * Whether the Status LED is enabled when the CANdle is actively being
86 * controlled.
87 *
88 *
89 * \param newStatusLedWhenActive Parameter to modify
90 * \returns Itself
91 */
93 {
94 StatusLedWhenActive = std::move(newStatusLedWhenActive);
95 return *this;
96 }
97
98
99
100 std::string ToString() const override;
101
102 std::string Serialize() const final;
103 ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final;
104};
105
106}
107}
108}
Configs related to general CANdle features.
Definition CANdleFeaturesConfigs.hpp:24
constexpr CANdleFeaturesConfigs & WithVBatOutputMode(signals::VBatOutputModeValue newVBatOutputMode)
Modifies this configuration's VBatOutputMode parameter and returns itself for method-chaining and eas...
Definition CANdleFeaturesConfigs.hpp:75
ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final
signals::Enable5VRailValue Enable5VRail
Whether the 5V rail is enabled.
Definition CANdleFeaturesConfigs.hpp:33
signals::VBatOutputModeValue VBatOutputMode
The behavior of the VBat output.
Definition CANdleFeaturesConfigs.hpp:39
constexpr CANdleFeaturesConfigs & WithStatusLedWhenActive(signals::StatusLedWhenActiveValue newStatusLedWhenActive)
Modifies this configuration's StatusLedWhenActive parameter and returns itself for method-chaining an...
Definition CANdleFeaturesConfigs.hpp:92
signals::StatusLedWhenActiveValue StatusLedWhenActive
Whether the Status LED is enabled when the CANdle is actively being controlled.
Definition CANdleFeaturesConfigs.hpp:45
constexpr CANdleFeaturesConfigs & WithEnable5VRail(signals::Enable5VRailValue newEnable5VRail)
Modifies this configuration's Enable5VRail parameter and returns itself for method-chaining and easie...
Definition CANdleFeaturesConfigs.hpp:58
Definition Configuration.hpp:17
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