You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2019/12/20 21:51:25 UTC

[incubator-nuttx] 01/01: arch/arm/src/stm32f0l0g0: Added i2c pinmap and Kconfig select I2C2 for this board

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch stage
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 49a666e682d3b942dbf5b0d4b7037e92b1b2e0a4
Author: Guillherme Amaral <gv...@certi.org.br>
AuthorDate: Mon Dec 16 15:30:30 2019 -0300

    arch/arm/src/stm32f0l0g0: Added i2c pinmap and Kconfig select I2C2 for this board
---
 arch/arm/src/stm32f0l0g0/Kconfig                   |  1 +
 arch/arm/src/stm32f0l0g0/hardware/stm32g0_pinmap.h | 22 +++++++++++++++++++---
 .../arm/stm32f0l0g0/nucleo-g070rb/include/board.h  |  4 ++++
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/arch/arm/src/stm32f0l0g0/Kconfig b/arch/arm/src/stm32f0l0g0/Kconfig
index c91c77d..da229ee 100644
--- a/arch/arm/src/stm32f0l0g0/Kconfig
+++ b/arch/arm/src/stm32f0l0g0/Kconfig
@@ -804,6 +804,7 @@ config STM32F0L0G0_STM32G0
 	select STM32F0L0G0_HAVE_TIM15
 	select STM32F0L0G0_HAVE_TIM16
 	select STM32F0L0G0_HAVE_TIM17
+	select STM32F0L0G0_HAVE_I2C2
 
 config STM32F0L0G0_STM32L0
 	bool
diff --git a/arch/arm/src/stm32f0l0g0/hardware/stm32g0_pinmap.h b/arch/arm/src/stm32f0l0g0/hardware/stm32g0_pinmap.h
index cc454a8..e29bbca 100644
--- a/arch/arm/src/stm32f0l0g0/hardware/stm32g0_pinmap.h
+++ b/arch/arm/src/stm32f0l0g0/hardware/stm32g0_pinmap.h
@@ -74,7 +74,23 @@
 
 /* TODO: DAC */
 
-/* TODO: I2C */
+/* I2C */
+
+#define GPIO_I2C1_SMBA_1          (GPIO_ALT | GPIO_AF6 | GPIO_PORTA | GPIO_PIN1)
+#define GPIO_I2C1_SMBA_2          (GPIO_ALT | GPIO_AF6 | GPIO_PORTB | GPIO_PIN5)
+#define GPIO_I2C1_SCL_1           (GPIO_ALT | GPIO_AF6 | GPIO_PORTA | GPIO_PIN9)
+#define GPIO_I2C1_SDA_1           (GPIO_ALT | GPIO_AF6 | GPIO_PORTA | GPIO_PIN10)
+#define GPIO_I2C1_SCL_2           (GPIO_ALT | GPIO_AF6 | GPIO_PORTB | GPIO_PIN6)
+#define GPIO_I2C1_SDA_2           (GPIO_ALT | GPIO_AF6 | GPIO_PORTB | GPIO_PIN7)
+#define GPIO_I2C1_SCL_3           (GPIO_ALT | GPIO_AF6 | GPIO_PORTB | GPIO_PIN8)
+#define GPIO_I2C1_SDA_3           (GPIO_ALT | GPIO_AF6 | GPIO_PORTB | GPIO_PIN9)
+
+#define GPIO_I2C2_SCL_1           (GPIO_ALT | GPIO_AF6 | GPIO_PORTA | GPIO_PIN11)
+#define GPIO_I2C2_SDA_1           (GPIO_ALT | GPIO_AF6 | GPIO_PORTA | GPIO_PIN12)
+#define GPIO_I2C2_SCL_2           (GPIO_ALT | GPIO_AF6 | GPIO_PORTB | GPIO_PIN10)
+#define GPIO_I2C2_SDA_2           (GPIO_ALT | GPIO_AF6 | GPIO_PORTB | GPIO_PIN11)
+#define GPIO_I2C2_SCL_3           (GPIO_ALT | GPIO_AF6 | GPIO_PORTB | GPIO_PIN13)
+#define GPIO_I2C2_SDA_3           (GPIO_ALT | GPIO_AF6 | GPIO_PORTB | GPIO_PIN14)
 
 /* TODO: Clocking */
 
@@ -82,7 +98,7 @@
 
 /* TODO: SPI */
 
-/* TODO: Timers */
+/* Timers */
 
 #define GPIO_TIM1_BKIN_1         (GPIO_ALT | GPIO_AF2 | GPIO_PORTA | GPIO_PIN6)
 #define GPIO_TIM1_BKIN_2         (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN12)
@@ -152,7 +168,7 @@
 #define GPIO_TIM17_CH1OUT_3      (GPIO_ALT | GPIO_AF5 | GPIO_PORTA | GPIO_PIN7)
 #define GPIO_TIM17_CH1NOUT       (GPIO_ALT | GPIO_AF2 | GPIO_PORTB | GPIO_PIN7)
 
-/* TODO: USART */
+/* USART */
 
 #define GPIO_USART1_CTS_1    (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN11)
 #define GPIO_USART1_CTS_2    (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN4)
diff --git a/boards/arm/stm32f0l0g0/nucleo-g070rb/include/board.h b/boards/arm/stm32f0l0g0/nucleo-g070rb/include/board.h
index 6d618fe..b865061 100644
--- a/boards/arm/stm32f0l0g0/nucleo-g070rb/include/board.h
+++ b/boards/arm/stm32f0l0g0/nucleo-g070rb/include/board.h
@@ -214,6 +214,10 @@
 
 /* Alternate function pin selections ****************************************/
 
+/* I2C */
+#define GPIO_I2C1_SCL       GPIO_I2C1_SCL_3      /* PB8  */
+#define GPIO_I2C1_SDA       GPIO_I2C1_SDA_3      /* PB9  */
+
 /* TIM */
 
 #define GPIO_TIM1_CH1OUT    GPIO_TIM1_CH1OUT_1   /* PA8  */