stm32l0: add support for external SPI flash

pull/41/head
Glenn Ergeerts 2020-03-31 10:59:55 +02:00
parent ad38bacfd8
commit 3682e66818
3 changed files with 16 additions and 1 deletions

View File

@ -46,6 +46,7 @@ ifeq ($(ARCH),ARM)
ifeq ($(TARGET),stm32l0)
CORTEX_M0=1
SPI_TARGET=stm32
endif
ifeq ($(TARGET),stm32g0)

View File

@ -68,6 +68,20 @@
#define SPI1_MOSI_PIN 7 /* SPI_MOSI PA7 */
#endif
#ifdef PLATFORM_stm32l0
#define APB2_CLOCK_ER (*(volatile uint32_t *)(0x40021034))
#define APB2_CLOCK_RST (*(volatile uint32_t *)(0x40021024))
#define RCC_GPIO_CLOCK_ER (*(volatile uint32_t *)(0x4002102C))
#define GPIOB_BASE (0x50000400)
#define SPI_GPIO GPIOB_BASE
#define SPI_CS_GPIO GPIOB_BASE
#define SPI_CS_FLASH 8 /* Flash CS connected to GPIOB8 */
#define SPI1_PIN_AF 0 /* Alternate function for SPI pins */
#define SPI1_CLOCK_PIN 3 /* SPI_SCK: PB3 */
#define SPI1_MISO_PIN 4 /* SPI_MISO PB4 */
#define SPI1_MOSI_PIN 5 /* SPI_MOSI PB5 */
#endif
#define SPI_PIO_BASE SPI_GPIO
#define SPI_CS_PIO_BASE SPI_CS_GPIO

View File

@ -32,7 +32,7 @@
#include <stdint.h>
#include "image.h"
#if defined(PLATFORM_stm32f4) || defined(PLATFORM_stm32f7) || defined(PLATFORM_stm32wb)
#if defined(PLATFORM_stm32f4) || defined(PLATFORM_stm32f7) || defined(PLATFORM_stm32wb) || defined(PLATFORM_stm32l0)
#include "hal/spi/spi_drv_stm32.h"
#endif