:py:mod:`phoenix6.configs.candi_configs` ======================================== .. py:module:: phoenix6.configs.candi_configs Module Contents --------------- .. py:class:: CANdiConfiguration Class for CTR Electronics' CANdi™ branded device, a device that integrates digital signals into the existing CAN bus network. This defines all configurations for the CANdi. .. py:attribute:: future_proof_configs :type: bool :value: '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. .. py:attribute:: custom_params :type: CustomParamsConfigs Custom Params. Custom paramaters that have no real impact on controller. Parameter list: - CustomParamsConfigs.custom_param0 - CustomParamsConfigs.custom_param1 .. py:attribute:: digital_inputs :type: DigitalInputsConfigs Configs related to the CANdi™ branded device's digital I/O settings Contains float-state settings and when to assert the S1/S2 inputs. Parameter list: - DigitalInputsConfigs.s1_float_state - DigitalInputsConfigs.s2_float_state - DigitalInputsConfigs.s1_close_state - DigitalInputsConfigs.s2_close_state .. py:attribute:: quadrature :type: QuadratureConfigs Configs related to the CANdi™ branded device's quadrature interface using both the S1IN and S2IN inputs All the configs related to the quadrature interface for the CANdi™ branded device , including encoder edges per revolution and sensor direction. Parameter list: - QuadratureConfigs.quadrature_edges_per_rotation - QuadratureConfigs.sensor_direction .. py:attribute:: pwm1 :type: PWM1Configs Configs related to the CANdi™ branded device's PWM interface on the Signal 1 input (S1IN) All the configs related to the PWM interface for the CANdi™ branded device on S1, including absolute sensor offset, absolute sensor discontinuity point and sensor direction. Parameter list: - PWM1Configs.absolute_sensor_offset - PWM1Configs.absolute_sensor_discontinuity_point - PWM1Configs.sensor_direction .. py:attribute:: pwm2 :type: PWM2Configs Configs related to the CANdi™ branded device's PWM interface on the Signal 2 input (S2IN) All the configs related to the PWM interface for the CANdi™ branded device on S1, including absolute sensor offset, absolute sensor discontinuity point and sensor direction. Parameter list: - PWM2Configs.absolute_sensor_offset - PWM2Configs.absolute_sensor_discontinuity_point - PWM2Configs.sensor_direction .. py:method:: with_custom_params(new_custom_params: CustomParamsConfigs) -> CANdiConfiguration 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 :param new_custom_params: Parameter to modify :type new_custom_params: CustomParamsConfigs :returns: Itself :rtype: CANdiConfiguration .. py:method:: with_digital_inputs(new_digital_inputs: DigitalInputsConfigs) -> CANdiConfiguration Modifies this configuration's digital_inputs parameter and returns itself for method-chaining and easier to use config API. Configs related to the CANdi™ branded device's digital I/O settings Contains float-state settings and when to assert the S1/S2 inputs. Parameter list: - DigitalInputsConfigs.s1_float_state - DigitalInputsConfigs.s2_float_state - DigitalInputsConfigs.s1_close_state - DigitalInputsConfigs.s2_close_state :param new_digital_inputs: Parameter to modify :type new_digital_inputs: DigitalInputsConfigs :returns: Itself :rtype: CANdiConfiguration .. py:method:: with_quadrature(new_quadrature: QuadratureConfigs) -> CANdiConfiguration Modifies this configuration's quadrature parameter and returns itself for method-chaining and easier to use config API. Configs related to the CANdi™ branded device's quadrature interface using both the S1IN and S2IN inputs All the configs related to the quadrature interface for the CANdi™ branded device , including encoder edges per revolution and sensor direction. Parameter list: - QuadratureConfigs.quadrature_edges_per_rotation - QuadratureConfigs.sensor_direction :param new_quadrature: Parameter to modify :type new_quadrature: QuadratureConfigs :returns: Itself :rtype: CANdiConfiguration .. py:method:: with_pwm1(new_pwm1: PWM1Configs) -> CANdiConfiguration Modifies this configuration's pwm1 parameter and returns itself for method-chaining and easier to use config API. Configs related to the CANdi™ branded device's PWM interface on the Signal 1 input (S1IN) All the configs related to the PWM interface for the CANdi™ branded device on S1, including absolute sensor offset, absolute sensor discontinuity point and sensor direction. Parameter list: - PWM1Configs.absolute_sensor_offset - PWM1Configs.absolute_sensor_discontinuity_point - PWM1Configs.sensor_direction :param new_pwm1: Parameter to modify :type new_pwm1: PWM1Configs :returns: Itself :rtype: CANdiConfiguration .. py:method:: with_pwm2(new_pwm2: PWM2Configs) -> CANdiConfiguration Modifies this configuration's pwm2 parameter and returns itself for method-chaining and easier to use config API. Configs related to the CANdi™ branded device's PWM interface on the Signal 2 input (S2IN) All the configs related to the PWM interface for the CANdi™ branded device on S1, including absolute sensor offset, absolute sensor discontinuity point and sensor direction. Parameter list: - PWM2Configs.absolute_sensor_offset - PWM2Configs.absolute_sensor_discontinuity_point - PWM2Configs.sensor_direction :param new_pwm2: Parameter to modify :type new_pwm2: PWM2Configs :returns: Itself :rtype: CANdiConfiguration .. py:method:: serialize() -> str Get the serialized form of this configuration :returns: Serialized form of this config group :rtype: str .. py:method:: deserialize(to_deserialize: str) -> phoenix6.status_code.StatusCode Take a string and deserialize it to this configuration :returns: Return code of the deserialize method :rtype: str .. py:class:: CANdiConfigurator(id: phoenix6.hardware.device_identifier.DeviceIdentifier) Bases: :py:obj:`phoenix6.configs.parent_configurator.ParentConfigurator` Class for CTR Electronics' CANdi™ branded device, a device that integrates digital signals into the existing CAN bus network. This handles applying and refreshing the configurations for CANdi. .. py:method:: apply(configs: CANdiConfiguration, timeout_seconds: phoenix6.units.second = 0.1) -> phoenix6.status_code.StatusCode apply(configs: CustomParamsConfigs, timeout_seconds: phoenix6.units.second = 0.1) -> phoenix6.status_code.StatusCode apply(configs: DigitalInputsConfigs, timeout_seconds: phoenix6.units.second = 0.1) -> phoenix6.status_code.StatusCode apply(configs: QuadratureConfigs, timeout_seconds: phoenix6.units.second = 0.1) -> phoenix6.status_code.StatusCode apply(configs: PWM1Configs, timeout_seconds: phoenix6.units.second = 0.1) -> phoenix6.status_code.StatusCode apply(configs: PWM2Configs, 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. :param configs: Configs to apply :type configs: SupportsSerialization :param timeout_seconds: Maximum amount of time to wait when performing configuration :type timeout_seconds: second :returns: Status code of applying the configs :rtype: StatusCode .. py:method:: refresh(configs: CANdiConfiguration, timeout_seconds: phoenix6.units.second = 0.1) -> phoenix6.status_code.StatusCode refresh(configs: CustomParamsConfigs, timeout_seconds: phoenix6.units.second = 0.1) -> phoenix6.status_code.StatusCode refresh(configs: DigitalInputsConfigs, timeout_seconds: phoenix6.units.second = 0.1) -> phoenix6.status_code.StatusCode refresh(configs: QuadratureConfigs, timeout_seconds: phoenix6.units.second = 0.1) -> phoenix6.status_code.StatusCode refresh(configs: PWM1Configs, timeout_seconds: phoenix6.units.second = 0.1) -> phoenix6.status_code.StatusCode refresh(configs: PWM2Configs, 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. :param configs: The configs to refresh :type configs: SupportsSerialization :param timeout_seconds: Maximum amount of time to wait when performing configuration :type timeout_seconds: second :returns: Status code of refreshing the configs :rtype: StatusCode .. py:method:: set_quadrature_position(new_value: phoenix6.units.rotation, timeout_seconds: phoenix6.units.second = 0.1) -> phoenix6.status_code.StatusCode Sets the position of the quadrature input. 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. :param new_value: Value to set to. Units are in rotations. :type new_value: rotation :param timeout_seconds: Maximum time to wait up to in seconds. :type timeout_seconds: second :returns: StatusCode of the set command :rtype: StatusCode .. py:method:: 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. :param timeout_seconds: Maximum time to wait up to in seconds. :type timeout_seconds: second :returns: StatusCode of the set command :rtype: StatusCode .. py:method:: 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. :param timeout_seconds: Maximum time to wait up to in seconds. :type timeout_seconds: second :returns: StatusCode of the set command :rtype: StatusCode .. py:method:: 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. :param timeout_seconds: Maximum time to wait up to in seconds. :type timeout_seconds: second :returns: StatusCode of the set command :rtype: StatusCode .. py:method:: 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. :param timeout_seconds: Maximum time to wait up to in seconds. :type timeout_seconds: second :returns: StatusCode of the set command :rtype: StatusCode .. py:method:: 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. :param timeout_seconds: Maximum time to wait up to in seconds. :type timeout_seconds: second :returns: StatusCode of the set command :rtype: StatusCode .. py:method:: clear_sticky_fault_5_v(timeout_seconds: phoenix6.units.second = 0.1) -> phoenix6.status_code.StatusCode Clear sticky fault: The CTR Electronics' CANdi™ branded device has detected a 5V fault. This may be due to overcurrent or a short-circuit. 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. :param timeout_seconds: Maximum time to wait up to in seconds. :type timeout_seconds: second :returns: StatusCode of the set command :rtype: StatusCode