ESPHome 2026.8.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
15 uint32_t nvs_handle{0}; // NVS (flash) path
16 uint16_t rtc_offset{0}; // RTC path: word offset into the RTC storage region
17 uint8_t length_words{0}; // RTC path: data length in 32-bit words
18 bool in_flash{true}; // true: store in NVS (flash); false: store in RTC memory
19};
20
23
24} // namespace esphome::esp32
25
26namespace esphome {
28} // namespace esphome
29
30#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:64
static void uint32_t