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

Self-describing velocity value with explicit unit. More...

#include <tmc51x0_types.hpp>

Public Member Functions

 VelocityValue ()=default
 Default constructor.
 
constexpr VelocityValue (float v, Unit u) noexcept
 Construct with value and unit.
 

Static Public Member Functions

static constexpr VelocityValue FromSteps (float v) noexcept
 
static constexpr VelocityValue FromRPM (float v) noexcept
 
static constexpr VelocityValue FromRevPerSec (float v) noexcept
 
static constexpr VelocityValue FromRad (float v) noexcept
 
static constexpr VelocityValue FromDeg (float v) noexcept
 
static constexpr VelocityValue FromMm (float v) noexcept
 

Public Attributes

float value {0.0f}
 Velocity magnitude.
 
Unit unit {Unit::Steps}
 Velocity unit.
 

Detailed Description

Self-describing velocity value with explicit unit.

Carries both the velocity value and its unit, eliminating ambiguity in configuration and ensuring proper unit conversions throughout the driver.

VelocityValue vel = {100.0f, Unit::RPM};
@ RPM
Revolutions per Minute (Velocity only, typically)
Self-describing velocity value with explicit unit.
Definition tmc51x0_types.hpp:1778
static constexpr VelocityValue FromRPM(float v) noexcept
Definition tmc51x0_types.hpp:1794

Constructor & Destructor Documentation

◆ VelocityValue() [1/2]

tmc51x0::VelocityValue::VelocityValue ( )
default

Default constructor.

◆ VelocityValue() [2/2]

constexpr tmc51x0::VelocityValue::VelocityValue ( float v,
Unit u )
inlineconstexprnoexcept

Construct with value and unit.

Member Function Documentation

◆ FromDeg()

static constexpr VelocityValue tmc51x0::VelocityValue::FromDeg ( float v)
inlinestaticconstexprnoexcept

◆ FromMm()

static constexpr VelocityValue tmc51x0::VelocityValue::FromMm ( float v)
inlinestaticconstexprnoexcept

◆ FromRad()

static constexpr VelocityValue tmc51x0::VelocityValue::FromRad ( float v)
inlinestaticconstexprnoexcept

◆ FromRevPerSec()

static constexpr VelocityValue tmc51x0::VelocityValue::FromRevPerSec ( float v)
inlinestaticconstexprnoexcept

◆ FromRPM()

static constexpr VelocityValue tmc51x0::VelocityValue::FromRPM ( float v)
inlinestaticconstexprnoexcept

◆ FromSteps()

static constexpr VelocityValue tmc51x0::VelocityValue::FromSteps ( float v)
inlinestaticconstexprnoexcept

Member Data Documentation

◆ unit

Unit tmc51x0::VelocityValue::unit {Unit::Steps}

Velocity unit.

◆ value

float tmc51x0::VelocityValue::value {0.0f}

Velocity magnitude.


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