Skip to content

Commit 8bda26b

Browse files
cybertalenashif
authored andcommitted
test: driver: adc: add some nucleo boards support for adc test cases
Some configuration for the boards have to be added into test_adc.c file so user can test driver with the test cases. Several nucleo boards are added including F091RC/F103RB/F207ZG/F302R8/F401RE/F746ZG/L073RZ/L476RG. And also ADC dts and pinmux configuration are added into boards own pinmux.c and dts file. Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
1 parent 7c7db00 commit 8bda26b

File tree

17 files changed

+88
-2
lines changed

17 files changed

+88
-2
lines changed

boards/arm/nucleo_f091rc/nucleo_f091rc.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,7 @@ arduino_spi: &spi1 {
9393
};
9494
};
9595
};
96+
97+
&adc1 {
98+
status = "ok";
99+
};

boards/arm/nucleo_f091rc/pinmux.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ static const struct pin_config pinconf[] = {
4040
{STM32_PIN_PB14, STM32F0_PINMUX_FUNC_PB14_SPI2_MISO},
4141
{STM32_PIN_PB15, STM32F0_PINMUX_FUNC_PB15_SPI2_MOSI},
4242
#endif /* CONFIG_SPI_2 */
43+
#ifdef CONFIG_ADC_1
44+
{STM32_PIN_PA0, STM32F0_PINMUX_FUNC_PA0_ADC_IN0},
45+
#endif /* CONFIG_ADC_1 */
4346
};
4447

4548
static int pinmux_stm32_init(struct device *port)

boards/arm/nucleo_f103rb/nucleo_f103rb.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,7 @@ arduino_spi: &spi1 {
7878
&iwdg {
7979
status = "ok";
8080
};
81+
82+
&adc1 {
83+
status = "ok";
84+
};

boards/arm/nucleo_f103rb/pinmux.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ static const struct pin_config pinconf[] = {
4141
{STM32_PIN_PB14, STM32F1_PINMUX_FUNC_PB14_SPI2_MASTER_MISO},
4242
{STM32_PIN_PB15, STM32F1_PINMUX_FUNC_PB15_SPI2_MASTER_MOSI},
4343
#endif /* CONFIG_SPI_2 */
44+
#ifdef CONFIG_ADC_1
45+
{STM32_PIN_PA0, STM32F1_PINMUX_FUNC_PA0_ADC123_IN0},
46+
#endif /* CONFIG_ADC_1 */
4447
};
4548

4649
static int pinmux_stm32_init(struct device *port)

boards/arm/nucleo_f207zg/nucleo_f207zg.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,7 @@ arduino_serial: &usart6 {};
7272
&iwdg {
7373
status = "ok";
7474
};
75+
76+
&adc1 {
77+
status = "ok";
78+
};

boards/arm/nucleo_f207zg/pinmux.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ static const struct pin_config pinconf[] = {
3939
{STM32_PIN_PA11, STM32F2_PINMUX_FUNC_PA11_OTG_FS_DM},
4040
{STM32_PIN_PA12, STM32F2_PINMUX_FUNC_PA12_OTG_FS_DP},
4141
#endif /* CONFIG_USB_DC_STM32 */
42+
#ifdef CONFIG_ADC_1
43+
{STM32_PIN_PA0, STM32F2_PINMUX_FUNC_PA0_ADC123_IN0},
44+
#endif /* CONFIG_ADC_1 */
4245
};
4346

4447
static int pinmux_stm32_init(struct device *port)

boards/arm/nucleo_f302r8/nucleo_f302r8.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,7 @@ arduino_spi: &spi2 {};
8282
&rtc {
8383
status = "ok";
8484
};
85+
86+
&adc1 {
87+
status = "ok";
88+
};

boards/arm/nucleo_f302r8/pinmux.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ static const struct pin_config pinconf[] = {
3939
#ifdef CONFIG_PWM_STM32_2
4040
{STM32_PIN_PA0, STM32F3_PINMUX_FUNC_PA0_PWM2_CH1},
4141
#endif /* CONFIG_PWM_STM32_2 */
42+
#ifdef CONFIG_ADC_1
43+
{STM32_PIN_PA0, STM32F3_PINMUX_FUNC_PA0_ADC1_IN1},
44+
#endif /* CONFIG_ADC_1 */
4245
};
4346

4447
static int pinmux_stm32_init(struct device *port)

boards/arm/nucleo_f401re/nucleo_f401re.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,7 @@ arduino_spi: &spi1 {
117117
&rtc {
118118
status = "ok";
119119
};
120+
121+
&adc1 {
122+
status = "ok";
123+
};

boards/arm/nucleo_f401re/pinmux.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ static const struct pin_config pinconf[] = {
4141
{STM32_PIN_PB14, STM32F4_PINMUX_FUNC_PB14_SPI2_MISO},
4242
{STM32_PIN_PB15, STM32F4_PINMUX_FUNC_PB15_SPI2_MOSI},
4343
#endif /* CONFIG_SPI_1 */
44+
#ifdef CONFIG_ADC_1
45+
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_ADC123_IN0},
46+
#endif /* CONFIG_ADC_1 */
4447
};
4548

4649
static int pinmux_stm32_init(struct device *port)

0 commit comments

Comments
 (0)