|
| 1 | +/* |
| 2 | + * Copyright (C) 2025 Gunar Schorcht |
| 3 | + * |
| 4 | + * This file is subject to the terms and conditions of the GNU Lesser |
| 5 | + * General Public License v2.1. See the file LICENSE in the top level |
| 6 | + * directory for more details. |
| 7 | + */ |
| 8 | + |
| 9 | +#pragma once |
| 10 | + |
| 11 | +/** |
| 12 | + * @ingroup boards_common_esp32h2 |
| 13 | + * @brief Board definitions that are common for all ESP32-H2 boards. |
| 14 | + * |
| 15 | + * This file contains board configurations that are valid for all ESP32-H2. |
| 16 | + * |
| 17 | + * For detailed information about the configuration of ESP32-H2 boards, see |
| 18 | + * section \ref esp32_peripherals "Common Peripherals". |
| 19 | + * |
| 20 | + * @author Gunar Schorcht <[email protected]> |
| 21 | + * @file |
| 22 | + * @{ |
| 23 | + */ |
| 24 | + |
| 25 | +#ifdef __cplusplus |
| 26 | +extern "C" { |
| 27 | +#endif |
| 28 | + |
| 29 | +#if !DOXYGEN |
| 30 | + |
| 31 | +/** |
| 32 | + * @name ztimer Configuration valid for all ESP32-H2 boards |
| 33 | + * @{ |
| 34 | + */ |
| 35 | + |
| 36 | +#if CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 96 |
| 37 | +# define CONFIG_ZTIMER_USEC_ADJUST_SET 14 |
| 38 | +# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 13 |
| 39 | +#elif CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 64 |
| 40 | +# define CONFIG_ZTIMER_USEC_ADJUST_SET 19 |
| 41 | +# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 18 |
| 42 | +#elif CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 48 |
| 43 | +# define CONFIG_ZTIMER_USEC_ADJUST_SET 34 |
| 44 | +# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 32 |
| 45 | +#elif CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 32 |
| 46 | +# define CONFIG_ZTIMER_USEC_ADJUST_SET 32 |
| 47 | +# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 33 |
| 48 | +#elif CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 16 |
| 49 | +# define CONFIG_ZTIMER_USEC_ADJUST_SET 129 |
| 50 | +# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 135 |
| 51 | +#else |
| 52 | +# error "Invalid CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ value" |
| 53 | +#endif |
| 54 | + |
| 55 | +/** @} */ |
| 56 | + |
| 57 | +#endif /* !DOXYGEN */ |
| 58 | + |
| 59 | +#ifdef __cplusplus |
| 60 | +} /* end extern "C" */ |
| 61 | +#endif |
| 62 | + |
| 63 | +/** @} */ |
0 commit comments