From 293eb22d624729b3d7e99ba3a7f5a516123a456d Mon Sep 17 00:00:00 2001 From: Fabrice DJIATSA Date: Wed, 11 Sep 2024 16:19:00 +0200 Subject: [PATCH] boards: st: add adc node in dts file and update docs -enable adc in nucleo_u031r8, stm32u083c_dk and nucleo_u083rc - add adc as new supported interface in docs - update yaml files Signed-off-by: Fabrice DJIATSA --- boards/st/nucleo_u031r8/doc/index.rst | 3 +++ boards/st/nucleo_u031r8/nucleo_u031r8.dts | 9 +++++++++ boards/st/nucleo_u031r8/nucleo_u031r8.yaml | 1 + boards/st/nucleo_u083rc/doc/index.rst | 2 ++ boards/st/nucleo_u083rc/nucleo_u083rc.dts | 11 +++++++++++ boards/st/nucleo_u083rc/nucleo_u083rc.yaml | 1 + boards/st/stm32u083c_dk/doc/index.rst | 2 ++ boards/st/stm32u083c_dk/stm32u083c_dk.dts | 11 +++++++++++ boards/st/stm32u083c_dk/stm32u083c_dk.yaml | 1 + 9 files changed, 41 insertions(+) diff --git a/boards/st/nucleo_u031r8/doc/index.rst b/boards/st/nucleo_u031r8/doc/index.rst index 596b887ff9b496..7b1aef56a4e2c2 100644 --- a/boards/st/nucleo_u031r8/doc/index.rst +++ b/boards/st/nucleo_u031r8/doc/index.rst @@ -140,6 +140,8 @@ The Zephyr _nucleo_u031r8_ board configuration supports the following hardware f +-----------+------------+-------------------------------------+ | NVIC | on-chip | nested vector interrupt controller | +-----------+------------+-------------------------------------+ +| ADC | on-chip | adc | ++-----------+------------+-------------------------------------+ | DAC | on-chip | DAC Controller | +-----------+------------+-------------------------------------+ | I2C | on-chip | i2c | @@ -147,6 +149,7 @@ The Zephyr _nucleo_u031r8_ board configuration supports the following hardware f | PWM | on-chip | pwm | +-----------+------------+-------------------------------------+ + Other hardware features are not yet supported on this Zephyr port. The default configuration can be found in the defconfig file: diff --git a/boards/st/nucleo_u031r8/nucleo_u031r8.dts b/boards/st/nucleo_u031r8/nucleo_u031r8.dts index bc4811283a4d4b..46e29de3bfef98 100644 --- a/boards/st/nucleo_u031r8/nucleo_u031r8.dts +++ b/boards/st/nucleo_u031r8/nucleo_u031r8.dts @@ -102,6 +102,15 @@ clock-frequency = ; }; +&adc1 { + pinctrl-0 = <&adc1_in0_pc0 &adc1_in1_pc1>; + pinctrl-names = "default"; + st,adc-clock-source = ; + st,adc-prescaler = <4>; + status = "okay"; + vref-mv = <3300>; +}; + &timers1 { st,prescaler = <10000>; status = "okay"; diff --git a/boards/st/nucleo_u031r8/nucleo_u031r8.yaml b/boards/st/nucleo_u031r8/nucleo_u031r8.yaml index 612b1670c248ef..54870420bb3a65 100644 --- a/boards/st/nucleo_u031r8/nucleo_u031r8.yaml +++ b/boards/st/nucleo_u031r8/nucleo_u031r8.yaml @@ -6,6 +6,7 @@ toolchain: - zephyr supported: - arduino_gpio + - adc - dac - gpio - i2c diff --git a/boards/st/nucleo_u083rc/doc/index.rst b/boards/st/nucleo_u083rc/doc/index.rst index 5a0b041d6a9b14..e71e36ee8edb19 100644 --- a/boards/st/nucleo_u083rc/doc/index.rst +++ b/boards/st/nucleo_u083rc/doc/index.rst @@ -146,6 +146,8 @@ The Zephyr nucleo_u083rc board configuration supports the following hardware fea | UART | on-chip | serial port-polling; | | | | serial port-interrupt | +-----------+------------+-------------------------------------+ +| ADC | on-chip | adc | ++-----------+------------+-------------------------------------+ | DAC | on-chip | DAC Controller | +-----------+------------+-------------------------------------+ | I2C | on-chip | i2c | diff --git a/boards/st/nucleo_u083rc/nucleo_u083rc.dts b/boards/st/nucleo_u083rc/nucleo_u083rc.dts index bc090f5b94222c..dc3493fa13ada8 100644 --- a/boards/st/nucleo_u083rc/nucleo_u083rc.dts +++ b/boards/st/nucleo_u083rc/nucleo_u083rc.dts @@ -102,6 +102,17 @@ clock-frequency = ; }; +&adc1 { + pinctrl-0 = <&adc1_in0_pc0 &adc1_in1_pc1>; + pinctrl-names = "default"; + st,adc-clock-source = ; + clocks = <&rcc STM32_CLOCK_BUS_APB1_2 0x00100000>, + <&rcc STM32_SRC_HSI ADC_SEL(2)>; + st,adc-prescaler = <4>; + status = "okay"; + vref-mv = <3300>; +}; + &timers1 { st,prescaler = <10000>; status = "okay"; diff --git a/boards/st/nucleo_u083rc/nucleo_u083rc.yaml b/boards/st/nucleo_u083rc/nucleo_u083rc.yaml index 440afad306eee5..c4ddc5071c0970 100644 --- a/boards/st/nucleo_u083rc/nucleo_u083rc.yaml +++ b/boards/st/nucleo_u083rc/nucleo_u083rc.yaml @@ -7,6 +7,7 @@ toolchain: - gnuarmemb - xtools supported: + - adc - arduino_gpio - dac - gpio diff --git a/boards/st/stm32u083c_dk/doc/index.rst b/boards/st/stm32u083c_dk/doc/index.rst index b8527d20e862a5..25c632e1d4d9a6 100644 --- a/boards/st/stm32u083c_dk/doc/index.rst +++ b/boards/st/stm32u083c_dk/doc/index.rst @@ -159,6 +159,8 @@ The Zephyr stm32u083c_dk board configuration supports the following hardware fea | UART | on-chip | serial port-polling; | | | | serial port-interrupt | +-----------+------------+-------------------------------------+ +| ADC | on-chip | adc | ++-----------+------------+-------------------------------------+ | DAC | on-chip | DAC Controller | +-----------+------------+-------------------------------------+ | I2C | on-chip | i2c | diff --git a/boards/st/stm32u083c_dk/stm32u083c_dk.dts b/boards/st/stm32u083c_dk/stm32u083c_dk.dts index 3e105b7935bc86..6bf36bc3c87a4e 100644 --- a/boards/st/stm32u083c_dk/stm32u083c_dk.dts +++ b/boards/st/stm32u083c_dk/stm32u083c_dk.dts @@ -72,6 +72,17 @@ apb1-prescaler = <1>; }; +&adc1 { + pinctrl-0 = <&adc1_in0_pc0 &adc1_in1_pc1>; + pinctrl-names = "default"; + st,adc-clock-source = ; + clocks = <&rcc STM32_CLOCK_BUS_APB1_2 0x00100000>, + <&rcc STM32_SRC_HSI ADC_SEL(2)>; + st,adc-prescaler = <4>; + status = "okay"; + vref-mv = <3300>; +}; + &dac1 { status = "okay"; pinctrl-0 = <&dac1_out1_pa4>; diff --git a/boards/st/stm32u083c_dk/stm32u083c_dk.yaml b/boards/st/stm32u083c_dk/stm32u083c_dk.yaml index 4c8617ab78f8b5..56767fa5f5dc4a 100644 --- a/boards/st/stm32u083c_dk/stm32u083c_dk.yaml +++ b/boards/st/stm32u083c_dk/stm32u083c_dk.yaml @@ -7,6 +7,7 @@ toolchain: - gnuarmemb - xtools supported: + - adc - arduino_gpio - dac - gpio