186 lines
3.6 KiB
Plaintext
186 lines
3.6 KiB
Plaintext
# Kconfig - nrf5 series MDK SPI support
|
|
#
|
|
# Copyright (c) 2017, Intel Corp.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
# TODO add nrf51 and nrf5 slave spi (spis)
|
|
|
|
menuconfig SPI_NRF5
|
|
bool "nRF5 SPI drivers"
|
|
depends on SPI && SOC_FAMILY_NRF5 && GPIO_NRF5_P0
|
|
default n
|
|
help
|
|
Enable support for nRF52 MCU series EasyDMA SPI driver. Peripherals
|
|
with the same instance id can not be used together, e.g., SPIM0 and I2C_0
|
|
(TWIM0) and SPIS0. You may need to disable I2C_0 or I2C_1.
|
|
|
|
if SPI_NRF5
|
|
|
|
# nordic twiX0, spiX0, spi0 instances can not be used at the same time
|
|
if SPI_0 && !I2C_0
|
|
|
|
choice
|
|
prompt "SPI Port 0 Driver type"
|
|
optional
|
|
|
|
config SPIM0_NRF52
|
|
bool "nRF52 SPIM0"
|
|
depends on SOC_SERIES_NRF52X
|
|
help
|
|
nRF52 SPI Master with EasyDMA on port 0
|
|
|
|
endchoice
|
|
|
|
if SPIM0_NRF52
|
|
|
|
config SPIM0_NRF52_GPIO_SCK_PIN
|
|
int "SCK pin number"
|
|
range 0 31
|
|
help
|
|
GPIO pin number for SCK
|
|
|
|
config SPIM0_NRF52_GPIO_MOSI_PIN
|
|
int "MOSI pin number"
|
|
range 0 31
|
|
help
|
|
GPIO pin number to use for MOSI
|
|
|
|
config SPIM0_NRF52_GPIO_MISO_PIN
|
|
int "MISO pin number"
|
|
range 0 31
|
|
help
|
|
GPIO pin number for MISO
|
|
|
|
config SPIM0_NRF52_GPIO_SS_PIN_0
|
|
int "CS0 pin number"
|
|
range 0 255
|
|
default 255
|
|
help
|
|
Slave Select (Chip Select) gpio pin number for line n. Not used value
|
|
is 255 (0xff).
|
|
|
|
config SPIM0_NRF52_GPIO_SS_PIN_1
|
|
int "CS1 pin number"
|
|
range 0 255
|
|
default 255
|
|
help
|
|
Slave Select (Chip Select) gpio pin number for line n. Not used value
|
|
is 255 (0xff).
|
|
|
|
config SPIM0_NRF52_GPIO_SS_PIN_2
|
|
int "CS2 pin number"
|
|
range 0 255
|
|
default 255
|
|
help
|
|
Slave Select (Chip Select) gpio pin number for line n. Not used value
|
|
is 255 (0xff).
|
|
|
|
config SPIM0_NRF52_GPIO_SS_PIN_3
|
|
int "CS3 pin number"
|
|
range 0 255
|
|
default 255
|
|
help
|
|
Slave Select (Chip Select) gpio pin number for line n. Not used value
|
|
is 255 (0xff).
|
|
|
|
config SPIM0_NRF52_ORC
|
|
hex "Over Read Character"
|
|
default 0x00
|
|
range 0x00 0xff
|
|
help
|
|
This option configures what value to send when the TX char count is
|
|
less than the RX count.
|
|
|
|
endif # SPIM0_NRF52
|
|
|
|
endif # SPI_0 && !I2C_0
|
|
|
|
# nordic twiX1, spiX1, spi1 instances can not be use at the same time
|
|
if SPI_1 && !I2C_1
|
|
|
|
choice
|
|
prompt "SPI Port 1 Driver type"
|
|
optional
|
|
|
|
config SPIM1_NRF52
|
|
bool "nRF52 SPIM1"
|
|
depends on SOC_SERIES_NRF52X
|
|
help
|
|
nRF52 SPI Master with EasyDMA on port 0
|
|
|
|
endchoice
|
|
|
|
if SPIM1_NRF52
|
|
|
|
config SPIM1_NRF52_GPIO_SCK_PIN
|
|
int "SCK pin number"
|
|
range 0 31
|
|
help
|
|
GPIO pin number for SCK
|
|
|
|
config SPIM1_NRF52_GPIO_MOSI_PIN
|
|
int "MOSI pin number"
|
|
range 0 31
|
|
help
|
|
GPIO pin number to use for MOSI
|
|
|
|
config SPIM1_NRF52_GPIO_MISO_PIN
|
|
int "MISO pin number"
|
|
range 0 31
|
|
help
|
|
GPIO pin number for MISO
|
|
|
|
config SPIM1_NRF52_GPIO_SS_PIN_0
|
|
int "CS0 pin number"
|
|
range 0 255
|
|
default 255
|
|
help
|
|
Slave Select (Chip Select) gpio pin number for line n. Not used value
|
|
is 255 (0xff).
|
|
|
|
config SPIM1_NRF52_GPIO_SS_PIN_1
|
|
int "CS1 pin number"
|
|
range 0 255
|
|
default 255
|
|
help
|
|
Slave Select (Chip Select) gpio pin number for line n. Not used value
|
|
is 255 (0xff).
|
|
|
|
config SPIM1_NRF52_GPIO_SS_PIN_2
|
|
int "CS2 pin number"
|
|
range 0 255
|
|
default 255
|
|
help
|
|
Slave Select (Chip Select) gpio pin number for line n. Not used value
|
|
is 255 (0xff).
|
|
|
|
config SPIM1_NRF52_GPIO_SS_PIN_3
|
|
int "CS3 pin number"
|
|
range 0 255
|
|
default 255
|
|
help
|
|
Slave Select (Chip Select) gpio pin number for line n. Not used value
|
|
is 255 (0xff).
|
|
|
|
config SPIM1_NRF52_ORC
|
|
hex "Over Read Character"
|
|
default 0x00
|
|
range 0x00 0xff
|
|
help
|
|
This option configures what value to send when the TX char count is
|
|
less than the RX count.
|
|
|
|
endif # SPIM1_NRF52
|
|
|
|
endif # SPI_1 && !I2C_1
|
|
|
|
# hidden compile option
|
|
config SPIM_NRF52
|
|
bool
|
|
depends on !I2C_0 || !I2C_1
|
|
default y if (SPIM0_NRF52 || SPIM1_NRF52)
|
|
|
|
endif # SPI_NRF5
|