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

[incubator-nuttx] 01/03: arch/arm/src/stm32f0l0g0/ and boards/arm/stm32f0l0g0/nucleo-g070rb/include/board.h: Add I2C pinmap. In Kconfig select I2C2 for this part. Update I2C pin definitions in board.h.

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

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

commit eeed40aa0ce4e6e343696f2e702cee00ca4e20d9
Author: Guillherme Amaral <gv...@certi.org.br>
AuthorDate: Fri Dec 20 13:02:13 2019 -0600

    arch/arm/src/stm32f0l0g0/ and boards/arm/stm32f0l0g0/nucleo-g070rb/include/board.h:  Add I2C pinmap.  In Kconfig select I2C2 for this part.  Update I2C pin definitions in board.h.
---
 arch/arm/src/stm32f0l0g0/Kconfig                   |  1 +
 arch/arm/src/stm32f0l0g0/hardware/stm32g0_pinmap.h | 22 +++++++++++++++++++---
 .../arm/stm32f0l0g0/nucleo-g070rb/include/board.h  |  5 +++++
 3 files changed, 25 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..9b4d2a5 100644
--- a/boards/arm/stm32f0l0g0/nucleo-g070rb/include/board.h
+++ b/boards/arm/stm32f0l0g0/nucleo-g070rb/include/board.h
@@ -214,6 +214,11 @@
 
 /* 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  */