Skip to content

Commit

Permalink
arch/arm/src/stm32f0l0g0/ and boards/arm/stm32f0l0g0/nucleo-g070rb/in…
Browse files Browse the repository at this point in the history
…clude/board.h: Add I2C pinmap. In Kconfig select I2C2 for this part. Update I2C pin definitions in board.h.
  • Loading branch information
Guillherme Amaral authored and gregory-nutt committed Dec 20, 2019
1 parent 15f2889 commit eeed40a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions arch/arm/src/stm32f0l0g0/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 19 additions & 3 deletions arch/arm/src/stm32f0l0g0/hardware/stm32g0_pinmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,31 @@

/* 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 */

/* TODO: RTC */

/* 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)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions boards/arm/stm32f0l0g0/nucleo-g070rb/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit eeed40a

Please sign in to comment.