ESPHome  2022.12.8
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:54
uint32_t IRAM_ATTR HOT micros()
Definition: core.cpp:28
uint32_t IRAM_ATTR HOT millis()
Definition: core.cpp:26
uint32_t arch_get_cpu_freq_hz()
Definition: core.cpp:66
enum esphome::EntityCategory __attribute__
void arch_restart()
Definition: core.cpp:30
uint8_t progmem_read_byte(const uint8_t *addr)
Definition: core.cpp:56
void IRAM_ATTR HOT yield()
Definition: core.cpp:25
Definition: a4988.cpp:4
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)
Definition: core.cpp:29
void arch_init()
Definition: core.cpp:38
uint32_t arch_get_cpu_cycle_count()
Definition: core.cpp:57
void IRAM_ATTR HOT delay(uint32_t ms)
Definition: core.cpp:27