TMC5160 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Namespaces | Functions
tmc5160_kconfig.hpp File Reference

Optional ESP-IDF layer: a Config built from the CONFIG_TMC5160_* Kconfig options. More...

#include "tmc5160_types.hpp"

Go to the source code of this file.

Namespaces

namespace  tmc5160
 The TMC5160 driver: everything it declares lives here; internals in detail.
 

Functions

constexpr Config tmc5160::KconfigDefaults () noexcept
 The configuration menuconfig selected.
 

Detailed Description

Optional ESP-IDF layer: a Config built from the CONFIG_TMC5160_* Kconfig options.

Include this header only where you want menuconfig to declare the motor and the power stage; the driver never includes it and no driver signature depends on it. Under ESP-IDF the values come from sdkconfig.h. Without Kconfig KconfigDefaults() equals Config{}, which Validate() rejects: the motor and the sense resistor have to be declared (design note, section 2.5).

Kconfig writes a bool option set to "n" as an absent macro, so an absent CONFIG_TMC5160_STEALTHCHOP means off in both cases.

One configuration per program: the inline function below depends on the CONFIG_ macros, so every translation unit of one program must see the same values (ESP-IDF has one sdkconfig.h per build; each host test is its own program). No driver or library header includes this one (handbook KB-CPP20-018).