Base class for Trinamic stepper drivers that are configured over the single wire UART interface.
More...
|
| void | setup () override |
| |
| void | loop () override |
| |
| void | dump_config () override |
| |
| void | on_shutdown () override |
| |
| float | get_setup_priority () const override |
| |
| void | set_address (uint8_t address) |
| |
| void | set_enn_pin (GPIOPin *pin) |
| |
| void | set_step_pin (GPIOPin *pin) |
| |
| void | set_dir_pin (GPIOPin *pin) |
| |
| void | set_index_pin (InternalGPIOPin *pin) |
| |
| void | set_diag_pin (InternalGPIOPin *pin) |
| |
| void | set_clock_frequency (uint32_t frequency) |
| |
| void | set_rsense (float rsense) |
| |
| void | set_vsense (bool vsense) |
| |
| void | set_ottrim (uint8_t ottrim) |
| |
| void | set_analog_current_scale (bool enable) |
| |
| void | set_initial_run_current (float current) |
| |
| void | set_initial_hold_current (float current) |
| |
| void | set_initial_microsteps (uint16_t microsteps) |
| |
| void | set_enabled (bool enabled) |
| | Enable or disable the motor outputs, using the ENN pin when configured and TOFF otherwise.
|
| |
| bool | is_enabled () const |
| |
| bool | is_unreachable () const |
| | True while the driver does not answer, until the status poll reads it again (every 10 s).
|
| |
| template<typename F > |
| void | add_on_status_callback (F &&callback) |
| | Called with the condition and whether it became active or cleared.
|
| |
| void | set_microsteps (uint16_t microsteps) |
| |
| uint16_t | get_microsteps () |
| |
| void | set_interpolation (bool enable) |
| |
| void | set_spreadcycle (bool enable) |
| |
| void | set_inverse_direction (bool inverse) |
| |
| void | set_tpwm_threshold (uint32_t threshold) |
| |
| void | set_run_current (float current) |
| | Set the motor run or hold current in A RMS.
|
| |
| void | set_hold_current (float current) |
| |
| void | set_irun (uint8_t irun) |
| |
| void | set_ihold (uint8_t ihold) |
| |
| void | set_iholddelay (uint8_t delay) |
| |
| void | set_tpowerdown (uint8_t tpowerdown) |
| |
| void | set_standstill_mode (StandstillMode mode) |
| |
| void | set_toff (uint8_t toff) |
| | Chopper off time (1-15). TOFF=0 is used to disable the outputs, so this is applied on the next enable.
|
| |
| void | set_tbl (uint8_t tbl) |
| |
| void | set_hend (uint8_t hend) |
| |
| void | set_hstrt (uint8_t hstrt) |
| |
| void | set_pwm_ofs (uint8_t ofs) |
| |
| void | set_pwm_grad (uint8_t grad) |
| |
| void | set_pwm_freq (uint8_t freq) |
| |
| void | set_pwm_autoscale (bool enable) |
| |
| void | set_pwm_autograd (bool enable) |
| |
| void | set_pwm_reg (uint8_t reg) |
| |
| void | set_pwm_lim (uint8_t lim) |
| |
| float | scale_to_current (uint8_t scale) |
| | Convert a current scale (0-31) to A RMS, without analog current scale.
|
| |
| bool | write_register (uint8_t reg, uint32_t value) |
| |
| optional< uint32_t > | read_register (uint8_t reg) |
| |
| bool | write_field (const RegisterField &field, uint32_t value) |
| |
| optional< uint32_t > | read_field (const RegisterField &field) |
| |
| void | set_target (int32_t steps) |
| |
| void | report_position (int32_t steps) |
| |
| void | set_acceleration (float acceleration) |
| |
| void | set_deceleration (float deceleration) |
| |
| void | set_max_speed (float max_speed) |
| |
| virtual void | on_update_speed () |
| |
| bool | has_reached_target () |
| |
| float | get_actual_setup_priority () const |
| |
| void | set_setup_priority (float priority) |
| |
| void | call () |
| |
| virtual void | on_safe_shutdown () |
| |
| virtual bool | teardown () |
| | Called during teardown to allow component to gracefully finish operations.
|
| |
| virtual void | on_powerdown () |
| | Called after teardown is complete to power down hardware.
|
| |
| uint8_t | get_component_state () const |
| |
| void | reset_to_construction_state () |
| | Reset this component back to the construction state to allow setup to run again.
|
| |
| bool | is_in_loop_state () const |
| | Check if this component has completed setup and is in the loop state.
|
| |
| bool | is_idle () const |
| | Check if this component is idle.
|
| |
| void | mark_failed () |
| | Mark this component as failed.
|
| |
| void | mark_failed (const LogString *message) |
| |
| void | disable_loop () |
| | Disable this component's loop.
|
| |
| void | enable_loop () |
| | Enable this component's loop.
|
| |
| void | enable_loop_soon_any_context () |
| | Thread and ISR-safe version of enable_loop() that can be called from any context.
|
| |
| bool | is_failed () const |
| |
| bool | is_ready () const |
| |
| virtual bool | can_proceed () |
| |
| bool | status_has_warning () const |
| |
| bool | status_has_error () const |
| |
| void | status_set_warning () |
| |
| void | status_set_warning (const char *message) |
| |
| void | status_set_warning (const LogString *message) |
| |
| void | status_set_error () |
| |
| void | status_set_error (const LogString *message) |
| |
| void | status_clear_warning () |
| |
| void | status_clear_error () |
| |
| | ESPDEPRECATED ("Use status_momentary_warning() without a name. Removed in 2027.5.0", "2026.11.0") void status_momentary_warning(const char *name |
| |
| void | status_momentary_warning (uint32_t length=5000) |
| | Set warning status flag and clear it after length ms.
|
| |
| void | status_momentary_warning (const LogString *message, uint32_t length=5000) |
| |
| | ESPDEPRECATED ("Use status_momentary_error() without a name. Removed in 2027.5.0", "2026.11.0") void status_momentary_error(const char *name |
| |
| void | status_momentary_error (uint32_t length=5000) |
| | Set error status flag and clear it after length ms.
|
| |
| void | status_momentary_error (const LogString *message, uint32_t length=5000) |
| |
| bool | has_overridden_loop () const |
| |
| const LogString * | get_component_log_str () const ESPHOME_ALWAYS_INLINE |
| | Get the integration where this component was declared as a LogString for logging.
|
| |
| bool | should_warn_of_blocking (uint32_t blocking_time, uint32_t &threshold_ms_out) |
| |
| | UARTDevice ()=default |
| |
| | UARTDevice (UARTComponent *parent) |
| |
| void | set_uart_parent (UARTComponent *parent) |
| |
| void | write_byte (uint8_t data) |
| |
| void | set_rx_full_threshold (size_t rx_full_threshold) |
| |
| void | set_rx_full_threshold_ms (size_t time) |
| |
| size_t | get_rx_full_threshold () |
| |
| void | set_rx_timeout (size_t rx_timeout) |
| |
| size_t | get_rx_timeout () |
| |
| void | write_array (const uint8_t *data, size_t len) |
| |
| void | write_array_progmem (const uint8_t *data, size_t len) |
| |
| void | write_array (const std::vector< uint8_t > &data) |
| |
| template<size_t N> |
| void | write_array (const std::array< uint8_t, N > &data) |
| |
| void | write_str (const char *str) |
| |
| bool | read_byte (uint8_t *data) |
| |
| bool | peek_byte (uint8_t *data) |
| |
| bool | read_array (uint8_t *data, size_t len) |
| |
| template<size_t N> |
| optional< std::array< uint8_t, N > > | read_array () |
| |
| size_t | available () |
| |
| UARTFlushResult | flush () |
| |
| int | read () |
| |
| size_t | write (uint8_t data) |
| |
| int | peek () |
| |
| | ESPDEPRECATED ("Use uart.final_validate_device_schema() in Python instead. Removed in 2027.3.0", "2026.9.0") void check_uart_settings(uint32_t baud_rate |
| | Check that the configuration of the UART bus matches the provided values and otherwise print a warning.
|
| |
|
| virtual uint8_t | expected_version () const =0 |
| | IC version reported in IOIN by the supported chip.
|
| |
| virtual uint32_t * | shadow_register (uint8_t reg) |
| | Return the cached value of a write-only register, or nullptr when the register is readable.
|
| |
| virtual void | restore_registers () |
| | Write the cached write-only registers and the last written configuration registers to the driver, at setup and after a driver reset.
|
| |
| void | apply_config_ () |
| | Write the settings from the configuration to the readable registers.
|
| |
| virtual void | on_diag_without_error () |
| | Called when DIAG rises without a driver error.
|
| |
| bool | update_status_ () |
| | Read GSTAT and DRV_STATUS and report changes. Returns false when the status could not be read.
|
| |
| optional< uint8_t > | current_to_scale_ (float current) |
| |
| float | full_scale_current_ () |
| |
| int32_t | get_vactual_ () const |
| |
| int32_t | speed_to_vactual_ (float speed) const |
| |
| void | add_index_pulses_ () |
| |
| void | loop_serial_ () |
| |
| void | loop_step_dir_ () |
| |
| void | calculate_speed_ (uint32_t now) |
| |
| int32_t | should_step_ () |
| |
| friend | void::setup () |
| |
| friend | void::original_setup () |
| |
| void | set_component_source_ (uint8_t index) |
| | Set where this component was loaded from for some debug messages.
|
| |
| virtual void | call_setup () |
| |
| void | call_dump_config_ () |
| |
| void | enable_loop_slow_path_ () |
| |
| void | set_component_state_ (uint8_t state) |
| | Helper to set component state (clears state bits and sets new state)
|
| |
| bool | set_status_flag_ (uint8_t flag) |
| | Helper to set a status LED flag on both this component and the app.
|
| |
| bool | set_error_flag_ (const LogString *message) |
| | Set the error flag and log it; true when it was not set before.
|
| |
| void | set_interval (const char *name, uint32_t interval, std::function< void()> &&f) |
| | Set an interval function with a const char* name.
|
| |
| void | set_interval (uint32_t id, uint32_t interval, std::function< void()> &&f) |
| | Set an interval function with a numeric ID (zero heap allocation).
|
| |
| void | set_interval (InternalSchedulerID id, uint32_t interval, std::function< void()> &&f) |
| |
| void | set_interval (uint32_t interval, std::function< void()> &&f) |
| |
| bool | cancel_interval (const char *name) |
| | Cancel an interval function.
|
| |
| bool | cancel_interval (uint32_t id) |
| |
| bool | cancel_interval (InternalSchedulerID id) |
| |
| void | set_timeout (const char *name, uint32_t timeout, std::function< void()> &&f) |
| | Set a timeout function with a const char* name.
|
| |
| void | set_timeout (uint32_t id, uint32_t timeout, std::function< void()> &&f) |
| | Set a timeout function with a numeric ID (zero heap allocation).
|
| |
| void | set_timeout (InternalSchedulerID id, uint32_t timeout, std::function< void()> &&f) |
| |
| void | set_timeout (uint32_t timeout, std::function< void()> &&f) |
| |
| bool | cancel_timeout (const char *name) |
| | Cancel a timeout function.
|
| |
| bool | cancel_timeout (uint32_t id) |
| |
| bool | cancel_timeout (InternalSchedulerID id) |
| |
| void | defer (const char *name, std::function< void()> &&f) |
| | Defer a callback to the next loop() call with a const char* name.
|
| |
| void | defer (std::function< void()> &&f) |
| | Defer a callback to the next loop() call.
|
| |
| void | defer (uint32_t id, std::function< void()> &&f) |
| | Defer a callback with a numeric ID (zero heap allocation)
|
| |
| bool | cancel_defer (const char *name) |
| | Cancel a defer callback using the specified name, name must not be empty.
|
| |
| bool | cancel_defer (uint32_t id) |
| |
| void | status_clear_warning_slow_path_ () |
| |
| void | status_clear_error_slow_path_ () |
| |
Base class for Trinamic stepper drivers that are configured over the single wire UART interface.
Definition at line 123 of file tmc22xx.h.