From 7f68acbd0b245544b5ec67f6eb24b1611b3650d9 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Thu, 10 Oct 2024 10:18:18 +0200 Subject: [PATCH] boards/adafruit-grand-central-m4-express: provide arduino features The board is compatible with Arduino UNO and Arduino MEGA shields and has an ISP connector, so this adds the corresponding features. This adds the Arduino I/O-mapping for the ISP SPI and provides the corresponding feature. It appears that the SPI on D11/D12/D13 cannot be provided by a SERCOM, this is under clarification at [1]. For now, no I/O mapping for that SPI bus is provided. [1]: https://forums.adafruit.com/viewtopic.php?t=214093 --- .../Makefile.features | 4 ++++ .../include/arduino_iomap.h | 10 ++++++++++ .../include/periph_conf.h | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/boards/adafruit-grand-central-m4-express/Makefile.features b/boards/adafruit-grand-central-m4-express/Makefile.features index e4cbb709d7f2..8bb4a070c58a 100644 --- a/boards/adafruit-grand-central-m4-express/Makefile.features +++ b/boards/adafruit-grand-central-m4-express/Makefile.features @@ -17,4 +17,8 @@ FEATURES_PROVIDED += periph_usbdev # other board features FEATURES_PROVIDED += arduino_analog FEATURES_PROVIDED += arduino_pins +FEATURES_PROVIDED += arduino_shield_isp +FEATURES_PROVIDED += arduino_shield_mega +FEATURES_PROVIDED += arduino_shield_uno +FEATURES_PROVIDED += arduino_spi FEATURES_PROVIDED += sdcard_spi diff --git a/boards/adafruit-grand-central-m4-express/include/arduino_iomap.h b/boards/adafruit-grand-central-m4-express/include/arduino_iomap.h index 7740dcf795ac..135d8e9d28a5 100644 --- a/boards/adafruit-grand-central-m4-express/include/arduino_iomap.h +++ b/boards/adafruit-grand-central-m4-express/include/arduino_iomap.h @@ -85,6 +85,16 @@ extern "C" { #define ARDUINO_ANALOG_PIN_LAST 5 /** @} */ +/** + * @name Arduino's default SPI device + * @{ + */ +/** + * @brief SPI_DEV(0) is connected to the ISP header *AND* the SD card reader + */ +#define ARDUINO_SPI_ISP SPI_DEV(0) +/** @} */ + #ifdef __cplusplus } #endif diff --git a/boards/adafruit-grand-central-m4-express/include/periph_conf.h b/boards/adafruit-grand-central-m4-express/include/periph_conf.h index cd12c6e44e2b..cba05f74528f 100644 --- a/boards/adafruit-grand-central-m4-express/include/periph_conf.h +++ b/boards/adafruit-grand-central-m4-express/include/periph_conf.h @@ -204,7 +204,7 @@ static const tc32_conf_t timer_config[] = { * @{ */ static const spi_conf_t spi_config[] = { - { /* SPI on XIO connector */ + { /* SPI on XIO connector *AND* SPI on ISP */ .dev = &(SERCOM7->SPI), .miso_pin = GPIO_PIN(PD, 11), /* D50 MISO */ .mosi_pin = GPIO_PIN(PD, 8), /* D51 MOSI */