ADS7952 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
ads7952_kconfig.hpp File Reference

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

#include "ads7952_types.hpp"

Go to the source code of this file.

Namespaces

namespace  ads7952
 The ADS7952 driver: everything it declares lives here; internals in detail.
 

Macros

#define CONFIG_ADS7952_VREF_MV   2500
 
#define CONFIG_ADS7952_VA_MIN_MV   5000
 

Functions

constexpr Config ads7952::KconfigDefaults () noexcept
 The configuration menuconfig selected, on top of the chosen part's reset state.
 

Detailed Description

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

Include this header only where you want menuconfig to choose the defaults; the driver never includes it and no driver signature depends on it. Under ESP-IDF the values come from sdkconfig.h. Without Kconfig every option falls back to the reset state of the chosen part, so KconfigDefaults() equals Config{}.

Kconfig writes a bool option set to "n" as an absent macro, so an absent CONFIG_ADS7952_RANGE_2VREF means Range 1 in both cases. GPIO and alarm settings are not Kconfig options: set them in the Config in code.

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 header includes this one (handbook KB-CPP20-018).

Macro Definition Documentation

◆ CONFIG_ADS7952_VA_MIN_MV

#define CONFIG_ADS7952_VA_MIN_MV   5000

Lowest guaranteed +VA in millivolts when Kconfig does not set it: Config{}.va_min_mv.

◆ CONFIG_ADS7952_VREF_MV

#define CONFIG_ADS7952_VREF_MV   2500

REFP in millivolts when Kconfig does not set it: Config{}.vref_mv.