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

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

#include "sfm_flow_meter_types.hpp"

Go to the source code of this file.

Namespaces

namespace  sfm
 The SFM flow meter driver: everything it declares lives here; internals in detail.
 

Macros

#define CONFIG_SFM_FLOW_METER_AVERAGING   (-1)
 
#define CONFIG_SFM_FLOW_METER_ERROR_LIMIT   5
 

Functions

constexpr Config sfm::KconfigDefaults () noexcept
 The configuration menuconfig selected, on top of the datasheet defaults.
 

Detailed Description

Optional ESP-IDF layer: a Config built from the CONFIG_SFM_FLOW_METER_* 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 datasheet default, so KconfigDefaults() equals Config{}. The variant and the address are not options: they name the part, so the application sets them (PresetFor()).

Kconfig writes a bool option set to "n" as an absent macro, so every bool option here is off by default and an absent macro 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).

Macro Definition Documentation

◆ CONFIG_SFM_FLOW_METER_AVERAGING

#define CONFIG_SFM_FLOW_METER_AVERAGING   (-1)

Averaging when Kconfig does not set it: -1, the family's reset value.

◆ CONFIG_SFM_FLOW_METER_ERROR_LIMIT

#define CONFIG_SFM_FLOW_METER_ERROR_LIMIT   5

Errors in a row before an SF05-family hard reset when Kconfig does not set it.