Skip to content

Commit ba4c71e

Browse files
committed
stm32lx: spi: add SPI driver for STM32Lx family
Add a SPI master and slave driver for the L series. Change-Id: I1faf5c97f992c91eba852fd126e7d3b83158993d Origin: Original Signed-off-by: Neil Armstrong <[email protected]> Tested-by: Lee Jones <[email protected]>
1 parent c40239d commit ba4c71e

File tree

5 files changed

+588
-0
lines changed

5 files changed

+588
-0
lines changed

drivers/spi/Kconfig

+53
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@ config SPI_INTEL
4343
was formerly found on XScale chips. It can be found nowadays
4444
on CEXXXX Intel media controller and Quark CPU (2 of them).
4545

46+
config SPI_STM32LX
47+
bool
48+
prompt "STM32LX MCU SPI controller driver"
49+
depends on SPI && SOC_FAMILY_STM32 && SOC_SERIES_STM32L4X
50+
default n
51+
help
52+
Enable SPI support on the STM32Lxx family of processors.
53+
54+
config SPI_STM32LX_INTERRUPT
55+
bool
56+
prompt "STM32LX MCU SPI Interrupt Support"
57+
depends on SPI_STM32LX
58+
default n
59+
help
60+
Enable Interrupt support for the SPI Driver of STM32Lxx family.
4661

4762
if SPI
4863
config SPI_INIT_PRIORITY
@@ -188,6 +203,44 @@ config SPI_2_CS_GPIO_PIN
188203
depends on SPI_2 && SPI_CS_GPIO
189204
default 0
190205

206+
config SPI_3
207+
bool
208+
prompt "SPI port 3"
209+
default n
210+
help
211+
Enable SPI controller port 3.
212+
213+
config SPI_3_NAME
214+
string
215+
prompt "SPI port 3 device name"
216+
depends on SPI_3
217+
default "SPI_3"
218+
219+
config SPI_3_IRQ_PRI
220+
int
221+
prompt "Port 3 interrupt priority"
222+
depends on SPI_3
223+
224+
config SPI_3_DEFAULT_CFG
225+
hex "Port 3 default configuration"
226+
depends on SPI_3
227+
default 0x80
228+
229+
config SPI_3_DEFAULT_BAUD_RATE
230+
int "Port 3 default baud rate"
231+
depends on SPI_3
232+
default 500000
233+
234+
config SPI_3_CS_GPIO_PORT
235+
string
236+
prompt "The GPIO port which is used to control CS"
237+
depends on SPI_3 && SPI_CS_GPIO
238+
default "GPIO_0"
239+
240+
config SPI_3_CS_GPIO_PIN
241+
int "The GPIO PIN which is used to act as a CS pin"
242+
depends on SPI_3 && SPI_CS_GPIO
243+
191244
config SPI_SS_INIT_PRIORITY
192245
int "Init priority"
193246
depends on SPI_QMSI_SS

drivers/spi/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ obj-$(CONFIG_SPI_MCUX_DSPI) += spi_mcux_dspi.o
44
obj-$(CONFIG_SPIM_NRF52) += spim_nrf52.o
55
obj-$(CONFIG_SPI_QMSI) += spi_qmsi.o
66
obj-$(CONFIG_SPI_QMSI_SS) += spi_qmsi_ss.o
7+
obj-$(CONFIG_SPI_STM32LX) += spi_stm32lx.o

0 commit comments

Comments
 (0)