ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
preference_backend.h
Go to the documentation of this file.
1#pragma once
2#ifdef USE_ESP32
3
4#include <cstddef>
5#include <cstdint>
6
7namespace esphome::esp32 {
8
10 public:
11 bool save(const uint8_t *data, size_t len);
12 bool load(uint8_t *data, size_t len);
13 bool sync();
14
16 uint32_t nvs_handle{0}; // NVS (flash) path
17 uint16_t rtc_offset{0}; // RTC path: word offset into the RTC storage region
18 uint8_t length_words{0}; // RTC path: data length in 32-bit words
19 bool in_flash{true}; // true: store in NVS (flash); false: store in RTC memory
20};
21
24
25} // namespace esphome::esp32
26
27namespace esphome {
29} // namespace esphome
30
31#endif // USE_ESP32
bool load(uint8_t *data, size_t len)
bool save(const uint8_t *data, size_t len)
ESP32Preferences * get_preferences()
const void size_t len
Definition hal.h:68
static void uint32_t