Skip to content

Commit

Permalink
olimexino_stm32: Enable I2C1
Browse files Browse the repository at this point in the history
Enable I2C1 on olimexino_stm32

Signed-off-by: Yannis Damigos <[email protected]>
  • Loading branch information
ydamigos authored and galak committed Jul 25, 2019
1 parent 55684e0 commit a4d9c3b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions boards/arm/olimexino_stm32/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ endif # UART_CONSOLE

if I2C

config I2C_1
default y

config I2C_2
default y

Expand Down
5 changes: 4 additions & 1 deletion boards/arm/olimexino_stm32/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,11 @@ OLIMEXINO-STM32 board has up to 2 SPIs. The default SPI mapping for Zephyr is:
I2C
===

OLIMEXINO-STM32 board has up to 1 I2C. The default I2C mapping for Zephyr is:
The OLIMEXINO-STM32 board supports two I2C devices. The default I2C mapping for
Zephyr is:

- I2C1_SCL : PB6
- I2C1_SDA : PB7
- I2C2_SCL : PB10
- I2C2_SDA : PB11

Expand Down
5 changes: 5 additions & 0 deletions boards/arm/olimexino_stm32/olimexino_stm32.dts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ uext_serial: &usart1 {};
pinctrl-names = "default";
};

&i2c1 {
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
};

&i2c2 {
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/olimexino_stm32/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_USART3_TX},
{STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_USART3_RX},
#endif /* CONFIG_UART_3 */
#ifdef CONFIG_I2C_1
{STM32_PIN_PB6, STM32F1_PINMUX_FUNC_PB6_I2C1_SCL},
{STM32_PIN_PB7, STM32F1_PINMUX_FUNC_PB7_I2C1_SDA},
#endif /* CONFIG_I2C_1 */
#ifdef CONFIG_I2C_2
{STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_I2C2_SCL},
{STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_I2C2_SDA},
Expand Down

0 comments on commit a4d9c3b

Please sign in to comment.