1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

boards/common: add common board definitions for ESP32-H2

This commit is contained in:
Gunar Schorcht 2025-03-27 08:57:15 +01:00
parent bdc0a0bdae
commit 4326d1b685
10 changed files with 167 additions and 5 deletions

View File

@ -0,0 +1,11 @@
# Copyright (c) 2025 Gunar Schorcht
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
config BOARD_COMMON_ESP32H2
bool
select BOARD_COMMON_ESP32X
source "$(RIOTBOARD)/common/esp32x/Kconfig"

View File

@ -0,0 +1,5 @@
MODULE = boards_common_esp32h2
DIRS = $(RIOTBOARD)/common/esp32x
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,3 @@
USEMODULE += boards_common_esp32h2
include $(RIOTBOARD)/common/esp32x/Makefile.dep

View File

@ -0,0 +1,3 @@
CPU_FAM = esp32h2
include $(RIOTBOARD)/common/esp32x/Makefile.features

View File

@ -0,0 +1,3 @@
INCLUDES += -I$(RIOTBOARD)/common/esp32h2/include
include $(RIOTBOARD)/common/esp32x/Makefile.include

View File

@ -0,0 +1,23 @@
<!--
Copyright (C) 2025 Gunar Schorcht
This file is subject to the terms and conditions of the GNU Lesser
General Public License v2.1. See the file LICENSE in the top level
directory for more details.
-->
@defgroup boards_common_esp32h2 ESP32-H2 Common
@ingroup boards_common
@ingroup boards_esp32h2
@brief Definitions and configurations that are common for all ESP32-H2 boards.
For detailed information about the ESP32-H2, configuring and compiling RIOT
for ESP32-H2 boards, please refer to \ref esp32_riot.
@defgroup boards_esp32h2 ESP32-H2 Boards
@ingroup boards
@brief This group of boards contains the documentation of ESP32-H2 boards.
@note For detailed information about the ESP32-H2 SoC, the tool chain
as well as configuring and compiling RIOT for ESP32-H2 boards,
see \ref esp32_riot.

View File

@ -0,0 +1,63 @@
/*
* Copyright (C) 2025 Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
#pragma once
/**
* @ingroup boards_common_esp32h2
* @brief Board definitions that are common for all ESP32-H2 boards.
*
* This file contains board configurations that are valid for all ESP32-H2.
*
* For detailed information about the configuration of ESP32-H2 boards, see
* section \ref esp32_peripherals "Common Peripherals".
*
* @author Gunar Schorcht <gunar@schorcht.net>
* @file
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
#if !DOXYGEN
/**
* @name ztimer Configuration valid for all ESP32-H2 boards
* @{
*/
#if CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 96
# define CONFIG_ZTIMER_USEC_ADJUST_SET 14
# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 13
#elif CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 64
# define CONFIG_ZTIMER_USEC_ADJUST_SET 19
# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 18
#elif CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 48
# define CONFIG_ZTIMER_USEC_ADJUST_SET 34
# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 32
#elif CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 32
# define CONFIG_ZTIMER_USEC_ADJUST_SET 32
# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 33
#elif CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ == 16
# define CONFIG_ZTIMER_USEC_ADJUST_SET 129
# define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 135
#else
# error "Invalid CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ value"
#endif
/** @} */
#endif /* !DOXYGEN */
#ifdef __cplusplus
} /* end extern "C" */
#endif
/** @} */

View File

@ -0,0 +1,47 @@
/*
* Copyright (C) 2025 Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
#pragma once
/**
* @ingroup boards_common_esp32h2
* @brief Common peripheral configurations for ESP32-H2 boards
*
* This file contains the peripheral configurations that are valid for all
* ESP32-H2 boards.
*
* For detailed information about the peripheral configuration for ESP32-H2
* boards, see section \ref esp32_peripherals "Common Peripherals".
*
* @author Gunar Schorcht <gunar@schorcht.net>
* @file
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name UART configuration
* @{
*/
#ifndef UART0_TXD
# define UART0_TXD (GPIO24) /**< TxD of UART_DEV(0) used on all ESP32-H2 boards */
#endif
#ifndef UART0_RXD
# define UART0_RXD (GPIO23) /**< RxD of UART_DEV(0) used on all ESP32-H2 boards */
#endif
/** @} */
#ifdef __cplusplus
} /* end extern "C" */
#endif
/** @} */

View File

@ -38,6 +38,8 @@
# include "board_common_esp32.h"
#elif defined(CPU_FAM_ESP32C3)
# include "board_common_esp32c3.h"
#elif defined(CPU_FAM_ESP32H2)
# include "board_common_esp32h2.h"
#elif defined(CPU_FAM_ESP32S2)
# include "board_common_esp32s2.h"
#elif defined(CPU_FAM_ESP32S3)

View File

@ -24,15 +24,17 @@
*/
#if defined(CPU_FAM_ESP32)
#include "periph_conf_common_esp32.h"
# include "periph_conf_common_esp32.h"
#elif defined(CPU_FAM_ESP32C3)
#include "periph_conf_common_esp32c3.h"
# include "periph_conf_common_esp32c3.h"
#elif defined(CPU_FAM_ESP32H2)
# include "periph_conf_common_esp32h2.h"
#elif defined(CPU_FAM_ESP32S2)
#include "periph_conf_common_esp32s2.h"
# include "periph_conf_common_esp32s2.h"
#elif defined(CPU_FAM_ESP32S3)
#include "periph_conf_common_esp32s3.h"
# include "periph_conf_common_esp32s3.h"
#else
#error "ESP32x SoC family not supported"
# error "ESP32x SoC family not supported"
#endif
/* include periph_cpu.h to make it visible in any case */