From 61e1068eba8fc69f9fdb409d148dc6357bbf5586 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Mon, 25 Mar 2019 13:06:39 +0100 Subject: [PATCH] boards/nucleo-f767zi: Add SPI settings --- boards/nucleo-f767zi/Makefile.features | 1 + boards/nucleo-f767zi/include/periph_conf.h | 24 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/boards/nucleo-f767zi/Makefile.features b/boards/nucleo-f767zi/Makefile.features index bfff4d4a86..0c6484490e 100644 --- a/boards/nucleo-f767zi/Makefile.features +++ b/boards/nucleo-f767zi/Makefile.features @@ -2,6 +2,7 @@ FEATURES_PROVIDED += periph_dma FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_rtc +FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart diff --git a/boards/nucleo-f767zi/include/periph_conf.h b/boards/nucleo-f767zi/include/periph_conf.h index 1defdc6534..0728ec4990 100644 --- a/boards/nucleo-f767zi/include/periph_conf.h +++ b/boards/nucleo-f767zi/include/periph_conf.h @@ -24,6 +24,7 @@ #include "periph_cpu.h" #include "f7/cfg_clock_216_8_1.h" #include "cfg_i2c1_pb8_pb9.h" +#include "cfg_spi_divtable.h" #ifdef __cplusplus extern "C" { @@ -123,6 +124,29 @@ static const uart_conf_t uart_config[] = { #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0])) /** @} */ +/** + * @name SPI configuration + * + * @note The spi_divtable is auto-generated from + * `cpu/stm32_common/dist/spi_divtable/spi_divtable.c` + * @{ + */ +static const spi_conf_t spi_config[] = { + { + .dev = SPI1, + .mosi_pin = GPIO_PIN(PORT_A, 7), + .miso_pin = GPIO_PIN(PORT_A, 6), + .sclk_pin = GPIO_PIN(PORT_A, 5), + .cs_pin = GPIO_UNDEF, + .af = GPIO_AF5, + .rccmask = RCC_APB2ENR_SPI1EN, + .apbbus = APB2 + }, +}; + +#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0])) +/** @} */ + #ifdef __cplusplus } #endif