Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/spi/spi_ll_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ static int spi_stm32_configure(struct device *dev,
LL_SPI_SetRxFIFOThreshold(spi, LL_SPI_RX_FIFO_TH_QUARTER);
#endif

#ifndef CONFIG_SOC_SERIES_STM32F1X
#if !defined(CONFIG_SOC_SERIES_STM32F1X) && !defined(CONFIG_SOC_SERIES_STM32L1X)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split this commit into a dedicated PR.

LL_SPI_SetStandard(spi, LL_SPI_PROTOCOL_MOTOROLA);
#endif

Expand Down
12 changes: 12 additions & 0 deletions dts/arm/st/l1/stm32l1.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@
label= "I2C_2";
};

spi1: spi@40013000 {
compatible = "st,stm32-spi";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x40013000 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00001000>;
interrupts = <35 5>;
status = "disabled";
label = "SPI_1";
};

usart1: serial@40013800 {
compatible = "st,stm32-usart", "st,stm32-uart";
reg = <0x40013800 0x400>;
Expand Down Expand Up @@ -144,6 +155,7 @@

rcc: rcc@40023800 {
compatible = "st,stm32-rcc";
clocks-controller;
#clock-cells = <2>;
reg = <0x40023800 0x400>;
label = "STM32_CLK_RCC";
Expand Down
7 changes: 7 additions & 0 deletions soc/arm/st_stm32/stm32l1/dts_fixup.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,11 @@
#define DT_I2C_2_CLOCK_BITS DT_ST_STM32_I2C_V1_40005800_CLOCK_BITS
#define DT_I2C_2_CLOCK_BUS DT_ST_STM32_I2C_V1_40005800_CLOCK_BUS

#define DT_SPI_1_BASE_ADDRESS DT_ST_STM32_SPI_40013000_BASE_ADDRESS
#define DT_SPI_1_IRQ_PRI DT_ST_STM32_SPI_40013000_IRQ_0_PRIORITY
#define DT_SPI_1_NAME DT_ST_STM32_SPI_40013000_LABEL
#define DT_SPI_1_IRQ DT_ST_STM32_SPI_40013000_IRQ_0
#define DT_SPI_1_CLOCK_BITS DT_ST_STM32_SPI_40013000_CLOCK_BITS
#define DT_SPI_1_CLOCK_BUS DT_ST_STM32_SPI_40013000_CLOCK_BUS

/* End of SoC Level DTS fixup file */
4 changes: 4 additions & 0 deletions soc/arm/st_stm32/stm32l1/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
#include <stm32l1xx_ll_i2c.h>
#endif

#ifdef CONFIG_SPI
#include <stm32l1xx_ll_spi.h>
#endif

#endif /* !_ASMLANGUAGE */

#endif /* _STM32L1_SOC_H_ */