CTRE Phoenix 6 C++ 24.3.0
ctre::phoenix6::configs::CANcoderConfigurator Class Reference

Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along with filtered velocity. More...

#include <ctre/phoenix6/core/CoreCANcoder.hpp>

Inheritance diagram for ctre::phoenix6::configs::CANcoderConfigurator:
ctre::phoenix6::configs::ParentConfigurator

Public Member Functions

ctre::phoenix::StatusCode Refresh (CANcoderConfiguration &configs) const
 Refreshes the values of the specified config group. More...
 
ctre::phoenix::StatusCode Refresh (CANcoderConfiguration &configs, units::time::second_t timeoutSeconds) const
 Refreshes the values of the specified config group. More...
 
ctre::phoenix::StatusCode Apply (const CANcoderConfiguration &configs)
 Applies the contents of the specified config to the device. More...
 
ctre::phoenix::StatusCode Apply (const CANcoderConfiguration &configs, units::time::second_t timeoutSeconds)
 Applies the contents of the specified config to the device. More...
 
ctre::phoenix::StatusCode Refresh (MagnetSensorConfigs &configs) const
 Refreshes the values of the specified config group. More...
 
ctre::phoenix::StatusCode Refresh (MagnetSensorConfigs &configs, units::time::second_t timeoutSeconds) const
 Refreshes the values of the specified config group. More...
 
ctre::phoenix::StatusCode Apply (const MagnetSensorConfigs &configs)
 Applies the contents of the specified config to the device. More...
 
ctre::phoenix::StatusCode Apply (const MagnetSensorConfigs &configs, units::time::second_t timeoutSeconds)
 Applies the contents of the specified config to the device. More...
 
ctre::phoenix::StatusCode SetPosition (units::angle::turn_t newValue)
 Sets the current position of the device. More...
 
ctre::phoenix::StatusCode SetPosition (units::angle::turn_t newValue, units::time::second_t timeoutSeconds)
 Sets the current position of the device. More...
 
ctre::phoenix::StatusCode ClearStickyFaults ()
 Clear the sticky faults in the device. More...
 
ctre::phoenix::StatusCode ClearStickyFaults (units::time::second_t timeoutSeconds)
 Clear the sticky faults in the device. More...
 
ctre::phoenix::StatusCode ClearStickyFault_Hardware ()
 Clear sticky fault: Hardware fault occurred. More...
 
ctre::phoenix::StatusCode ClearStickyFault_Hardware (units::time::second_t timeoutSeconds)
 Clear sticky fault: Hardware fault occurred. More...
 
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage ()
 Clear sticky fault: Device supply voltage dropped to near brownout levels. More...
 
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage (units::time::second_t timeoutSeconds)
 Clear sticky fault: Device supply voltage dropped to near brownout levels. More...
 
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable ()
 Clear sticky fault: Device boot while detecting the enable signal. More...
 
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable (units::time::second_t timeoutSeconds)
 Clear sticky fault: Device boot while detecting the enable signal. More...
 
ctre::phoenix::StatusCode ClearStickyFault_BadMagnet ()
 Clear sticky fault: The magnet distance is not correct or magnet is missing. More...
 
ctre::phoenix::StatusCode ClearStickyFault_BadMagnet (units::time::second_t timeoutSeconds)
 Clear sticky fault: The magnet distance is not correct or magnet is missing. More...
 

Additional Inherited Members

- Public Attributes inherited from ctre::phoenix6::configs::ParentConfigurator
units::time::second_t DefaultTimeoutSeconds {0.050_s}
 The default amount of time to wait for a config. More...
 
- Protected Member Functions inherited from ctre::phoenix6::configs::ParentConfigurator
 ParentConfigurator (hardware::DeviceIdentifier deviceIdentifier)
 
 ParentConfigurator (ParentConfigurator &&)=default
 
ParentConfiguratoroperator= (ParentConfigurator &&)=default
 
ctre::phoenix::StatusCode SetConfigsPrivate (const std::string &serializedString, units::time::second_t timeoutSeconds, bool futureProofConfigs, bool overrideIfDuplicate)
 
ctre::phoenix::StatusCode GetConfigsPrivate (std::string &serializedString, units::time::second_t timeoutSeconds) const
 

Detailed Description

Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along with filtered velocity.

This handles the configurations for the hardware::CANcoder

Member Function Documentation

◆ Apply() [1/4]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::Apply ( const CANcoderConfiguration configs)
inline

Applies the contents of the specified config to the device.

This will wait up to DefaultTimeoutSeconds.

Call to apply the selected configs.

Parameters
configsConfigs to apply against.
Returns
StatusCode of the set command

◆ Apply() [2/4]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::Apply ( const CANcoderConfiguration configs,
units::time::second_t  timeoutSeconds 
)
inline

Applies the contents of the specified config to the device.

Call to apply the selected configs.

Parameters
configsConfigs to apply against.
timeoutSecondsMaximum amount of time to wait when performing configuration
Returns
StatusCode of the set command

◆ Apply() [3/4]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::Apply ( const MagnetSensorConfigs configs)
inline

Applies the contents of the specified config to the device.

This will wait up to DefaultTimeoutSeconds.

Call to apply the selected configs.

Parameters
configsConfigs to apply against.
Returns
StatusCode of the set command

◆ Apply() [4/4]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::Apply ( const MagnetSensorConfigs configs,
units::time::second_t  timeoutSeconds 
)
inline

Applies the contents of the specified config to the device.

Call to apply the selected configs.

Parameters
configsConfigs to apply against.
timeoutSecondsMaximum amount of time to wait when performing configuration
Returns
StatusCode of the set command

◆ ClearStickyFault_BadMagnet() [1/2]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::ClearStickyFault_BadMagnet ( )
inline

Clear sticky fault: The magnet distance is not correct or magnet is missing.

This will wait up to DefaultTimeoutSeconds.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Returns
StatusCode of the set command

◆ ClearStickyFault_BadMagnet() [2/2]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::ClearStickyFault_BadMagnet ( units::time::second_t  timeoutSeconds)
inline

Clear sticky fault: The magnet distance is not correct or magnet is missing.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters
timeoutSecondsMaximum time to wait up to in seconds.
Returns
StatusCode of the set command

◆ ClearStickyFault_BootDuringEnable() [1/2]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::ClearStickyFault_BootDuringEnable ( )
inline

Clear sticky fault: Device boot while detecting the enable signal.

This will wait up to DefaultTimeoutSeconds.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Returns
StatusCode of the set command

◆ ClearStickyFault_BootDuringEnable() [2/2]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::ClearStickyFault_BootDuringEnable ( units::time::second_t  timeoutSeconds)
inline

Clear sticky fault: Device boot while detecting the enable signal.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters
timeoutSecondsMaximum time to wait up to in seconds.
Returns
StatusCode of the set command

◆ ClearStickyFault_Hardware() [1/2]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::ClearStickyFault_Hardware ( )
inline

Clear sticky fault: Hardware fault occurred.

This will wait up to DefaultTimeoutSeconds.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Returns
StatusCode of the set command

◆ ClearStickyFault_Hardware() [2/2]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::ClearStickyFault_Hardware ( units::time::second_t  timeoutSeconds)
inline

Clear sticky fault: Hardware fault occurred.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters
timeoutSecondsMaximum time to wait up to in seconds.
Returns
StatusCode of the set command

◆ ClearStickyFault_Undervoltage() [1/2]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::ClearStickyFault_Undervoltage ( )
inline

Clear sticky fault: Device supply voltage dropped to near brownout levels.

This will wait up to DefaultTimeoutSeconds.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Returns
StatusCode of the set command

◆ ClearStickyFault_Undervoltage() [2/2]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::ClearStickyFault_Undervoltage ( units::time::second_t  timeoutSeconds)
inline

Clear sticky fault: Device supply voltage dropped to near brownout levels.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters
timeoutSecondsMaximum time to wait up to in seconds.
Returns
StatusCode of the set command

◆ ClearStickyFaults() [1/2]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::ClearStickyFaults ( )
inline

Clear the sticky faults in the device.

This typically has no impact on the device functionality. Instead, it just clears telemetry faults that are accessible via API and Tuner Self-Test.

This will wait up to DefaultTimeoutSeconds.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Returns
StatusCode of the set command

◆ ClearStickyFaults() [2/2]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::ClearStickyFaults ( units::time::second_t  timeoutSeconds)
inline

Clear the sticky faults in the device.

This typically has no impact on the device functionality. Instead, it just clears telemetry faults that are accessible via API and Tuner Self-Test.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters
timeoutSecondsMaximum time to wait up to in seconds.
Returns
StatusCode of the set command

◆ Refresh() [1/4]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::Refresh ( CANcoderConfiguration configs) const
inline

Refreshes the values of the specified config group.

This will wait up to DefaultTimeoutSeconds.

Call to refresh the selected configs from the device.

Parameters
configsThe configs to refresh
Returns
StatusCode of refreshing the configs

◆ Refresh() [2/4]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::Refresh ( CANcoderConfiguration configs,
units::time::second_t  timeoutSeconds 
) const
inline

Refreshes the values of the specified config group.

Call to refresh the selected configs from the device.

Parameters
configsThe configs to refresh
timeoutSecondsMaximum amount of time to wait when performing configuration
Returns
StatusCode of refreshing the configs

◆ Refresh() [3/4]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::Refresh ( MagnetSensorConfigs configs) const
inline

Refreshes the values of the specified config group.

This will wait up to DefaultTimeoutSeconds.

Call to refresh the selected configs from the device.

Parameters
configsThe configs to refresh
Returns
StatusCode of refreshing the configs

◆ Refresh() [4/4]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::Refresh ( MagnetSensorConfigs configs,
units::time::second_t  timeoutSeconds 
) const
inline

Refreshes the values of the specified config group.

Call to refresh the selected configs from the device.

Parameters
configsThe configs to refresh
timeoutSecondsMaximum amount of time to wait when performing configuration
Returns
StatusCode of refreshing the configs

◆ SetPosition() [1/2]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::SetPosition ( units::angle::turn_t  newValue)
inline

Sets the current position of the device.

This will wait up to DefaultTimeoutSeconds.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters
newValueValue to set to. Units are in rotations.
Returns
StatusCode of the set command

◆ SetPosition() [2/2]

ctre::phoenix::StatusCode ctre::phoenix6::configs::CANcoderConfigurator::SetPosition ( units::angle::turn_t  newValue,
units::time::second_t  timeoutSeconds 
)
inline

Sets the current position of the device.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters
newValueValue to set to. Units are in rotations.
timeoutSecondsMaximum time to wait up to in seconds.
Returns
StatusCode of the set command

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