1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

cpu/nrf53: enable I2C/SPI support

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
This commit is contained in:
Dylan Laduranty 2023-07-05 15:35:33 +02:00
parent 5811c847ad
commit f27bde3f37
6 changed files with 29 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,6 @@
CPU_CORE = cortex-m33
CPU_FAM = nrf53
FEATURES_PROVIDED += periph_spi_gpio_mode
include $(RIOTCPU)/nrf5x_common/Makefile.features

View File

@ -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