TLE92466ED Driver 0.1.0
API reference
Loading...
Searching...
No Matches
tle92466ed_kconfig.hpp
Go to the documentation of this file.
1
22#ifndef TLE92466ED_KCONFIG_HPP
23#define TLE92466ED_KCONFIG_HPP
24
25#ifdef __has_include
26#if __has_include("sdkconfig.h")
27#include "sdkconfig.h"
28#endif
29#endif
30
31#include "tle92466ed_types.hpp"
32
33#ifndef CONFIG_TLE92466ED_WATCHDOG_TIMEOUT_MS
35#define CONFIG_TLE92466ED_WATCHDOG_TIMEOUT_MS 100
36#endif
37#ifndef CONFIG_TLE92466ED_EXTERNAL_CLOCK_KHZ
39#define CONFIG_TLE92466ED_EXTERNAL_CLOCK_KHZ 0
40#endif
41#ifndef CONFIG_TLE92466ED_INIT_TIMEOUT_US
43#define CONFIG_TLE92466ED_INIT_TIMEOUT_US 10000
44#endif
45#ifndef CONFIG_TLE92466ED_MAX_RETRIES
47#define CONFIG_TLE92466ED_MAX_RETRIES 2
48#endif
49
50namespace tle92466ed {
51
58constexpr Config KconfigDefaults() noexcept {
59 Config c{};
60#if defined(CONFIG_TLE92466ED_VIO_3V3) && CONFIG_TLE92466ED_VIO_3V3
62#endif
63#if defined(CONFIG_TLE92466ED_CRC_CHECK_DISABLE) && CONFIG_TLE92466ED_CRC_CHECK_DISABLE
64 c.crc_check = false;
65#endif
66 constexpr uint32_t kClockKhz = CONFIG_TLE92466ED_EXTERNAL_CLOCK_KHZ;
67 if constexpr (kClockKhz != 0U) {
68 c.clock = ClockSource::External;
69 c.external_clock_khz = kClockKhz;
70 }
71#if defined(CONFIG_TLE92466ED_SPI_WATCHDOG) && CONFIG_TLE92466ED_SPI_WATCHDOG
72 c.spi_watchdog = true;
73 c.watchdog_reload =
75#endif
76 c.init_timeout_us = CONFIG_TLE92466ED_INIT_TIMEOUT_US;
77 c.max_retries = static_cast<uint8_t>(CONFIG_TLE92466ED_MAX_RETRIES);
78 return c;
79}
80
81} // namespace tle92466ed
82
83#endif // TLE92466ED_KCONFIG_HPP
constexpr Result< uint16_t > WatchdogReloadCode(uint32_t timeout_ms, uint32_t system_hz) noexcept
WD_TIME for a watchdog timeout: rounddown(t_SPI_WD * f_SYS / 2^14) (5.3.2.11).
Definition tle92466ed_types.hpp:763
constexpr uint32_t SystemClockHz(const Config &config) noexcept
f_SYS for a configuration: 28 MHz from the internal oscillator, else f_CLK * PLL_FBDIV / (2 * PLL_REF...
Definition tle92466ed_types.hpp:693
@ V3V3
3.3 V: VIO monitored against the 3.3 V thresholds (Table 9).
@ External
The CLK pin, Config::external_clock_khz.
The TLE92466ED driver: everything it declares lives here; internals in detail.
Definition tle92466ed.hpp:26
constexpr Config KconfigDefaults() noexcept
The configuration menuconfig selected, on top of the datasheet defaults.
Definition tle92466ed_kconfig.hpp:58
Everything EnsureInitialized() writes to the chip, and the driver's own settings.
Definition tle92466ed_types.hpp:382
VioLevel vio
Definition tle92466ed_types.hpp:383
#define CONFIG_TLE92466ED_INIT_TIMEOUT_US
Definition tle92466ed_kconfig.hpp:43
#define CONFIG_TLE92466ED_MAX_RETRIES
Definition tle92466ed_kconfig.hpp:47
#define CONFIG_TLE92466ED_WATCHDOG_TIMEOUT_MS
Definition tle92466ed_kconfig.hpp:35
#define CONFIG_TLE92466ED_EXTERNAL_CLOCK_KHZ
Definition tle92466ed_kconfig.hpp:39
Public types of the TLE92466ED driver: errors, Result<T>, configuration, decoded status and feedback,...