boards: arm: olimexino_stm32: Enable SPI1 port

Enable SPI1 port on olimexino_stm32.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
This commit is contained in:
Yannis Damigos 2017-12-13 13:49:11 +02:00 committed by Kumar Gala
commit 6a6a4294c2
6 changed files with 40 additions and 0 deletions

View file

@ -28,4 +28,9 @@
#define CONFIG_I2C_2_ERROR_IRQ ST_STM32_I2C_V1_40005800_IRQ_ERROR
#define CONFIG_I2C_2_BITRATE ST_STM32_I2C_V1_40005800_CLOCK_FREQUENCY
#define CONFIG_SPI_1_BASE_ADDRESS ST_STM32_SPI_40013000_BASE_ADDRESS
#define CONFIG_SPI_1_IRQ_PRI ST_STM32_SPI_40013000_IRQ_0_PRIORITY
#define CONFIG_SPI_1_NAME ST_STM32_SPI_40013000_LABEL
#define CONFIG_SPI_1_IRQ ST_STM32_SPI_40013000_IRQ_0
/* End of SoC Level DTS fixup file */

View file

@ -24,4 +24,14 @@ config I2C_2
endif # I2C
if SPI
config SPI_STM32_INTERRUPT
default y
config SPI_1
default y
endif # SPI
endif # BOARD_OLIMEXINO_STM32

View file

@ -43,6 +43,8 @@ hardware features:
+-----------+------------+----------------------+
| I2C | on-chip | i2c |
+-----------+------------+----------------------+
| SPI | on-chip | spi |
+-----------+------------+----------------------+
Other hardware features are not supported by the Zephyr kernel.
@ -299,6 +301,16 @@ Serial Port
OLIMEXINO-STM32 board has up to 3 U(S)ARTs. The Zephyr console output is
assigned to USART1. Default settings are 115200 8N1.
SPI
===
OLIMEXINO-STM32 board has up to 2 SPIs. The default SPI mapping for Zephyr is:
- SPI1_NSS : PA4
- SPI1_SCK : PA5
- SPI1_MISO : PA6
- SPI1_MOSI : PA7
I2C
===

View file

@ -41,3 +41,7 @@
status = "ok";
clock-frequency = <I2C_BITRATE_FAST>;
};
&spi1 {
status = "ok";
};

View file

@ -16,6 +16,9 @@ CONFIG_UART_CONSOLE=y
# enable I2C driver
CONFIG_I2C=y
# enable SPI
CONFIG_SPI=y
# enable pinmux
CONFIG_PINMUX=y

View file

@ -30,6 +30,12 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_I2C2_SCL},
{STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_I2C2_SDA},
#endif /* CONFIG_I2C_2 */
#ifdef CONFIG_SPI_1
{STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS_OE},
{STM32_PIN_PA5, STM32F1_PINMUX_FUNC_PA5_SPI1_MASTER_SCK},
{STM32_PIN_PA6, STM32F1_PINMUX_FUNC_PA6_SPI1_MASTER_MISO},
{STM32_PIN_PA7, STM32F1_PINMUX_FUNC_PA7_SPI1_MASTER_MOSI},
#endif
};
static int pinmux_stm32_init(struct device *port)