From 0dba3835d3f5036c192d214734fed1175d9d266a Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Thu, 21 Nov 2024 20:26:01 +0100 Subject: [PATCH 1/2] boards/adafruit-metro-m4-express: Add I2C and UART Mapping The M4 Express does now have an I2C and an UART compatible with Arduino Shields, so we can expose them. --- .../Makefile.features | 2 ++ .../include/arduino_iomap.h | 20 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/boards/adafruit-metro-m4-express/Makefile.features b/boards/adafruit-metro-m4-express/Makefile.features index acf8475c3f..12c7dab83d 100644 --- a/boards/adafruit-metro-m4-express/Makefile.features +++ b/boards/adafruit-metro-m4-express/Makefile.features @@ -19,3 +19,5 @@ FEATURES_PROVIDED += arduino_pins FEATURES_PROVIDED += arduino_shield_isp FEATURES_PROVIDED += arduino_shield_uno FEATURES_PROVIDED += arduino_spi +FEATURES_PROVIDED += arduino_i2c +FEATURES_PROVIDED += arduino_uart diff --git a/boards/adafruit-metro-m4-express/include/arduino_iomap.h b/boards/adafruit-metro-m4-express/include/arduino_iomap.h index ea620075d5..c12257e23f 100644 --- a/boards/adafruit-metro-m4-express/include/arduino_iomap.h +++ b/boards/adafruit-metro-m4-express/include/arduino_iomap.h @@ -106,10 +106,28 @@ extern "C" { * SPI bus. */ #if !MODULE_PERIPH_UART -# define ARDUINO_SPI_D11D12D13 SPI_DEV(1) +# define ARDUINO_SPI_D11D12D13 SPI_DEV(1) #endif /** @} */ +/** + * @name Arduino's UART devices + * @{ + */ +#define ARDUINO_UART_D0D1 UART_DEV(0) +/** @} */ + +/** + * @name Arduino's I2C buses + * @{ + */ +/** + * @brief The first I2C bus is where shields for the Arduino UNO/Mega expect + * it + */ +#define ARDUINO_I2C_UNO I2C_DEV(0) +/** @} */ + #ifdef __cplusplus } #endif From 567d0441a05c2523664b736851943d2fd6bfdbd8 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Fri, 22 Nov 2024 14:36:41 +0100 Subject: [PATCH 2/2] boards/adafruit-metro-m4-express: improve TTY detection Also detect TTY of bootloader with `MOST_RECENT_PORT=1`. --- boards/adafruit-metro-m4-express/Makefile.include | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boards/adafruit-metro-m4-express/Makefile.include b/boards/adafruit-metro-m4-express/Makefile.include index d9b879af10..bf9a2d4f0a 100644 --- a/boards/adafruit-metro-m4-express/Makefile.include +++ b/boards/adafruit-metro-m4-express/Makefile.include @@ -1,5 +1,7 @@ CFLAGS += -DBOOTLOADER_UF2 +PROG_TTY_BOARD_FILTER := --vendor 'Adafruit Industries' --model 'Metro M4 Express' + # Include all definitions for flashing with bossa other USB include $(RIOTBOARD)/common/samdx1-arduino-bootloader/Makefile.include # Include handling of serial and non-bossa programmers (if selected by user)