HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
Loading...
Searching...
No Matches
BoundsCache Namespace Reference

Functions

bool AreBoundsValid () noexcept
 Check if bounds are still valid (within time window and motor energized).
 
uint32_t GetRemainingValiditySec () noexcept
 Get remaining time until bounds expire (seconds).
 
void MarkBoundsFound () noexcept
 Mark bounds as freshly found and start de-energize timer.
 
void CancelDeenergizeTimer () noexcept
 Cancel de-energize timer (e.g., when test starts).
 
void InvalidateBounds () noexcept
 Invalidate bounds (e.g., on config change or explicit request).
 
void SetValidityMinutes (uint32_t minutes) noexcept
 Set the validity window in minutes.
 
void Init () noexcept
 Initialize the bounds cache system (create timer).
 

Variables

static constexpr uint32_t DEFAULT_VALIDITY_MINUTES = 2
 Default time window (in minutes) during which bounds remain valid.
 
static volatile int64_t g_bounds_timestamp_us = 0
 Time (microseconds, from esp_timer_get_time) when bounds were last found.
 
static volatile int64_t g_bounds_validity_us = DEFAULT_VALIDITY_MINUTES * 60 * 1000000LL
 Bounds validity window in microseconds.
 
static volatile bool g_motor_energized_for_bounds = false
 True if motor is currently energized from bounds finding.
 
static esp_timer_handle_t g_deenergize_timer = nullptr
 Timer handle for de-energize timeout.
 

Function Documentation

◆ AreBoundsValid()

bool BoundsCache::AreBoundsValid ( )
inlinenoexcept

Check if bounds are still valid (within time window and motor energized).

Returns
true if we can skip bounds finding
Here is the caller graph for this function:

◆ CancelDeenergizeTimer()

void BoundsCache::CancelDeenergizeTimer ( )
noexcept

Cancel de-energize timer (e.g., when test starts).

Here is the caller graph for this function:

◆ GetRemainingValiditySec()

uint32_t BoundsCache::GetRemainingValiditySec ( )
inlinenoexcept

Get remaining time until bounds expire (seconds).

Returns
Seconds remaining, or 0 if expired
Here is the caller graph for this function:

◆ Init()

void BoundsCache::Init ( )
noexcept

Initialize the bounds cache system (create timer).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InvalidateBounds()

void BoundsCache::InvalidateBounds ( )
noexcept

Invalidate bounds (e.g., on config change or explicit request).

Here is the caller graph for this function:

◆ MarkBoundsFound()

void BoundsCache::MarkBoundsFound ( )
noexcept

Mark bounds as freshly found and start de-energize timer.

Here is the caller graph for this function:

◆ SetValidityMinutes()

void BoundsCache::SetValidityMinutes ( uint32_t minutes)
noexcept

Set the validity window in minutes.

Variable Documentation

◆ DEFAULT_VALIDITY_MINUTES

constexpr uint32_t BoundsCache::DEFAULT_VALIDITY_MINUTES = 2
staticconstexpr

Default time window (in minutes) during which bounds remain valid.

◆ g_bounds_timestamp_us

volatile int64_t BoundsCache::g_bounds_timestamp_us = 0
static

Time (microseconds, from esp_timer_get_time) when bounds were last found.

◆ g_bounds_validity_us

volatile int64_t BoundsCache::g_bounds_validity_us = DEFAULT_VALIDITY_MINUTES * 60 * 1000000LL
static

Bounds validity window in microseconds.

◆ g_deenergize_timer

esp_timer_handle_t BoundsCache::g_deenergize_timer = nullptr
static

Timer handle for de-energize timeout.

◆ g_motor_energized_for_bounds

volatile bool BoundsCache::g_motor_energized_for_bounds = false
static

True if motor is currently energized from bounds finding.