phoenix6.configs.canrange_configs

Module Contents

class phoenix6.configs.canrange_configs.CANrangeConfiguration

Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the distance to the front of the device.

This handles the configurations for CANrange

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: phoenix6.configs.config_groups.CustomParamsConfigs

Custom Params.

Custom paramaters that have no real impact on controller.

to_f_params: phoenix6.configs.config_groups.ToFParamsConfigs

Configs that affect the ToF sensor

Includes Update mode and frequency

proximity_params: phoenix6.configs.config_groups.ProximityParamsConfigs

Configs that affect the ToF Proximity detection

Includes proximity mode and the threshold for simple detection

fov_params: phoenix6.configs.config_groups.FovParamsConfigs

Configs that affect the ToF Field of View

Includes range and center configs

with_custom_params(new_custom_params: phoenix6.configs.config_groups.CustomParamsConfigs) CANrangeConfiguration

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.

Parameters:

new_custom_params (CustomParamsConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANrangeConfiguration

with_to_f_params(new_to_f_params: phoenix6.configs.config_groups.ToFParamsConfigs) CANrangeConfiguration

Modifies this configuration’s to_f_params parameter and returns itself for method-chaining and easier to use config API.

Configs that affect the ToF sensor

Includes Update mode and frequency

Parameters:

new_to_f_params (ToFParamsConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANrangeConfiguration

with_proximity_params(new_proximity_params: phoenix6.configs.config_groups.ProximityParamsConfigs) CANrangeConfiguration

Modifies this configuration’s proximity_params parameter and returns itself for method-chaining and easier to use config API.

Configs that affect the ToF Proximity detection

Includes proximity mode and the threshold for simple detection

Parameters:

new_proximity_params (ProximityParamsConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANrangeConfiguration

with_fov_params(new_fov_params: phoenix6.configs.config_groups.FovParamsConfigs) CANrangeConfiguration

Modifies this configuration’s fov_params parameter and returns itself for method-chaining and easier to use config API.

Configs that affect the ToF Field of View

Includes range and center configs

Parameters:

new_fov_params (FovParamsConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANrangeConfiguration

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.canrange_configs.CANrangeConfigurator(id: phoenix6.hardware.device_identifier.DeviceIdentifier)

Bases: phoenix6.configs.parent_configurator.ParentConfigurator

  • Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the

  • distance to the front of the device.

    This handles the configurations for CANrange

refresh(configs: phoenix6.configs.config_groups.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:

StatusCode

apply(configs: phoenix6.configs.config_groups.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:

StatusCode

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:

StatusCode

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:

StatusCode

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:

StatusCode

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:

StatusCode

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:

StatusCode