HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
Loading...
Searching...
No Matches
tmc51x0::GlobalConfig Struct Reference

Global configuration (GCONF) structure. More...

#include <tmc51x0_types.hpp>

Collaboration diagram for tmc51x0::GlobalConfig:
[legend]

Public Member Functions

 GlobalConfig ()=default
 Default constructor.
 

Public Attributes

bool recalibrate {false}
 Bit 0: Zero crossing recalibration during driver disable.
 
bool en_short_standstill_timeout
 
bool en_stealthchop_mode {true}
 
bool en_stealthchop_step_filter {true}
 
bool invert_direction {false}
 
Diag0Config diag0
 DIAG0 pin configuration (bits 5, 6, 7, 12)
 
Diag1Config diag1
 DIAG1 pin configuration (bits 8, 9, 10, 11, 13)
 
bool en_small_step_frequency_hysteresis
 
bool enca_dcin_sequencer_stop {false}
 
bool direct_mode {false}
 

Detailed Description

Global configuration (GCONF) structure.

Configuration for global TMC5160 driver settings. See GCONF_Register documentation for detailed bit descriptions and SD_MODE dependencies.

Constructor & Destructor Documentation

◆ GlobalConfig()

tmc51x0::GlobalConfig::GlobalConfig ( )
default

Default constructor.

Initializes with recommended default values. All members use default member initializers, so constructor is empty.

Member Data Documentation

◆ diag0

Diag0Config tmc51x0::GlobalConfig::diag0

DIAG0 pin configuration (bits 5, 6, 7, 12)

◆ diag1

Diag1Config tmc51x0::GlobalConfig::diag1

DIAG1 pin configuration (bits 8, 9, 10, 11, 13)

◆ direct_mode

bool tmc51x0::GlobalConfig::direct_mode {false}

Bit 16: Direct coil control mode. When enabled, motor coil currents and polarity are directly programmed via XTARGET register (0x2D):

  • Bits 8..0: Coil A current (signed 9-bit, range ±248 recommended)
  • Bits 24..16: Coil B current (signed 9-bit, range ±248 recommended) Current is scaled by IHOLD setting. Can be used with any motor type (stepper, DC motor, or solenoid). In this mode, velocity-based current regulation of StealthChop is not available. The ramp generator and step/dir inputs are not used - use SetCoilCurrents() to control motors. For solenoids, a step impulse must be given to STEP input to trigger IRUN/IHOLD current scaling. See datasheet Chapter 21 for DC motor and solenoid operation details. Bit 17: test_mode (factory use only, not exposed to user - always disabled)

◆ en_short_standstill_timeout

bool tmc51x0::GlobalConfig::en_short_standstill_timeout
Initial value:
{
false}

Bit 1: Enable shorter timeout for standstill detection. true = Short timeout (2^18 clocks), false = Normal timeout (2^20 clocks). Shorter timeout detects standstill faster but may be less stable.

◆ en_small_step_frequency_hysteresis

bool tmc51x0::GlobalConfig::en_small_step_frequency_hysteresis
Initial value:
{
false}

Bit 14: Enable smaller hysteresis for step frequency comparison. false = Normal hysteresis (1/16), true = Small hysteresis (1/32). Smaller hysteresis provides finer step frequency comparison but may be less stable.

◆ en_stealthchop_mode

bool tmc51x0::GlobalConfig::en_stealthchop_mode {true}

Bit 2: Enable StealthChop voltage PWM mode (switch only in standstill at IHOLD=IRUN). When false, uses SpreadCycle mode.

◆ en_stealthchop_step_filter

bool tmc51x0::GlobalConfig::en_stealthchop_step_filter {true}

Bit 3: Enable step input filtering for StealthChop optimization with external step source. Filters step pulses to optimize StealthChop performance. Default=true (recommended).

◆ enca_dcin_sequencer_stop

bool tmc51x0::GlobalConfig::enca_dcin_sequencer_stop {false}

Bit 15: Enable ENCA_DCIN pin as sequencer stop input. When enabled, ENCA_DCIN pin stops the ramp generator sequencer (motor goes to standstill). Note: This is different from DRV_ENN hardware emergency stop (which cuts all MOSFETs). This stop may maintain holding current depending on configuration. See datasheet Chapter 19 for details.

◆ invert_direction

bool tmc51x0::GlobalConfig::invert_direction {false}

Bit 4: Invert motor direction (false=normal, true=inverse). When true, motor rotates in opposite direction for same step/direction inputs.

◆ recalibrate

bool tmc51x0::GlobalConfig::recalibrate {false}

Bit 0: Zero crossing recalibration during driver disable.


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