phoenix6.configs.candle_configs
¶
Module Contents¶
- class phoenix6.configs.candle_configs.CANdleConfiguration¶
Class for CTR Electronics’ CANdle® branded device, a device that controls LEDs over the CAN bus.
This handles the configurations for CANdle
- future_proof_configs: bool = 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.
- custom_params: CustomParamsConfigs¶
Custom Params.
Custom paramaters that have no real impact on controller.
Parameter list:
CustomParamsConfigs.custom_param0
CustomParamsConfigs.custom_param1
- led: LEDConfigs¶
Configs related to CANdle LED control.
All the configs related to controlling LEDs with the CANdle, including LED strip type and brightness.
Parameter list:
LEDConfigs.strip_type
LEDConfigs.brightness_scalar
LEDConfigs.loss_of_signal_behavior
- candle_features: CANdleFeaturesConfigs¶
Configs related to general CANdle features.
This includes configs such as disabling the 5V rail and the behavior of VBat output.
Parameter list:
CANdleFeaturesConfigs.enable5_v_rail
CANdleFeaturesConfigs.v_bat_output_mode
CANdleFeaturesConfigs.status_led_when_active
- with_custom_params(new_custom_params: CustomParamsConfigs) CANdleConfiguration ¶
Modifies this configuration’s custom_params parameter and returns itself for method-chaining and easier to use config API.
Custom Params.
Custom paramaters that have no real impact on controller.
Parameter list:
CustomParamsConfigs.custom_param0
CustomParamsConfigs.custom_param1
- Parameters:
new_custom_params (CustomParamsConfigs) – Parameter to modify
- Returns:
Itself
- Return type:
- with_led(new_led: LEDConfigs) CANdleConfiguration ¶
Modifies this configuration’s led parameter and returns itself for method-chaining and easier to use config API.
Configs related to CANdle LED control.
All the configs related to controlling LEDs with the CANdle, including LED strip type and brightness.
Parameter list:
LEDConfigs.strip_type
LEDConfigs.brightness_scalar
LEDConfigs.loss_of_signal_behavior
- Parameters:
new_led (LEDConfigs) – Parameter to modify
- Returns:
Itself
- Return type:
- with_candle_features(new_candle_features: CANdleFeaturesConfigs) CANdleConfiguration ¶
Modifies this configuration’s candle_features parameter and returns itself for method-chaining and easier to use config API.
Configs related to general CANdle features.
This includes configs such as disabling the 5V rail and the behavior of VBat output.
Parameter list:
CANdleFeaturesConfigs.enable5_v_rail
CANdleFeaturesConfigs.v_bat_output_mode
CANdleFeaturesConfigs.status_led_when_active
- Parameters:
new_candle_features (CANdleFeaturesConfigs) – Parameter to modify
- Returns:
Itself
- Return type:
- serialize() str ¶
Get the serialized form of this configuration
- Returns:
Serialized form of this config group
- Return type:
str
- deserialize(to_deserialize: str) phoenix6.status_code.StatusCode ¶
Take a string and deserialize it to this configuration
- Returns:
Return code of the deserialize method
- Return type:
str
- class phoenix6.configs.candle_configs.CANdleConfigurator(id: phoenix6.hardware.device_identifier.DeviceIdentifier)¶
Bases:
phoenix6.configs.parent_configurator.ParentConfigurator
Class for CTR Electronics’ CANdle® branded device, a device that controls
LEDs over the CAN bus.
This handles the configurations for CANdle
- refresh(configs: SupportsSerialization, timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode ¶
Refreshes the values of the specified config group.
Call to refresh the selected configs from the device.
- Parameters:
configs (name) – The configs to refresh
timeout_seconds (second) – Maximum amount of time to wait when performing configuration
- Returns:
StatusCode of refreshing the configs
- Return type:
- apply(configs: SupportsSerialization, timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode ¶
Applies the contents of the specified config to the device.
Call to apply the selected configs.
- Parameters:
configs (SupportsSerialization) – Configs to apply
timeout_seconds (second) – Maximum amount of time to wait when performing configuration
- Returns:
StatusCode of the apply method
- Return type:
- clear_sticky_faults(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode ¶
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:
timeout_seconds (second) – Maximum time to wait up to in seconds.
- Returns:
StatusCode of the set command
- Return type:
- clear_sticky_fault_hardware(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode ¶
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:
timeout_seconds (second) – Maximum time to wait up to in seconds.
- Returns:
StatusCode of the set command
- Return type:
- clear_sticky_fault_undervoltage(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode ¶
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:
timeout_seconds (second) – Maximum time to wait up to in seconds.
- Returns:
StatusCode of the set command
- Return type:
- clear_sticky_fault_boot_during_enable(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode ¶
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:
timeout_seconds (second) – Maximum time to wait up to in seconds.
- Returns:
StatusCode of the set command
- Return type:
- clear_sticky_fault_unlicensed_feature_in_use(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode ¶
Clear sticky fault: An unlicensed feature is in use, device may not behave as expected.
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:
timeout_seconds (second) – Maximum time to wait up to in seconds.
- Returns:
StatusCode of the set command
- Return type:
- clear_sticky_fault_overvoltage(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode ¶
Clear sticky fault: Device supply voltage is too high (above 30 V).
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:
timeout_seconds (second) – Maximum time to wait up to in seconds.
- Returns:
StatusCode of the set command
- Return type:
- clear_sticky_fault_5_v_too_high(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode ¶
Clear sticky fault: Device 5V line is too high (above 6 V).
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:
timeout_seconds (second) – Maximum time to wait up to in seconds.
- Returns:
StatusCode of the set command
- Return type:
- clear_sticky_fault_5_v_too_low(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode ¶
Clear sticky fault: Device 5V line is too low (below 4 V).
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:
timeout_seconds (second) – Maximum time to wait up to in seconds.
- Returns:
StatusCode of the set command
- Return type:
- clear_sticky_fault_thermal(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode ¶
Clear sticky fault: Device temperature exceeded limit.
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:
timeout_seconds (second) – Maximum time to wait up to in seconds.
- Returns:
StatusCode of the set command
- Return type:
- clear_sticky_fault_software_fuse(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode ¶
Clear sticky fault: CANdle output current exceeded the 6 A limit.
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:
timeout_seconds (second) – Maximum time to wait up to in seconds.
- Returns:
StatusCode of the set command
- Return type:
- clear_sticky_fault_short_circuit(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode ¶
Clear sticky fault: CANdle has detected the output pin is shorted.
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:
timeout_seconds (second) – Maximum time to wait up to in seconds.
- Returns:
StatusCode of the set command
- Return type: