AT25040B Driver 0.1.0
API reference
Loading...
Searching...
No Matches
at25040b_kconfig.hpp
Go to the documentation of this file.
1
21#ifndef AT25040B_KCONFIG_HPP
22#define AT25040B_KCONFIG_HPP
23
24#ifdef __has_include
25#if __has_include("sdkconfig.h")
26#include "sdkconfig.h"
27#endif
28#endif
29
30#include "at25040b_types.hpp"
31
32#ifndef CONFIG_AT25040B_WRITE_TIMEOUT_US
35#define CONFIG_AT25040B_WRITE_TIMEOUT_US 10000
36#endif
37
38namespace at25040b {
39
44constexpr Config KconfigDefaults() noexcept {
45 Config c{};
46#ifdef CONFIG_AT25040B_VARIANT_AT25010B
48#elif defined(CONFIG_AT25040B_VARIANT_AT25020B)
49 c.variant = Variant::At25020b;
50#else
51 c.variant = Variant::At25040b;
52#endif
53#if defined(CONFIG_AT25040B_SKIP_WRITE_ENABLE_CHECK) && CONFIG_AT25040B_SKIP_WRITE_ENABLE_CHECK
54 c.check_write_enable = false;
55#endif
56 c.write_timeout_us = CONFIG_AT25040B_WRITE_TIMEOUT_US;
57 return c;
58}
59
60} // namespace at25040b
61
62#endif // AT25040B_KCONFIG_HPP
#define CONFIG_AT25040B_WRITE_TIMEOUT_US
Definition at25040b_kconfig.hpp:35
Public types of the AT25040B driver: errors, Result<T>, variants, block protection and configuration.
@ At25040b
512 bytes (4 Kbit), A8 in the opcode. The default.
@ At25020b
256 bytes (2 Kbit).
@ At25010b
128 bytes (1 Kbit).
The AT25040B driver: everything it declares lives here; internals in detail.
Definition at25040b.hpp:30
constexpr Config KconfigDefaults() noexcept
The configuration menuconfig selected.
Definition at25040b_kconfig.hpp:44
What the driver is told about the board. The chip itself has nothing to configure: its only setting,...
Definition at25040b_types.hpp:361
Variant variant
Definition at25040b_types.hpp:362