diff --git a/boards/common/esp32/include/periph_conf_common.h b/boards/common/esp32/include/periph_conf_common.h index c1d2bcb2c4946..2339148d7856a 100644 --- a/boards/common/esp32/include/periph_conf_common.h +++ b/boards/common/esp32/include/periph_conf_common.h @@ -123,6 +123,30 @@ extern "C" { * @name SPI configuration */ +/** + * @brief Static array with configuration for declared I2C devices + */ +static const spi_conf_t spi_config[] = { +#ifdef SPI0_CTRL + { + .ctrl = SPI0_CTRL, + .sck = SPI0_SCK, + .mosi = SPI0_MOSI, + .miso = SPI0_MISO, + .cs = SPI0_CS0, + }, +#endif +#ifdef SPI1_CTRL + { + .ctrl = SPI1_CTRL, + .sck = SPI1_SCK, + .mosi = SPI1_MOSI, + .miso = SPI1_MISO, + .cs = SPI1_CS0, + }, +#endif +}; + /** * @brief Number of SPI interfaces * @@ -131,7 +155,7 @@ extern "C" { * * @note SPI_NUMOF definition must not be changed. */ -#define SPI_NUMOF (spi_bus_num) +#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0])) /** @} */