zephyr/drivers/spi/Kconfig.nrfx
Andrzej Głąbek 00397c65bc drivers: spi: Add shim for nrfx SPI driver
This adds a translation layer to make the nrfx driver for the legacy
(i.e. without EasyDMA) nRF SPI peripheral accessible via the updated
Zephyr's API of the SPI driver.
Configuration files are already prepared for adding support for SPIM
(Master with EasyDMA) and SPIS (Slave with EasyDMA) peripherals.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-04-04 19:02:35 +02:00

211 lines
4.2 KiB
Plaintext

# Copyright (c) 2017 - 2018, Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
#
menuconfig SPI_NRFX
bool "nRF SPI nrfx drivers"
depends on SOC_FAMILY_NRF
help
Enable support for nrfx SPI drivers for nRF MCU series.
Peripherals with the same instance ID cannot be used together,
e.g. SPI_0 and I2C_0. You may need to disable I2C_0 or I2C_1.
if SPI_NRFX
# Nordic TWIx0 and SPIx0 instances can not be used at the same time
if SPI_0 && !I2C_0
choice
prompt "SPI Port 0 Driver type"
optional
config SPI_0_NRF_SPI
bool "nRF SPI 0"
depends on SOC_SERIES_NRF52X || SOC_SERIES_NRF51X
select NRFX_SPI
help
Enable nRF SPI Master without EasyDMA on port 0
config SPI_0_NRF_SPIM
bool "nRF SPIM 0"
depends on SOC_SERIES_NRF52X
select NRFX_SPIM
help
Enable nRF SPI Master with EasyDMA on port 0
config SPI_0_NRF_SPIS
bool "nRF SPIS 0"
depends on SOC_SERIES_NRF52X
select NRFX_SPIS
help
Enable nRF SPI Slave with EasyDMA on port 0
endchoice
if SPI_0_NRF_SPI || SPI_0_NRF_SPIM || SPI_0_NRF_SPIS
config SPI_0_NRF_SCK_PIN
int "SCK pin number"
range 0 47 if SOC_NRF52840_QIAA
range 0 31
help
GPIO pin number to use for SCK
config SPI_0_NRF_MOSI_PIN
int "MOSI pin number"
range 0 47 if SOC_NRF52840_QIAA
range 0 31
help
GPIO pin number to use for MOSI
config SPI_0_NRF_MISO_PIN
int "MISO pin number"
range 0 47 if SOC_NRF52840_QIAA
range 0 31
help
GPIO pin number to use for MISO
config SPI_0_NRF_ORC
hex "Over-read Character"
range 0x00 0xff
default 0xff
help
Over-read character. Character clocked out after an over-read
of the transmit buffer.
endif # SPI_0_NRF_SPI || SPI_0_NRF_SPIM || SPI_0_NRF_SPIS
endif # SPI_0 && !I2C_0
# Nordic TWIx1 and SPIx1 instances can not be used at the same time
if SPI_1 && !I2C_1
choice
prompt "SPI Port 1 Driver type"
optional
config SPI_1_NRF_SPI
bool "nRF SPI 1"
depends on SOC_SERIES_NRF52X || SOC_SERIES_NRF51X
select NRFX_SPI
help
Enable nRF SPI Master without EasyDMA on port 1
config SPI_1_NRF_SPIM
bool "nRF SPIM 1"
depends on SOC_SERIES_NRF52X
select NRFX_SPIM
help
Enable nRF SPI Master with EasyDMA on port 1
config SPI_1_NRF_SPIS
bool "nRF SPIS 1"
depends on SOC_SERIES_NRF52X || SOC_SERIES_NRF51X
select NRFX_SPIS
help
Enable nRF SPI Slave with EasyDMA on port 1
endchoice
if SPI_1_NRF_SPI || SPI_1_NRF_SPIM || SPI_1_NRF_SPIS
config SPI_1_NRF_SCK_PIN
int "SCK pin number"
range 0 47 if SOC_NRF52840_QIAA
range 0 31
help
GPIO pin number to use for SCK
config SPI_1_NRF_MOSI_PIN
int "MOSI pin number"
range 0 47 if SOC_NRF52840_QIAA
range 0 31
help
GPIO pin number to use for MOSI
config SPI_1_NRF_MISO_PIN
int "MISO pin number"
range 0 47 if SOC_NRF52840_QIAA
range 0 31
help
GPIO pin number to use for MISO
config SPI_1_NRF_ORC
hex "Over-read Character"
range 0x00 0xff
default 0xff
help
Over-read character. Character clocked out after an over-read
of the transmit buffer.
endif # SPI_1_NRF_SPI || SPI_1_NRF_SPIM || SPI_1_NRF_SPIS
endif # SPI_1 && !I2C_1
if SPI_2
choice
prompt "SPI Port 2 Driver type"
optional
config SPI_2_NRF_SPI
bool "nRF SPI 2"
depends on SOC_SERIES_NRF52X
select NRFX_SPI
help
Enable nRF SPI Master without EasyDMA on port 2
config SPI_2_NRF_SPIM
bool "nRF SPIM 2"
depends on SOC_SERIES_NRF52X
select NRFX_SPIM
help
Enable nRF SPI Master with EasyDMA on port 2
config SPI_2_NRF_SPIS
bool "nRF SPIS 2"
depends on SOC_SERIES_NRF52X
select NRFX_SPIS
help
Enable nRF SPI Slave with EasyDMA on port 2
endchoice
if SPI_2_NRF_SPI || SPI_2_NRF_SPIM || SPI_2_NRF_SPIS
config SPI_2_NRF_SCK_PIN
int "SCK pin number"
range 0 47 if SOC_NRF52840_QIAA
range 0 31
help
GPIO pin number to use for SCK
config SPI_2_NRF_MOSI_PIN
int "MOSI pin number"
range 0 47 if SOC_NRF52840_QIAA
range 0 31
help
GPIO pin number to use for MOSI
config SPI_2_NRF_MISO_PIN
int "MISO pin number"
range 0 47 if SOC_NRF52840_QIAA
range 0 31
help
GPIO pin number to use for MISO
config SPI_2_NRF_ORC
hex "Over-read Character"
range 0x00 0xff
default 0xff
help
Over-read character. Character clocked out after an over-read
of the transmit buffer.
endif # SPI_2_NRF_SPI || SPI_2_NRF_SPIM || SPI_2_NRF_SPIS
endif # SPI_2
endif # SPI_NRFX