diff --git a/boards/nrf5340dk-app/Makefile.features b/boards/nrf5340dk-app/Makefile.features index b4a32a3960..eb0d243827 100644 --- a/boards/nrf5340dk-app/Makefile.features +++ b/boards/nrf5340dk-app/Makefile.features @@ -2,8 +2,10 @@ CPU_MODEL = nrf5340_app CPU = nrf53 # Put defined MCU peripherals here (in alphabetical order) +FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_rtt +FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += periph_uart_hw_fc diff --git a/boards/nrf5340dk-app/include/periph_conf.h b/boards/nrf5340dk-app/include/periph_conf.h index a061f136c3..1ad21b7c46 100644 --- a/boards/nrf5340dk-app/include/periph_conf.h +++ b/boards/nrf5340dk-app/include/periph_conf.h @@ -110,6 +110,22 @@ static const pwm_conf_t pwm_config[] = { #define PWM_NUMOF ARRAY_SIZE(pwm_config) /** @} */ +/** + * @name SPI configuration + * @{ + */ +static const spi_conf_t spi_config[] = { + { + .dev = NRF_SPIM1_S, + .sclk = GPIO_PIN(0, 17), + .mosi = GPIO_PIN(0, 13), + .miso = GPIO_PIN(0, 14), + } +}; + +#define SPI_NUMOF ARRAY_SIZE(spi_config) +/** @} */ + #ifdef __cplusplus } #endif diff --git a/cpu/nrf53/Kconfig b/cpu/nrf53/Kconfig index be2cb9fee2..944daf3ff1 100644 --- a/cpu/nrf53/Kconfig +++ b/cpu/nrf53/Kconfig @@ -15,6 +15,9 @@ config CPU_FAM_NRF53 select HAS_PERIPH_FLASHPAGE_PAGEWISE select HAS_PERIPH_GPIO select HAS_PERIPH_GPIO_IRQ + select HAS_PERIPH_I2C + select HAS_PERIPH_SPI + select HAS_PERIPH_SPI_GPIO_MODE select HAS_PERIPH_TIMER_PERIODIC select HAS_PERIPH_UART_MODECFG select HAS_PERIPH_WDT diff --git a/cpu/nrf53/Makefile.dep b/cpu/nrf53/Makefile.dep index 572ee26275..0db554a3c7 100644 --- a/cpu/nrf53/Makefile.dep +++ b/cpu/nrf53/Makefile.dep @@ -1,5 +1,9 @@ USEMODULE += nrf53_vectors USEMODULE += nrf_shared_serial_irq +ifneq (,$(filter periph_spi,$(USEMODULE))) + USEMODULE += periph_spi_gpio_mode +endif + include $(RIOTCPU)/nrf5x_common/Makefile.dep include $(RIOTCPU)/cortexm_common/Makefile.dep diff --git a/cpu/nrf53/Makefile.features b/cpu/nrf53/Makefile.features index 3108b0263e..9ce1850258 100644 --- a/cpu/nrf53/Makefile.features +++ b/cpu/nrf53/Makefile.features @@ -1,4 +1,6 @@ CPU_CORE = cortex-m33 CPU_FAM = nrf53 +FEATURES_PROVIDED += periph_spi_gpio_mode + include $(RIOTCPU)/nrf5x_common/Makefile.features diff --git a/cpu/nrf5x_common/periph/Makefile b/cpu/nrf5x_common/periph/Makefile index cab8572513..2b84bc16fa 100644 --- a/cpu/nrf5x_common/periph/Makefile +++ b/cpu/nrf5x_common/periph/Makefile @@ -2,7 +2,7 @@ MODULE = nrf5x_common_periph # Select the specific implementation for `periph_i2c` ifneq (,$(filter periph_i2c,$(USEMODULE))) - ifneq (,$(filter $(CPU_FAM),nrf52 nrf9160)) + ifneq (,$(filter $(CPU_FAM),nrf52 nrf53 nrf9160)) SRC += i2c_nrf52_nrf9160.c endif endif @@ -17,7 +17,7 @@ endif # Select the specific implementation for `periph_spi` ifneq (,$(filter periph_spi,$(USEMODULE))) - ifneq (,$(filter $(CPU_FAM),nrf52 nrf9160)) + ifneq (,$(filter $(CPU_FAM),nrf52 nrf53 nrf9160)) SRC += spi_nrf52_nrf9160.c endif endif