Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions boards/common/esp32h2/Kconfig
Original file line number Diff line number Diff line change
@@ -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"
5 changes: 5 additions & 0 deletions boards/common/esp32h2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MODULE = boards_common_esp32h2

DIRS = $(RIOTBOARD)/common/esp32x

include $(RIOTBASE)/Makefile.base
3 changes: 3 additions & 0 deletions boards/common/esp32h2/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
USEMODULE += boards_common_esp32h2

include $(RIOTBOARD)/common/esp32x/Makefile.dep
3 changes: 3 additions & 0 deletions boards/common/esp32h2/Makefile.features
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CPU_FAM = esp32h2

include $(RIOTBOARD)/common/esp32x/Makefile.features
3 changes: 3 additions & 0 deletions boards/common/esp32h2/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INCLUDES += -I$(RIOTBOARD)/common/esp32h2/include

include $(RIOTBOARD)/common/esp32x/Makefile.include
23 changes: 23 additions & 0 deletions boards/common/esp32h2/doc.md
Original file line number Diff line number Diff line change
@@ -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.
63 changes: 63 additions & 0 deletions boards/common/esp32h2/include/board_common_esp32h2.h
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
* @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

/** @} */
47 changes: 47 additions & 0 deletions boards/common/esp32h2/include/periph_conf_common_esp32h2.h
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
* @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

/** @} */
2 changes: 2 additions & 0 deletions boards/common/esp32x/include/board_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 7 additions & 5 deletions boards/common/esp32x/include/periph_conf_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
16 changes: 16 additions & 0 deletions boards/esp32h2-devkit/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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
default "esp32h2-devkit" if BOARD_ESP32H2_DEVKIT

config BOARD_ESP32H2_DEVKIT
bool
default y
select BOARD_COMMON_ESP32H2
select CPU_MODEL_ESP32H2_MINI_1X_H4S

source "$(RIOTBOARD)/common/esp32h2/Kconfig"
5 changes: 5 additions & 0 deletions boards/esp32h2-devkit/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MODULE = board

DIRS = $(RIOTBOARD)/common/esp32h2

include $(RIOTBASE)/Makefile.base
5 changes: 5 additions & 0 deletions boards/esp32h2-devkit/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include $(RIOTBOARD)/common/esp32h2/Makefile.dep

ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
20 changes: 20 additions & 0 deletions boards/esp32h2-devkit/Makefile.features
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
CPU_MODEL = esp32h2_mini_1x_h4s

# common board and CPU features
include $(RIOTBOARD)/common/esp32h2/Makefile.features

# additional features provided by the board
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_spi

# unique features provided by the board
FEATURES_PROVIDED += esp_jtag

FEATURES_PROVIDED += arduino_analog
FEATURES_PROVIDED += arduino_i2c
FEATURES_PROVIDED += arduino_pins
FEATURES_PROVIDED += arduino_pwm
FEATURES_PROVIDED += arduino_spi
FEATURES_PROVIDED += arduino_uart
5 changes: 5 additions & 0 deletions boards/esp32h2-devkit/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include $(RIOTBOARD)/common/esp32h2/Makefile.include

# Only consider TTYs matching the following filter when auto-selecting the TTY
# with `MOST_RECENT_PORT=1`.
TTY_BOARD_FILTER := --driver 'cp210x' --vendor 'Silicon Labs' --model 'CP2102N USB to UART Bridge Controller'
Loading
Loading