CTRE Phoenix 6 C++ 25.2.1
Loading...
Searching...
No Matches
ctre::phoenix6::configs::CANdiConfiguration Class Reference

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>

Inheritance diagram for ctre::phoenix6::configs::CANdiConfiguration:
ctre::phoenix6::configs::ParentConfiguration ctre::phoenix6::ISerializable

Public Member Functions

constexpr CANdiConfiguration ()=default
 
constexpr CANdiConfigurationWithCustomParams (CustomParamsConfigs newCustomParams)
 Modifies this configuration's CustomParams parameter and returns itself for method-chaining and easier to use config API.
 
constexpr CANdiConfigurationWithDigitalInputs (DigitalInputsConfigs newDigitalInputs)
 Modifies this configuration's DigitalInputs parameter and returns itself for method-chaining and easier to use config API.
 
constexpr CANdiConfigurationWithQuadrature (QuadratureConfigs newQuadrature)
 Modifies this configuration's Quadrature parameter and returns itself for method-chaining and easier to use config API.
 
constexpr CANdiConfigurationWithPWM1 (PWM1Configs newPWM1)
 Modifies this configuration's PWM1 parameter and returns itself for method-chaining and easier to use config API.
 
constexpr CANdiConfigurationWithPWM2 (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)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ CANdiConfiguration()

ctre::phoenix6::configs::CANdiConfiguration::CANdiConfiguration ( )
constexprdefault

Member Function Documentation

◆ Deserialize()

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANdiConfiguration::Deserialize ( const std::string & to_deserialize)
inlinevirtual

Take a string and deserialize it to this configuration.

Implements ctre::phoenix6::configs::ParentConfiguration.

◆ Serialize()

std::string ctre::phoenix6::configs::CANdiConfiguration::Serialize ( ) const
inlinevirtual

Get the serialized form of this configuration.

Implements ctre::phoenix6::ISerializable.

◆ ToString()

std::string ctre::phoenix6::configs::CANdiConfiguration::ToString ( ) const
inlinevirtual

Get the string representation of this configuration.

Implements ctre::phoenix6::configs::ParentConfiguration.

◆ WithCustomParams()

CANdiConfiguration & ctre::phoenix6::configs::CANdiConfiguration::WithCustomParams ( CustomParamsConfigs newCustomParams)
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.

Parameters
newCustomParamsParameter to modify
Returns
Itself

◆ WithDigitalInputs()

CANdiConfiguration & ctre::phoenix6::configs::CANdiConfiguration::WithDigitalInputs ( DigitalInputsConfigs newDigitalInputs)
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.

Parameters
newDigitalInputsParameter to modify
Returns
Itself

◆ WithPWM1()

CANdiConfiguration & ctre::phoenix6::configs::CANdiConfiguration::WithPWM1 ( PWM1Configs newPWM1)
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.

Parameters
newPWM1Parameter to modify
Returns
Itself

◆ WithPWM2()

CANdiConfiguration & ctre::phoenix6::configs::CANdiConfiguration::WithPWM2 ( PWM2Configs newPWM2)
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.

Parameters
newPWM2Parameter to modify
Returns
Itself

◆ WithQuadrature()

CANdiConfiguration & ctre::phoenix6::configs::CANdiConfiguration::WithQuadrature ( QuadratureConfigs newQuadrature)
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.

Parameters
newQuadratureParameter to modify
Returns
Itself

Member Data Documentation

◆ CustomParams

CustomParamsConfigs ctre::phoenix6::configs::CANdiConfiguration::CustomParams

Custom Params.

Custom paramaters that have no real impact on controller.

◆ DigitalInputs

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.

◆ FutureProofConfigs

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.

◆ PWM1

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.

◆ PWM2

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.

◆ Quadrature

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.


The documentation for this class was generated from the following file: