ADS9324 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
ads9324_kconfig.hpp
Go to the documentation of this file.
1
24#ifndef ADS9324_KCONFIG_HPP
25#define ADS9324_KCONFIG_HPP
26
27#ifdef __has_include
28#if __has_include("sdkconfig.h")
29#include "sdkconfig.h"
30#endif
31#endif
32
33#include "ads9324_types.hpp"
34
35#ifndef CONFIG_ADS9324_CONVST_HZ
38#define CONFIG_ADS9324_CONVST_HZ 100000
39#endif
40#ifndef CONFIG_ADS9324_READY_TIMEOUT_US
43#define CONFIG_ADS9324_READY_TIMEOUT_US 10000
44#endif
45
46namespace ads9324 {
47
54constexpr Config KconfigDefaults() noexcept {
55 Config c{};
56 c.sampling.convst_hz = static_cast<uint32_t>(CONFIG_ADS9324_CONVST_HZ);
57 c.sampling.ready_timeout_us = static_cast<uint32_t>(CONFIG_ADS9324_READY_TIMEOUT_US);
58#if defined(CONFIG_ADS9324_WORD_24_BIT) && CONFIG_ADS9324_WORD_24_BIT
59 c.interface.length = WordLength::Bits24;
60#endif
61#if defined(CONFIG_ADS9324_APPEND_DIAG) && CONFIG_ADS9324_APPEND_DIAG
62 c.interface.append_diag = true;
63#endif
64#if defined(CONFIG_ADS9324_READY_ON_PIN) && CONFIG_ADS9324_READY_ON_PIN
65 c.sampling.ready = ReadySource::Pin;
66#endif
67 return c;
68}
69
70} // namespace ads9324
71
72#endif // ADS9324_KCONFIG_HPP
#define CONFIG_ADS9324_READY_TIMEOUT_US
Definition ads9324_kconfig.hpp:43
#define CONFIG_ADS9324_CONVST_HZ
Definition ads9324_kconfig.hpp:38
Public types of the ADS9324 driver: errors, Result<T>, enumerations, configuration,...
uint32_t convst_hz
CONVST frequency, 100 kHz to 1 MHz.
Definition ads9324_types.hpp:546
Sampling sampling
CONVST and ready wait.
Definition ads9324_types.hpp:620
@ Pin
Poll the DRDY/ALARM pin through GpioGet().
@ Bits24
24 bits: the result and an extra byte.
The ADS9324 driver: everything it declares lives here; internals in detail.
Definition ads9324.hpp:32
constexpr Config KconfigDefaults() noexcept
The configuration menuconfig selected, on top of the Config{} defaults.
Definition ads9324_kconfig.hpp:54
Everything EnsureInitialized() and ApplyConfig() write to the chip.
Definition ads9324_types.hpp:612