CTRE Phoenix 6 C++ 25.2.1
|
Class for CANdi, a CAN digital input device that detects when a digital signal is asserted or deasserted. More...
#include <ctre/phoenix6/core/CoreCANdi.hpp>
Public Member Functions | |
constexpr | CANdiConfiguration ()=default |
constexpr CANdiConfiguration & | WithCustomParams (CustomParamsConfigs newCustomParams) |
Modifies this configuration's CustomParams parameter and returns itself for method-chaining and easier to use config API. | |
constexpr CANdiConfiguration & | WithDigitalInputs (DigitalInputsConfigs newDigitalInputs) |
Modifies this configuration's DigitalInputs parameter and returns itself for method-chaining and easier to use config API. | |
constexpr CANdiConfiguration & | WithQuadrature (QuadratureConfigs newQuadrature) |
Modifies this configuration's Quadrature parameter and returns itself for method-chaining and easier to use config API. | |
constexpr CANdiConfiguration & | WithPWM1 (PWM1Configs newPWM1) |
Modifies this configuration's PWM1 parameter and returns itself for method-chaining and easier to use config API. | |
constexpr CANdiConfiguration & | WithPWM2 (PWM2Configs newPWM2) |
Modifies this configuration's PWM2 parameter and returns itself for method-chaining and easier to use config API. | |
std::string | ToString () const |
Get the string representation of this configuration. | |
std::string | Serialize () const |
Get the serialized form of this configuration. | |
ctre::phoenix::StatusCode | Deserialize (const std::string &to_deserialize) |
Take a string and deserialize it to this configuration. | |
Public Member Functions inherited from ctre::phoenix6::configs::ParentConfiguration | |
Public Member Functions inherited from ctre::phoenix6::ISerializable |
Public Attributes | |
bool | FutureProofConfigs {true} |
True if we should factory default newer unsupported configs, false to leave newer unsupported configs alone. | |
CustomParamsConfigs | CustomParams |
Custom Params. | |
DigitalInputsConfigs | DigitalInputs |
Configs related to CANdi digital I/O settings. | |
QuadratureConfigs | Quadrature |
Configs related to CANdi's quadrature interface using both the S1IN and S2IN inputs. | |
PWM1Configs | PWM1 |
Configs related to CANdi's PWM interface on the Signal 1 input (S1IN) | |
PWM2Configs | PWM2 |
Configs related to CANdi's PWM interface on the Signal 2 input (S2IN) | |
Class for CANdi, a CAN digital input device that detects when a digital signal is asserted or deasserted.
This handles the configurations for the hardware::CANdi
|
constexprdefault |
|
inlinevirtual |
Take a string and deserialize it to this configuration.
Implements ctre::phoenix6::configs::ParentConfiguration.
|
inlinevirtual |
Get the serialized form of this configuration.
Implements ctre::phoenix6::ISerializable.
|
inlinevirtual |
Get the string representation of this configuration.
Implements ctre::phoenix6::configs::ParentConfiguration.
|
inlineconstexpr |
Modifies this configuration's CustomParams parameter and returns itself for method-chaining and easier to use config API.
Custom Params.
Custom paramaters that have no real impact on controller.
newCustomParams | Parameter to modify |
|
inlineconstexpr |
Modifies this configuration's DigitalInputs parameter and returns itself for method-chaining and easier to use config API.
Configs related to CANdi digital I/O settings
Contains float-state settings and when to assert the S1/S2 inputs.
newDigitalInputs | Parameter to modify |
|
inlineconstexpr |
Modifies this configuration's PWM1 parameter and returns itself for method-chaining and easier to use config API.
Configs related to CANdi's PWM interface on the Signal 1 input (S1IN)
All the configs related to the PWM interface for CANdi on S1, including absolute sensor offset, absolute sensor discontinuity point and sensor direction.
newPWM1 | Parameter to modify |
|
inlineconstexpr |
Modifies this configuration's PWM2 parameter and returns itself for method-chaining and easier to use config API.
Configs related to CANdi's PWM interface on the Signal 2 input (S2IN)
All the configs related to the PWM interface for CANdi on S1, including absolute sensor offset, absolute sensor discontinuity point and sensor direction.
newPWM2 | Parameter to modify |
|
inlineconstexpr |
Modifies this configuration's Quadrature parameter and returns itself for method-chaining and easier to use config API.
Configs related to CANdi's quadrature interface using both the S1IN and S2IN inputs
All the configs related to the quadrature interface for CANdi, including encoder edges per revolution and sensor direction.
newQuadrature | Parameter to modify |
CustomParamsConfigs ctre::phoenix6::configs::CANdiConfiguration::CustomParams |
Custom Params.
Custom paramaters that have no real impact on controller.
DigitalInputsConfigs ctre::phoenix6::configs::CANdiConfiguration::DigitalInputs |
Configs related to CANdi digital I/O settings.
Contains float-state settings and when to assert the S1/S2 inputs.
bool ctre::phoenix6::configs::CANdiConfiguration::FutureProofConfigs {true} |
True if we should factory default newer unsupported configs, false to leave newer unsupported configs alone.
This flag addresses a corner case where the device may have firmware with newer configs that didn't exist when this version of the API was built. If this occurs and this flag is true, unsupported new configs will be factory defaulted to avoid unexpected behavior.
This is also the behavior in Phoenix 5, so this flag is defaulted to true to match.
PWM1Configs ctre::phoenix6::configs::CANdiConfiguration::PWM1 |
Configs related to CANdi's PWM interface on the Signal 1 input (S1IN)
All the configs related to the PWM interface for CANdi on S1, including absolute sensor offset, absolute sensor discontinuity point and sensor direction.
PWM2Configs ctre::phoenix6::configs::CANdiConfiguration::PWM2 |
Configs related to CANdi's PWM interface on the Signal 2 input (S2IN)
All the configs related to the PWM interface for CANdi on S1, including absolute sensor offset, absolute sensor discontinuity point and sensor direction.
QuadratureConfigs ctre::phoenix6::configs::CANdiConfiguration::Quadrature |
Configs related to CANdi's quadrature interface using both the S1IN and S2IN inputs.
All the configs related to the quadrature interface for CANdi, including encoder edges per revolution and sensor direction.