Skip to content

Commit b6a31a8

Browse files
ananglnashif
authored andcommitted
drivers: spi: nrfx: Add support for SPIS3
This patch adds missing SPI_3_NRF_SPIS Kconfig option (referenced by `ext/hal/nordic/nrfx_config_nrf9160.h`, although not defined anywhere) and adds support for SPIS3 instance in the nrfx_spis driver shim. Signed-off-by: Andrzej Głąbek <[email protected]>
1 parent 244aecf commit b6a31a8

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

drivers/spi/Kconfig.nrfx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,29 @@ endif # SPI_2
162162

163163
if SPI_3
164164

165+
choice
166+
prompt "SPI Port 3 Driver type"
167+
165168
config SPI_3_NRF_SPIM
166-
bool
169+
bool "nRF SPIM 3"
167170
depends on HAS_HW_NRF_SPIM3
168171
select NRFX_SPIM
169-
default y
172+
help
173+
Enable nRF SPI Master with EasyDMA on port 3.
174+
175+
config SPI_3_NRF_SPIS
176+
bool "nRF SPIS 3"
177+
depends on HAS_HW_NRF_SPIS3
178+
depends on SPI_SLAVE
179+
select NRFX_SPIS
180+
help
181+
Enable nRF SPI Slave with EasyDMA on port 3.
182+
Due to hardware limitations the implementation supports only simple
183+
buffers (consisting of one part) located in RAM.
170184

171-
if SPI_3_NRF_SPIM
185+
endchoice
186+
187+
if SPI_3_NRF_SPIM || SPI_3_NRF_SPIS
172188

173189
config SPI_3_NRF_ORC
174190
hex "Over-read Character"
@@ -178,17 +194,18 @@ config SPI_3_NRF_ORC
178194
Over-read character. Character clocked out after an over-read
179195
of the transmit buffer.
180196

197+
endif # SPI_3_NRF_SPIM || SPI_3_NRF_SPIS
198+
181199
config SPI_3_NRF_RX_DELAY
182200
int "MISO sampling delay"
201+
depends on SPI_3_NRF_SPIM && SOC_NRF52840
183202
range 0 7
184203
default 2
185204
help
186205
Number of 64 MHz clock cycles (15.625 ns) delay from the sampling
187206
edge of SCK (leading or trailing, depending on the CPHA setting used)
188207
until the input serial data on MISO is actually sampled.
189208

190-
endif # SPI_3_NRF_SPIM
191-
192209
endif # SPI_3
193210

194211
if NRFX_SPIM

drivers/spi/spi_nrfx_spis.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,7 @@ SPI_NRFX_SPIS_DEVICE(1);
295295
#ifdef CONFIG_SPI_2_NRF_SPIS
296296
SPI_NRFX_SPIS_DEVICE(2);
297297
#endif
298+
299+
#ifdef CONFIG_SPI_3_NRF_SPIS
300+
SPI_NRFX_SPIS_DEVICE(3);
301+
#endif

0 commit comments

Comments
 (0)