Skip to content

Commit 7cf5213

Browse files
raiden00plxiaoxiang781216
authored andcommitted
boards/stm32f0l0g0: rework boards to not use CONFIG_STM32F0L0G0_USE_LEGACY_PINMAP=y
Continuation to PR apache#8992
1 parent 5a50800 commit 7cf5213

File tree

27 files changed

+135
-90
lines changed

27 files changed

+135
-90
lines changed

boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/adc/defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#
88
# CONFIG_LIBC_LONG_LONG is not set
99
# CONFIG_NSH_ARGCAT is not set
10+
# CONFIG_STM32F0G0L0_USE_LEGACY_PINMAP is not set
1011
CONFIG_ADC=y
1112
CONFIG_ANALOG=y
1213
CONFIG_ARCH="arm"

boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/nsh/defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#
88
# CONFIG_LIBC_LONG_LONG is not set
99
# CONFIG_NSH_ARGCAT is not set
10+
# CONFIG_STM32F0G0L0_USE_LEGACY_PINMAP is not set
1011
CONFIG_ARCH="arm"
1112
CONFIG_ARCH_BOARD="b-l072z-lrwan1"
1213
CONFIG_ARCH_BOARD_B_L072Z_LRWAN1=y

boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/nxlines_oled/defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# CONFIG_LIBC_LONG_LONG is not set
1010
# CONFIG_NSH_ARGCAT is not set
1111
# CONFIG_NX_DISABLE_1BPP is not set
12+
# CONFIG_STM32F0G0L0_USE_LEGACY_PINMAP is not set
1213
CONFIG_ARCH="arm"
1314
CONFIG_ARCH_BOARD="b-l072z-lrwan1"
1415
CONFIG_ARCH_BOARD_B_L072Z_LRWAN1=y

boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/sx127x/defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#
88
# CONFIG_LIBC_LONG_LONG is not set
99
# CONFIG_NSH_ARGCAT is not set
10+
# CONFIG_STM32F0G0L0_USE_LEGACY_PINMAP is not set
1011
CONFIG_ARCH="arm"
1112
CONFIG_ARCH_BOARD="b-l072z-lrwan1"
1213
CONFIG_ARCH_BOARD_B_L072Z_LRWAN1=y

boards/arm/stm32f0l0g0/b-l072z-lrwan1/include/board.h

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -202,43 +202,62 @@
202202
*
203203
*/
204204

205+
/* ADC */
206+
207+
#define GPIO_ADC1_IN0 (GPIO_ADC1_IN0_0) /* PA0 */
208+
#define GPIO_ADC1_IN1 (GPIO_ADC1_IN1_0) /* PA1 */
209+
#define GPIO_ADC1_IN2 (GPIO_ADC1_IN2_0) /* PA2 */
210+
#define GPIO_ADC1_IN3 (GPIO_ADC1_IN3_0) /* PA3 */
211+
#define GPIO_ADC1_IN4 (GPIO_ADC1_IN4_0) /* PA4 */
212+
#define GPIO_ADC1_IN5 (GPIO_ADC1_IN5_0) /* PA5 */
213+
#define GPIO_ADC1_IN6 (GPIO_ADC1_IN6_0) /* PA6 */
214+
#define GPIO_ADC1_IN7 (GPIO_ADC1_IN7_0) /* PA7 */
215+
#define GPIO_ADC1_IN8 (GPIO_ADC1_IN8_0) /* PB0 */
216+
#define GPIO_ADC1_IN9 (GPIO_ADC1_IN9_0) /* PB1 */
217+
#define GPIO_ADC1_IN10 (GPIO_ADC1_IN10_0) /* PC0 */
218+
#define GPIO_ADC1_IN11 (GPIO_ADC1_IN11_0) /* PC1 */
219+
#define GPIO_ADC1_IN12 (GPIO_ADC1_IN12_0) /* PC2 */
220+
#define GPIO_ADC1_IN13 (GPIO_ADC1_IN13_0) /* PC3 */
221+
#define GPIO_ADC1_IN14 (GPIO_ADC1_IN14_0) /* PC4 */
222+
#define GPIO_ADC1_IN15 (GPIO_ADC1_IN15_0) /* PC5 */
223+
205224
/* USART */
206225

207226
/* USART1 */
208227

209-
#define GPIO_USART1_RX GPIO_USART1_RX_1 /* PA10 */
210-
#define GPIO_USART1_TX GPIO_USART1_TX_1 /* PA9 */
228+
#define GPIO_USART1_RX (GPIO_USART1_RX_1|GPIO_SPEED_HIGH) /* PA10 */
229+
#define GPIO_USART1_TX (GPIO_USART1_TX_1|GPIO_SPEED_HIGH) /* PA9 */
211230

212231
/* By default the USART2 is connected to STLINK Virtual COM Port:
213232
* USART2_RX - PA3
214233
* USART2_TX - PA2
215234
*/
216235

217-
#define GPIO_USART2_RX GPIO_USART2_RX_1 /* PA3 */
218-
#define GPIO_USART2_TX GPIO_USART2_TX_1 /* PA2 */
236+
#define GPIO_USART2_RX (GPIO_USART2_RX_1|GPIO_SPEED_HIGH) /* PA3 */
237+
#define GPIO_USART2_TX (GPIO_USART2_TX_1|GPIO_SPEED_HIGH) /* PA2 */
219238

220239
/* SPI */
221240

222241
/* SPI1 is connected to SX1276 radio */
223242

224-
#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_2 /* PA7 */
225-
#define GPIO_SPI1_MISO GPIO_SPI1_MISO_2 /* PA6 */
226-
#define GPIO_SPI1_SCK GPIO_SPI1_SCK_2 /* PB3 */
227-
#define GPIO_SPI1_NSS GPIO_SPI1_NSS_1 /* PA15 */
243+
#define GPIO_SPI1_MOSI (GPIO_SPI1_MOSI_2|GPIO_SPEED_MEDIUM) /* PA7 */
244+
#define GPIO_SPI1_MISO (GPIO_SPI1_MISO_2|GPIO_SPEED_MEDIUM) /* PA6 */
245+
#define GPIO_SPI1_SCK (GPIO_SPI1_SCK_2|GPIO_SPEED_MEDIUM) /* PB3 */
246+
#define GPIO_SPI1_NSS (GPIO_SPI1_NSS_1|GPIO_SPEED_MEDIUM) /* PA15 */
228247

229248
/* SPI2 */
230249

231-
#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */
232-
#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */
233-
#define GPIO_SPI2_SCK GPIO_SPI2_SCK_3 /* PB13 */
234-
#define GPIO_SPI2_NSS GPIO_SPI2_NSS_1 /* PB12 */
250+
#define GPIO_SPI2_MOSI (GPIO_SPI2_MOSI_1|GPIO_SPEED_MEDIUM) /* PB15 */
251+
#define GPIO_SPI2_MISO (GPIO_SPI2_MISO_1|GPIO_SPEED_MEDIUM) /* PB14 */
252+
#define GPIO_SPI2_SCK (GPIO_SPI2_SCK_3|GPIO_SPEED_MEDIUM) /* PB13 */
253+
#define GPIO_SPI2_NSS (GPIO_SPI2_NSS_1|GPIO_SPEED_MEDIUM) /* PB12 */
235254

236255
/* I2C */
237256

238257
/* I2C1 */
239258

240-
#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */
241-
#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */
259+
#define GPIO_I2C1_SDA (GPIO_I2C1_SDA_2|GPIO_SPEED_LOW) /* PB9 */
260+
#define GPIO_I2C1_SCL (GPIO_I2C1_SCL_2|GPIO_SPEED_LOW) /* PB8 */
242261

243262
/* DMA channels *************************************************************/
244263

boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_adc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
#include <errno.h>
2929
#include <debug.h>
3030

31-
#include <nuttx/board.h>
31+
#include <arch/board/board.h>
32+
3233
#include <nuttx/analog/adc.h>
3334

3435
#include "stm32.h"

boards/arm/stm32f0l0g0/nucleo-f072rb/configs/nsh/defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# CONFIG_NSH_DISABLE_EXIT is not set
2121
# CONFIG_NSH_DISABLE_HEXDUMP is not set
2222
# CONFIG_NSH_DISABLE_XD is not set
23+
# CONFIG_STM32F0G0L0_USE_LEGACY_PINMAP is not set
2324
CONFIG_ARCH="arm"
2425
CONFIG_ARCH_BOARD="nucleo-f072rb"
2526
CONFIG_ARCH_BOARD_NUCLEO_F072RB=y

boards/arm/stm32f0l0g0/nucleo-f072rb/include/board.h

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,20 +216,26 @@
216216

217217
/* Alternate Pin Functions **************************************************/
218218

219-
/* USART 1 */
219+
/* USART 1
220+
* PA9 - CN10 pin 21
221+
* PA10 - CN10 pin 33
222+
*/
220223

221-
#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PA9 CN10 pin 21 */
222-
#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PA10 CN10 pin 33 */
224+
#define GPIO_USART1_TX (GPIO_USART1_TX_2|GPIO_SPEED_HIGH) /* PA9 */
225+
#define GPIO_USART1_RX (GPIO_USART1_RX_2|GPIO_SPEED_HIGH) /* PA10 */
223226

224-
/* USART 2 */
227+
/* USART 2 - St-Link VCOM */
225228

226-
#define GPIO_USART2_TX GPIO_USART2_TX_3 /* PA2 St-Link VCOM */
227-
#define GPIO_USART2_RX GPIO_USART2_RX_3 /* PA3 St-Link VCOM */
229+
#define GPIO_USART2_TX (GPIO_USART2_TX_3|GPIO_SPEED_HIGH) /* PA2 */
230+
#define GPIO_USART2_RX (GPIO_USART2_RX_3|GPIO_SPEED_HIGH) /* PA3 */
228231

229-
/* I2C1 */
232+
/* I2C1
233+
* PB8 - CN5 pin 10, D15
234+
* PB9 - CN5 pin 9, D14
235+
*/
230236

231-
#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 CN5 pin 10, D15 */
232-
#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 CN5 pin 9, D14 */
237+
#define GPIO_I2C1_SCL (GPIO_I2C1_SCL_2|GPIO_SPEED_LOW) /* PB8 */
238+
#define GPIO_I2C1_SDA (GPIO_I2C1_SDA_2|GPIO_SPEED_LOW) /* PB9 */
233239

234240
/* I2C2 */
235241

boards/arm/stm32f0l0g0/nucleo-f091rc/configs/nsh/defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# CONFIG_NSH_DISABLE_EXIT is not set
2121
# CONFIG_NSH_DISABLE_HEXDUMP is not set
2222
# CONFIG_NSH_DISABLE_XD is not set
23+
# CONFIG_STM32F0G0L0_USE_LEGACY_PINMAP is not set
2324
CONFIG_ARCH="arm"
2425
CONFIG_ARCH_BOARD="nucleo-f091rc"
2526
CONFIG_ARCH_BOARD_NUCLEO_F091RC=y

boards/arm/stm32f0l0g0/nucleo-f091rc/configs/sx127x/defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#
88
# CONFIG_LIBC_LONG_LONG is not set
99
# CONFIG_NSH_ARGCAT is not set
10+
# CONFIG_STM32F0G0L0_USE_LEGACY_PINMAP is not set
1011
CONFIG_ARCH="arm"
1112
CONFIG_ARCH_BOARD="nucleo-f091rc"
1213
CONFIG_ARCH_BOARD_NUCLEO_F091RC=y

0 commit comments

Comments
 (0)