ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esp32_ulp.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_ESP32
4
6
7#include <soc/soc_caps.h>
8#if SOC_LP_CORE_SUPPORTED
9#include <ulp_lp_core.h>
10#endif
11
12namespace esphome::esp32_ulp {
13
14class ESP32ULP : public Component {
15 public:
16 void setup() override;
17 void dump_config() override;
18 float get_setup_priority() const override { return setup_priority::HARDWARE; }
19
20 void set_wakeup_period(uint32_t period_us) { this->wakeup_period_us_ = period_us; }
21 void set_run_on_boot(bool run) { this->run_on_boot_ = run; }
22 void set_wakeup_from_sleep(bool enable) { this->wakeup_from_sleep_ = enable; }
23#if SOC_LP_CORE_SUPPORTED
24 void set_wakeup_sources(uint32_t sources) { this->wakeup_sources_ = sources; }
25#endif
26
28 bool load_and_run();
30 void timer_stop();
32 void timer_resume();
33
34 protected:
35 bool run_();
36
38#if SOC_LP_CORE_SUPPORTED
40#endif
41 bool run_on_boot_{true};
43 bool loaded_{false};
44};
45
46} // namespace esphome::esp32_ulp
47
48#endif // USE_ESP32
float get_setup_priority() const override
Definition esp32_ulp.h:18
void timer_resume()
Resume the coprocessor timer.
bool load_and_run()
Load the embedded program into the coprocessor memory and start it.
Definition esp32_ulp.cpp:75
void set_wakeup_period(uint32_t period_us)
Definition esp32_ulp.h:20
void set_wakeup_from_sleep(bool enable)
Definition esp32_ulp.h:22
void timer_stop()
Stop the coprocessor timer so the program is not started again.
void set_run_on_boot(bool run)
Definition esp32_ulp.h:21
void dump_config() override
Definition esp32_ulp.cpp:62
void set_wakeup_sources(uint32_t sources)
Definition esp32_ulp.h:24
constexpr float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Definition component.h:43
static void uint32_t