diff --git a/cpu/esp32/include/periph_cpu_esp32.h b/cpu/esp32/include/periph_cpu_esp32.h index 98fe0a3a91..e31b629836 100644 --- a/cpu/esp32/include/periph_cpu_esp32.h +++ b/cpu/esp32/include/periph_cpu_esp32.h @@ -28,6 +28,11 @@ extern "C" { /** Mapping configured ESP32 default clock to CLOCK_CORECLOCK define */ #define CLOCK_CORECLOCK (1000000UL * CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ) +/** + * @brief CPU cycles per busy wait loop + */ +#define CPU_CYCLES_PER_LOOP (6) + /** * @name Predefined GPIO names * @{ diff --git a/cpu/esp32/include/periph_cpu_esp32c3.h b/cpu/esp32/include/periph_cpu_esp32c3.h index e2b243280a..874ca9ce6d 100644 --- a/cpu/esp32/include/periph_cpu_esp32c3.h +++ b/cpu/esp32/include/periph_cpu_esp32c3.h @@ -28,6 +28,11 @@ extern "C" { /** Mapping configured ESP32-C3 default clock to CLOCK_CORECLOCK define */ #define CLOCK_CORECLOCK (1000000UL * CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ) +/** + * @brief CPU cycles per busy wait loop + */ +#define CPU_CYCLES_PER_LOOP (4) + /** * @name Predefined GPIO names * @{ diff --git a/cpu/esp32/include/periph_cpu_esp32s2.h b/cpu/esp32/include/periph_cpu_esp32s2.h index 941940bfcf..1e1cdddda2 100644 --- a/cpu/esp32/include/periph_cpu_esp32s2.h +++ b/cpu/esp32/include/periph_cpu_esp32s2.h @@ -28,6 +28,11 @@ extern "C" { /** Mapping configured ESP32-S2 default clock to CLOCK_CORECLOCK define */ #define CLOCK_CORECLOCK (1000000UL * CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ) +/** + * @brief CPU cycles per busy wait loop + */ +#define CPU_CYCLES_PER_LOOP (6) + /** * @name Predefined GPIO names * @{ diff --git a/cpu/esp32/include/periph_cpu_esp32s3.h b/cpu/esp32/include/periph_cpu_esp32s3.h index 85ab49965c..c9aaccb8a9 100644 --- a/cpu/esp32/include/periph_cpu_esp32s3.h +++ b/cpu/esp32/include/periph_cpu_esp32s3.h @@ -19,13 +19,18 @@ #ifndef PERIPH_CPU_ESP32S3_H #define PERIPH_CPU_ESP32S3_H -/** Mapping configured ESP32-S3 default clock to CLOCK_CORECLOCK define */ -#define CLOCK_CORECLOCK (1000000UL * CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ) - #ifdef __cplusplus extern "C" { #endif +/** Mapping configured ESP32-S3 default clock to CLOCK_CORECLOCK define */ +#define CLOCK_CORECLOCK (1000000UL * CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ) + +/** + * @brief CPU cycles per busy wait loop + */ +#define CPU_CYCLES_PER_LOOP (5) + /** * @name Predefined GPIO names * @{