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

Motion events / status outputs (X_COMPARE, RAMP_STAT clear) More...

#include <tmc51x0.hpp>

Collaboration diagram for tmc51x0::TMC51x0< CommType >::Events:
[legend]

Public Member Functions

 Events (TMC51x0 &driver) noexcept
 
Result< void > SetXCompare (float position, Unit unit) noexcept
 Program the X_COMPARE position compare threshold (unit-aware)
 
Result< float > GetXCompare (Unit unit) const noexcept
 Get last programmed X_COMPARE threshold (cached, unit-aware)
 
Result< void > ClearRampStatus (uint32_t bits_to_clear) noexcept
 Clear specific bits in RAMP_STAT.
 

Private Attributes

TMC51x0driver_
 

Detailed Description

template<typename CommType>
struct tmc51x0::TMC51x0< CommType >::Events

Motion events / status outputs (X_COMPARE, RAMP_STAT clear)

Constructor & Destructor Documentation

◆ Events()

template<typename CommType >
tmc51x0::TMC51x0< CommType >::Events::Events ( TMC51x0 & driver)
inlineexplicitnoexcept

Member Function Documentation

◆ ClearRampStatus()

template<typename CommType >
Result< void > tmc51x0::TMC51x0< CommType >::Events::ClearRampStatus ( uint32_t bits_to_clear)
noexcept

Clear specific bits in RAMP_STAT.

Parameters
bits_to_clearBitmask of RAMP_STAT bits to clear (write-1-to-clear)
Returns
Result<void> indicating success or error

◆ GetXCompare()

template<typename CommType >
Result< float > tmc51x0::TMC51x0< CommType >::Events::GetXCompare ( Unit unit) const
noexcept

Get last programmed X_COMPARE threshold (cached, unit-aware)

Parameters
unitUnit to return the cached compare value in
Returns
Result<float> containing the cached value

This does not read hardware (X_COMPARE is write-only); it returns the last value written by SetXCompare() (or other APIs writing X_COMPARE).

◆ SetXCompare()

template<typename CommType >
Result< void > tmc51x0::TMC51x0< CommType >::Events::SetXCompare ( float position,
Unit unit )
noexcept

Program the X_COMPARE position compare threshold (unit-aware)

Parameters
positionCompare position
unitUnit of the compare position
Returns
Result<void> indicating success or error

Note: X_COMPARE is a write-only register. The driver caches the last written value; use GetXCompare() to retrieve that cached value.

Member Data Documentation

◆ driver_

template<typename CommType >
TMC51x0& tmc51x0::TMC51x0< CommType >::Events::driver_
private

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