ESPHome
2026.5.0-dev
Loading...
Searching...
No Matches
esphome
components
rp2040
preferences.h
Go to the documentation of this file.
1
#pragma once
2
#ifdef USE_RP2040
3
4
#include "
esphome/core/preference_backend.h
"
5
6
namespace
esphome::rp2040
{
7
8
class
RP2040Preferences
final :
public
PreferencesMixin
<RP2040Preferences> {
9
public
:
10
using
PreferencesMixin
<
RP2040Preferences
>
::make_preference
;
11
RP2040Preferences
();
12
void
setup
();
13
ESPPreferenceObject
make_preference
(
size_t
length
,
uint32_t
type
,
bool
in_flash) {
14
return
this->
make_preference
(length,
type
);
15
}
16
ESPPreferenceObject
make_preference
(
size_t
length
,
uint32_t
type
);
17
bool
sync
();
18
bool
reset
();
19
20
uint32_t
current_flash_offset
= 0;
21
22
protected
:
23
uint8_t *
eeprom_sector_
;
24
};
25
26
void
setup_preferences
();
27
void
preferences_prevent_write
(
bool
prevent);
28
29
}
// namespace esphome::rp2040
30
31
DECLARE_PREFERENCE_ALIASES(
esphome::rp2040::RP2040Preferences
)
32
33
#endif
// USE_RP2040
esphome::ESPPreferenceObject
Definition
preference_backend.h:38
esphome::PreferencesMixin
CRTP mixin providing type-safe template make_preference<T>() helpers.
Definition
preference_backend.h:61
esphome::rp2040::RP2040Preferences
Definition
preferences.h:8
esphome::rp2040::RP2040Preferences::setup
void setup()
Definition
preferences.cpp:85
esphome::rp2040::RP2040Preferences::make_preference
ESPPreferenceObject make_preference(size_t length, uint32_t type, bool in_flash)
Definition
preferences.h:13
esphome::rp2040::RP2040Preferences::RP2040Preferences
RP2040Preferences()
Definition
preferences.cpp:83
esphome::rp2040::RP2040Preferences::current_flash_offset
uint32_t current_flash_offset
Definition
preferences.h:20
esphome::rp2040::RP2040Preferences::reset
bool reset()
Definition
preferences.cpp:124
esphome::rp2040::RP2040Preferences::eeprom_sector_
uint8_t * eeprom_sector_
Definition
preferences.h:23
esphome::rp2040::RP2040Preferences::sync
bool sync()
Definition
preferences.cpp:103
preference_backend.h
type
uint16_t type
Definition
dns_server_esp32_idf.cpp:0
esphome::rp2040
Definition
core.h:11
esphome::rp2040::setup_preferences
void setup_preferences()
Definition
preferences.cpp:140
esphome::rp2040::preferences_prevent_write
void preferences_prevent_write(bool prevent)
Definition
preferences.cpp:144
uint32_t
static void uint32_t
Definition
crash_handler.cpp:141
length
uint16_t length
Definition
tt21100.cpp:0
Generated by
1.12.0