ESPHome  2024.10.2
hal.h
Go to the documentation of this file.
1 #pragma once
2 #include <string>
3 #include <cstdint>
4 #include "gpio.h"
5 
6 #if defined(USE_ESP32_FRAMEWORK_ESP_IDF)
7 #include <esp_attr.h>
8 #ifndef PROGMEM
9 #define PROGMEM
10 #endif
11 
12 #elif defined(USE_ESP32_FRAMEWORK_ARDUINO)
13 
14 #include <esp_attr.h>
15 
16 #ifndef PROGMEM
17 #define PROGMEM
18 #endif
19 
20 #elif defined(USE_ESP8266)
21 
22 #include <c_types.h>
23 #ifndef PROGMEM
24 #define PROGMEM ICACHE_RODATA_ATTR
25 #endif
26 
27 #else
28 
29 #define IRAM_ATTR
30 #define PROGMEM
31 
32 #endif
33 
34 namespace esphome {
35 
36 void yield();
37 uint32_t millis();
38 uint32_t micros();
39 void delay(uint32_t ms);
40 void delayMicroseconds(uint32_t us); // NOLINT(readability-identifier-naming)
41 void __attribute__((noreturn)) arch_restart();
42 void arch_init();
43 void arch_feed_wdt();
44 uint32_t arch_get_cpu_cycle_count();
45 uint32_t arch_get_cpu_freq_hz();
46 uint8_t progmem_read_byte(const uint8_t *addr);
47 
48 } // namespace esphome
void IRAM_ATTR HOT arch_feed_wdt()
Definition: core.cpp:53
uint32_t IRAM_ATTR HOT micros()
Definition: core.cpp:27
uint32_t IRAM_ATTR HOT millis()
Definition: core.cpp:25
uint32_t arch_get_cpu_freq_hz()
Definition: core.cpp:61
enum esphome::EntityCategory __attribute__
void arch_restart()
Definition: core.cpp:29
uint8_t progmem_read_byte(const uint8_t *addr)
Definition: core.cpp:55
void IRAM_ATTR HOT yield()
Definition: core.cpp:24
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)
Definition: core.cpp:28
void arch_init()
Definition: core.cpp:37
uint32_t arch_get_cpu_cycle_count()
Definition: core.cpp:57
void IRAM_ATTR HOT delay(uint32_t ms)
Definition: core.cpp:26