diff --git a/drivers/adc/adc_stm32.c b/drivers/adc/adc_stm32.c index 6c3ea75ed39be..677c5101675e0 100644 --- a/drivers/adc/adc_stm32.c +++ b/drivers/adc/adc_stm32.c @@ -86,8 +86,8 @@ LOG_MODULE_REGISTER(adc_stm32); #define ASYNC 2 /* Sequencer type */ -#define NOT_FULLY_CONFIGURABLE 0 -#define FULLY_CONFIGURABLE 1 +#define SEQUENCER_FIXED 0 +#define SEQUENCER_PROGRAMMABLE 1 /* Oversampler type */ #define OVERSAMPLER_NONE 0 @@ -107,17 +107,17 @@ LOG_MODULE_REGISTER(adc_stm32); #define ANY_ADC_SEQUENCER_TYPE_IS(value) \ (DT_INST_FOREACH_STATUS_OKAY_VARGS(IS_EQ_STRING_PROP, \ st_adc_sequencer,\ - value) 0) + value, SEQUENCER_) 0) #define ANY_ADC_OVERSAMPLER_TYPE_IS(value) \ (DT_INST_FOREACH_STATUS_OKAY_VARGS(IS_EQ_STRING_PROP, \ st_adc_oversampler,\ - value) 0) + value, OVERSAMPLER_) 0) #define ANY_ADC_INTERNAL_REGULATOR_TYPE_IS(value) \ (DT_INST_FOREACH_STATUS_OKAY_VARGS(IS_EQ_STRING_PROP, \ st_adc_internal_regulator,\ - value) 0) + value, INTERNAL_REGULATOR_) 0) #define ANY_ADC_HAS_DEEP_POWERDOWN \ (DT_INST_FOREACH_STATUS_OKAY_VARGS(IS_EQ_PROP_OR, \ @@ -145,13 +145,13 @@ LOG_MODULE_REGISTER(adc_stm32); #define IS_EQ_NODE_PROP_OR(node, prop, default_value, compare_value) \ IS_EQ(DT_PROP_OR(node, prop, default_value), compare_value) || -#define IS_EQ_STRING_PROP(inst, prop, compare_value) \ - IS_EQ(DT_INST_STRING_UPPER_TOKEN(inst, prop), compare_value) || +#define IS_EQ_STRING_PROP(inst, prop, compare_value, prefix) \ + IS_EQ(CONCAT(prefix, DT_INST_STRING_UPPER_TOKEN(inst, prop)), compare_value) || /* reference voltage for the ADC */ #define STM32_ADC_VREF_MV DT_INST_PROP(0, vref_mv) -#if ANY_ADC_SEQUENCER_TYPE_IS(FULLY_CONFIGURABLE) +#if ANY_ADC_SEQUENCER_TYPE_IS(SEQUENCER_PROGRAMMABLE) #if defined(LL_ADC_REG_RANK_28) #define MAX_RANK 28 @@ -172,7 +172,7 @@ static const uint32_t table_seq_len[] = { LISTIFY(UTIL_DEC(MAX_RANK), SEQ_LEN, (,)) }; -#endif /* ANY_ADC_SEQUENCER_TYPE_IS(FULLY_CONFIGURABLE) */ +#endif /* ANY_ADC_SEQUENCER_TYPE_IS(SEQUENCER_PROGRAMMABLE) */ /* Number of different sampling time values */ #define STM32_NB_SAMPLING_TIME 8 @@ -946,8 +946,8 @@ static int set_sequencer(const struct device *dev) channels_mask |= channel; -#if ANY_ADC_SEQUENCER_TYPE_IS(FULLY_CONFIGURABLE) - if (config->sequencer_type == FULLY_CONFIGURABLE) { +#if ANY_ADC_SEQUENCER_TYPE_IS(SEQUENCER_PROGRAMMABLE) + if (config->sequencer_type == SEQUENCER_PROGRAMMABLE) { #if ANY_ADC_HAS_CHANNEL_PRESELECTION if (config->has_channel_preselection) { /* @@ -961,11 +961,11 @@ static int set_sequencer(const struct device *dev) LL_ADC_REG_SetSequencerRanks(adc, table_rank[channel_index], channel); LL_ADC_REG_SetSequencerLength(adc, table_seq_len[channel_index]); } -#endif /* ANY_ADC_SEQUENCER_TYPE_IS(FULLY_CONFIGURABLE) */ +#endif /* ANY_ADC_SEQUENCER_TYPE_IS(SEQUENCER_PROGRAMMABLE) */ } -#if ANY_ADC_SEQUENCER_TYPE_IS(NOT_FULLY_CONFIGURABLE) - if (config->sequencer_type == NOT_FULLY_CONFIGURABLE) { +#if ANY_ADC_SEQUENCER_TYPE_IS(SEQUENCER_FIXED) + if (config->sequencer_type == SEQUENCER_FIXED) { LL_ADC_REG_SetSequencerChannels(adc, channels_mask); #ifdef LL_ADC_FLAG_CCRDY @@ -978,7 +978,7 @@ static int set_sequencer(const struct device *dev) LL_ADC_ClearFlag_CCRDY(adc); #endif /* LL_ADC_FLAG_CCRDY */ } -#endif /* ANY_ADC_SEQUENCER_TYPE_IS(NOT_FULLY_CONFIGURABLE) */ +#endif /* ANY_ADC_SEQUENCER_TYPE_IS(SEQUENCER_FIXED) */ #if DT_HAS_COMPAT_STATUS_OKAY(st_stm32f1_adc) || \ DT_HAS_COMPAT_STATUS_OKAY(st_stm32f4_adc) @@ -1006,12 +1006,12 @@ static int start_read(const struct device *dev, return -EINVAL; } -#if ANY_ADC_SEQUENCER_TYPE_IS(FULLY_CONFIGURABLE) +#if ANY_ADC_SEQUENCER_TYPE_IS(SEQUENCER_PROGRAMMABLE) if (data->channel_count > ARRAY_SIZE(table_seq_len)) { LOG_ERR("Too many channels for sequencer. Max: %d", ARRAY_SIZE(table_seq_len)); return -EINVAL; } -#endif /* ANY_ADC_SEQUENCER_TYPE_IS(FULLY_CONFIGURABLE) */ +#endif /* ANY_ADC_SEQUENCER_TYPE_IS(SEQUENCER_PROGRAMMABLE) */ #if DT_HAS_COMPAT_STATUS_OKAY(st_stm32f1_adc) && !defined(CONFIG_ADC_STM32_DMA) /* Multiple samplings is only supported with DMA for F1 */ @@ -1974,8 +1974,10 @@ static const struct adc_stm32_cfg adc_stm32_cfg_##index = { \ .clk_prescaler = ADC_STM32_DT_PRESC(index), \ .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(index), \ .differential_channels_used = (ANY_CHILD_NODE_IS_DIFFERENTIAL(index) > 0), \ - .sequencer_type = DT_INST_STRING_UPPER_TOKEN(index, st_adc_sequencer), \ - .oversampler_type = DT_INST_STRING_UPPER_TOKEN(index, st_adc_oversampler), \ + .sequencer_type = CONCAT(SEQUENCER_, \ + DT_INST_STRING_UPPER_TOKEN(index, st_adc_sequencer)), \ + .oversampler_type = CONCAT(OVERSAMPLER_, \ + DT_INST_STRING_UPPER_TOKEN(index, st_adc_oversampler)), \ .internal_regulator = CONCAT(INTERNAL_REGULATOR_, \ DT_INST_STRING_UPPER_TOKEN(index, st_adc_internal_regulator)), \ .has_deep_powerdown = DT_INST_PROP(index, st_adc_has_deep_powerdown), \ diff --git a/dts/arm/st/c0/stm32c0.dtsi b/dts/arm/st/c0/stm32c0.dtsi index c2c90b1e6735a..ae1a54ec779a9 100644 --- a/dts/arm/st/c0/stm32c0.dtsi +++ b/dts/arm/st/c0/stm32c0.dtsi @@ -466,8 +466,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <2 4 8 13 20 40 80 161>; num-sampling-time-common-channels = <2>; - st,adc-sequencer = "NOT_FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "fixed"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; status = "disabled"; }; diff --git a/dts/arm/st/f0/stm32f0.dtsi b/dts/arm/st/f0/stm32f0.dtsi index 20786641afd5b..f3f065b9e321e 100644 --- a/dts/arm/st/f0/stm32f0.dtsi +++ b/dts/arm/st/f0/stm32f0.dtsi @@ -354,8 +354,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <2 8 14 29 42 56 72 240>; num-sampling-time-common-channels = <1>; - st,adc-sequencer = "NOT_FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "fixed"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; diff --git a/dts/arm/st/f1/stm32f1.dtsi b/dts/arm/st/f1/stm32f1.dtsi index f217de25eb80d..24cbf2e706556 100644 --- a/dts/arm/st/f1/stm32f1.dtsi +++ b/dts/arm/st/f1/stm32f1.dtsi @@ -397,8 +397,8 @@ #io-channel-cells = <1>; resolutions = ; sampling-times = <2 8 14 29 42 56 72 240>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; diff --git a/dts/arm/st/f1/stm32f103Xc.dtsi b/dts/arm/st/f1/stm32f103Xc.dtsi index 2304a8cf2ee6d..951e004e26e8a 100644 --- a/dts/arm/st/f1/stm32f103Xc.dtsi +++ b/dts/arm/st/f1/stm32f103Xc.dtsi @@ -137,8 +137,8 @@ #io-channel-cells = <1>; resolutions = ; sampling-times = <2 8 14 29 42 56 72 240>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; @@ -151,8 +151,8 @@ #io-channel-cells = <1>; resolutions = ; sampling-times = <2 8 14 29 42 56 72 240>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; diff --git a/dts/arm/st/f2/stm32f2.dtsi b/dts/arm/st/f2/stm32f2.dtsi index 03deb03f305b6..2b4ef0cb1e870 100644 --- a/dts/arm/st/f2/stm32f2.dtsi +++ b/dts/arm/st/f2/stm32f2.dtsi @@ -377,8 +377,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <3 15 28 58 84 112 144 480>; st,adc-clock-source = "SYNC"; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; diff --git a/dts/arm/st/f3/stm32f302.dtsi b/dts/arm/st/f3/stm32f302.dtsi index c372239f871d8..16817166e9c8c 100644 --- a/dts/arm/st/f3/stm32f302.dtsi +++ b/dts/arm/st/f3/stm32f302.dtsi @@ -118,8 +118,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <2 3 5 8 20 62 182 602>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-differential-support; status = "disabled"; diff --git a/dts/arm/st/f3/stm32f303.dtsi b/dts/arm/st/f3/stm32f303.dtsi index 774fd58a50a43..4095a3ee62095 100644 --- a/dts/arm/st/f3/stm32f303.dtsi +++ b/dts/arm/st/f3/stm32f303.dtsi @@ -154,8 +154,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <2 3 5 8 20 62 182 602>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-differential-support; status = "disabled"; @@ -173,8 +173,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <2 3 5 8 20 62 182 602>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-differential-support; status = "disabled"; diff --git a/dts/arm/st/f3/stm32f334.dtsi b/dts/arm/st/f3/stm32f334.dtsi index 94869728add13..42041afb05710 100644 --- a/dts/arm/st/f3/stm32f334.dtsi +++ b/dts/arm/st/f3/stm32f334.dtsi @@ -93,8 +93,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <2 3 5 8 20 62 182 602>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-differential-support; status = "disabled"; diff --git a/dts/arm/st/f3/stm32f373.dtsi b/dts/arm/st/f3/stm32f373.dtsi index 6909013d3a13b..a0336339d6420 100644 --- a/dts/arm/st/f3/stm32f373.dtsi +++ b/dts/arm/st/f3/stm32f373.dtsi @@ -258,8 +258,8 @@ #io-channel-cells = <1>; resolutions = ; sampling-times = <2 8 14 29 42 56 72 240>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; diff --git a/dts/arm/st/f4/stm32f4.dtsi b/dts/arm/st/f4/stm32f4.dtsi index 7771357d90394..68e23f1a9179e 100644 --- a/dts/arm/st/f4/stm32f4.dtsi +++ b/dts/arm/st/f4/stm32f4.dtsi @@ -562,8 +562,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <3 15 28 56 84 112 144 480>; st,adc-clock-source = "SYNC"; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; diff --git a/dts/arm/st/f4/stm32f405.dtsi b/dts/arm/st/f4/stm32f405.dtsi index 8f725c62401c2..f87b1f0fafe19 100644 --- a/dts/arm/st/f4/stm32f405.dtsi +++ b/dts/arm/st/f4/stm32f405.dtsi @@ -264,8 +264,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <3 15 28 56 84 112 144 480>; st,adc-clock-source = "SYNC"; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; @@ -282,8 +282,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <3 15 28 56 84 112 144 480>; st,adc-clock-source = "SYNC"; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; diff --git a/dts/arm/st/f4/stm32f446.dtsi b/dts/arm/st/f4/stm32f446.dtsi index a0e2bfebe21ef..1b598f0d9f605 100644 --- a/dts/arm/st/f4/stm32f446.dtsi +++ b/dts/arm/st/f4/stm32f446.dtsi @@ -124,8 +124,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <3 15 28 56 84 112 144 480>; st,adc-clock-source = "SYNC"; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; @@ -142,8 +142,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <3 15 28 56 84 112 144 480>; st,adc-clock-source = "SYNC"; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; diff --git a/dts/arm/st/f7/stm32f7.dtsi b/dts/arm/st/f7/stm32f7.dtsi index 6b7c7cea84afe..b0801632b2151 100644 --- a/dts/arm/st/f7/stm32f7.dtsi +++ b/dts/arm/st/f7/stm32f7.dtsi @@ -819,8 +819,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <3 15 28 56 84 112 144 480>; st,adc-clock-source = "SYNC"; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; @@ -837,8 +837,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <3 15 28 56 84 112 144 480>; st,adc-clock-source = "SYNC"; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; @@ -855,8 +855,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <3 15 28 56 84 112 144 480>; st,adc-clock-source = "SYNC"; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; diff --git a/dts/arm/st/g0/stm32g0.dtsi b/dts/arm/st/g0/stm32g0.dtsi index ecd3183eab61a..76da6baf98806 100644 --- a/dts/arm/st/g0/stm32g0.dtsi +++ b/dts/arm/st/g0/stm32g0.dtsi @@ -455,8 +455,8 @@ */ sampling-times = <3 5 8 13 20 40 80 161>; num-sampling-time-common-channels = <2>; - st,adc-sequencer = "NOT_FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "fixed"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; status = "disabled"; }; diff --git a/dts/arm/st/g4/stm32g4.dtsi b/dts/arm/st/g4/stm32g4.dtsi index 3a448a2dde4b6..33e64fc7e8015 100644 --- a/dts/arm/st/g4/stm32g4.dtsi +++ b/dts/arm/st/g4/stm32g4.dtsi @@ -118,8 +118,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-deep-powerdown; st,adc-has-differential-support; @@ -137,8 +137,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-deep-powerdown; st,adc-has-differential-support; diff --git a/dts/arm/st/g4/stm32g473.dtsi b/dts/arm/st/g4/stm32g473.dtsi index ac4980ccc8f60..a4e4e56b4a2cf 100644 --- a/dts/arm/st/g4/stm32g473.dtsi +++ b/dts/arm/st/g4/stm32g473.dtsi @@ -46,8 +46,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-deep-powerdown; st,adc-has-differential-support; @@ -65,8 +65,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-deep-powerdown; st,adc-has-differential-support; diff --git a/dts/arm/st/g4/stm32g491.dtsi b/dts/arm/st/g4/stm32g491.dtsi index a27157f393f0a..6f4af9dc27c64 100644 --- a/dts/arm/st/g4/stm32g491.dtsi +++ b/dts/arm/st/g4/stm32g491.dtsi @@ -72,8 +72,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-deep-powerdown; st,adc-has-differential-support; diff --git a/dts/arm/st/h5/stm32h5.dtsi b/dts/arm/st/h5/stm32h5.dtsi index d647a1f500868..caecef6ee73f1 100644 --- a/dts/arm/st/h5/stm32h5.dtsi +++ b/dts/arm/st/h5/stm32h5.dtsi @@ -319,8 +319,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-deep-powerdown; st,adc-has-differential-support; diff --git a/dts/arm/st/h5/stm32h562.dtsi b/dts/arm/st/h5/stm32h562.dtsi index c095de96bb9df..fcf4e4958e896 100644 --- a/dts/arm/st/h5/stm32h562.dtsi +++ b/dts/arm/st/h5/stm32h562.dtsi @@ -306,8 +306,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-deep-powerdown; st,adc-has-differential-support; diff --git a/dts/arm/st/h7/stm32h7.dtsi b/dts/arm/st/h7/stm32h7.dtsi index a6bfa75d5505e..f7d7d2d356a40 100644 --- a/dts/arm/st/h7/stm32h7.dtsi +++ b/dts/arm/st/h7/stm32h7.dtsi @@ -921,8 +921,8 @@ STM32_ADC_RES(10, 0x03) STM32_ADC_RES(8, 0x07)>; sampling-times = <2 3 9 17 33 65 388 811>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_EXTENDED"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "extended"; st,adc-internal-regulator = "startup-hw-status"; st,adc-has-deep-powerdown; st,adc-has-channel-preselection; @@ -942,8 +942,8 @@ STM32_ADC_RES(10, 0x03) STM32_ADC_RES(8, 0x07)>; sampling-times = <2 3 9 17 33 65 388 811>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_EXTENDED"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "extended"; st,adc-internal-regulator = "startup-hw-status"; st,adc-has-deep-powerdown; st,adc-has-channel-preselection; @@ -964,8 +964,8 @@ STM32_ADC_RES(10, 0x03) STM32_ADC_RES(8, 0x07)>; sampling-times = <2 3 9 17 33 65 388 811>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_EXTENDED"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "extended"; st,adc-internal-regulator = "startup-hw-status"; st,adc-has-deep-powerdown; st,adc-has-channel-preselection; @@ -985,8 +985,8 @@ STM32_ADC_RES(10, 0x03) STM32_ADC_RES(8, 0x07)>; sampling-times = <2 3 9 17 33 65 388 811>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_EXTENDED"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "extended"; st,adc-internal-regulator = "startup-hw-status"; st,adc-has-deep-powerdown; st,adc-has-channel-preselection; diff --git a/dts/arm/st/h7/stm32h723.dtsi b/dts/arm/st/h7/stm32h723.dtsi index 6806c3ecbf28a..e3de51f44b506 100644 --- a/dts/arm/st/h7/stm32h723.dtsi +++ b/dts/arm/st/h7/stm32h723.dtsi @@ -53,7 +53,7 @@ STM32H72X_ADC3_RES(8, 0x02) STM32H72X_ADC3_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; }; diff --git a/dts/arm/st/h7rs/stm32h7rs.dtsi b/dts/arm/st/h7rs/stm32h7rs.dtsi index 2bf3d5abfb58b..15196f69af2d1 100644 --- a/dts/arm/st/h7rs/stm32h7rs.dtsi +++ b/dts/arm/st/h7rs/stm32h7rs.dtsi @@ -818,8 +818,8 @@ STM32_ADC_RES(8, 0x2) STM32_ADC_RES(6, 0x3)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-deep-powerdown; st,adc-has-differential-support; @@ -837,8 +837,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-deep-powerdown; st,adc-has-differential-support; diff --git a/dts/arm/st/l0/stm32l0.dtsi b/dts/arm/st/l0/stm32l0.dtsi index 684e7710937ab..1586e9fdd9091 100644 --- a/dts/arm/st/l0/stm32l0.dtsi +++ b/dts/arm/st/l0/stm32l0.dtsi @@ -329,8 +329,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <2 4 8 13 20 40 80 161>; num-sampling-time-common-channels = <1>; - st,adc-sequencer = "NOT_FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "fixed"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; status = "disabled"; }; diff --git a/dts/arm/st/l1/stm32l1.dtsi b/dts/arm/st/l1/stm32l1.dtsi index 208d4201ec107..60446a282a9f4 100644 --- a/dts/arm/st/l1/stm32l1.dtsi +++ b/dts/arm/st/l1/stm32l1.dtsi @@ -272,8 +272,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <4 9 16 24 48 96 192 384>; st,adc-clock-source = "ASYNC"; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_NONE"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "none"; st,adc-internal-regulator = "none"; status = "disabled"; }; diff --git a/dts/arm/st/l4/stm32l4.dtsi b/dts/arm/st/l4/stm32l4.dtsi index 95c3d7e770668..6ae72211a8096 100644 --- a/dts/arm/st/l4/stm32l4.dtsi +++ b/dts/arm/st/l4/stm32l4.dtsi @@ -432,8 +432,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-deep-powerdown; st,adc-has-differential-support; @@ -451,8 +451,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-deep-powerdown; st,adc-has-differential-support; diff --git a/dts/arm/st/l4/stm32l471.dtsi b/dts/arm/st/l4/stm32l471.dtsi index e1da8ce806de5..701b1febc6dfc 100644 --- a/dts/arm/st/l4/stm32l471.dtsi +++ b/dts/arm/st/l4/stm32l471.dtsi @@ -306,8 +306,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-deep-powerdown; st,adc-has-differential-support; diff --git a/dts/arm/st/l5/stm32l5.dtsi b/dts/arm/st/l5/stm32l5.dtsi index 18cdd5b67d8f0..3e31fb01c2eb3 100644 --- a/dts/arm/st/l5/stm32l5.dtsi +++ b/dts/arm/st/l5/stm32l5.dtsi @@ -721,8 +721,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-deep-powerdown; st,adc-has-differential-support; @@ -740,8 +740,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-deep-powerdown; st,adc-has-differential-support; diff --git a/dts/arm/st/n6/stm32n6.dtsi b/dts/arm/st/n6/stm32n6.dtsi index 1772aa49b73ba..3c5a2d560a005 100644 --- a/dts/arm/st/n6/stm32n6.dtsi +++ b/dts/arm/st/n6/stm32n6.dtsi @@ -443,8 +443,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <2 3 7 12 14 47 247 1500>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_EXTENDED"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "extended"; st,adc-internal-regulator = "none"; st,adc-has-deep-powerdown; st,adc-has-channel-preselection; @@ -462,8 +462,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <2 3 7 12 14 47 247 1500>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_EXTENDED"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "extended"; status = "disabled"; }; diff --git a/dts/arm/st/u0/stm32u0.dtsi b/dts/arm/st/u0/stm32u0.dtsi index f0982e83eee81..299407e58d2cc 100644 --- a/dts/arm/st/u0/stm32u0.dtsi +++ b/dts/arm/st/u0/stm32u0.dtsi @@ -292,8 +292,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <2 4 8 13 20 40 80 161>; num-sampling-time-common-channels = <2>; - st,adc-sequencer = "NOT_FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "fixed"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; status = "disabled"; }; diff --git a/dts/arm/st/u3/stm32u3.dtsi b/dts/arm/st/u3/stm32u3.dtsi index 1ac83c297bb79..5f5f97a7747b5 100644 --- a/dts/arm/st/u3/stm32u3.dtsi +++ b/dts/arm/st/u3/stm32u3.dtsi @@ -251,8 +251,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <2 3 7 12 24 47 247 1500>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_EXTENDED"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "extended"; st,adc-internal-regulator = "startup-hw-status"; st,adc-has-deep-powerdown; st,adc-has-channel-preselection; @@ -270,8 +270,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <2 3 7 12 24 47 247 1500>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_EXTENDED"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "extended"; st,adc-internal-regulator = "startup-hw-status"; st,adc-has-deep-powerdown; st,adc-has-channel-preselection; diff --git a/dts/arm/st/u5/stm32u5.dtsi b/dts/arm/st/u5/stm32u5.dtsi index c59917063ff72..3f9106d89ca0e 100644 --- a/dts/arm/st/u5/stm32u5.dtsi +++ b/dts/arm/st/u5/stm32u5.dtsi @@ -823,8 +823,8 @@ STM32_ADC_RES(8, 0x03)>; sampling-times = <5 6 12 20 36 68 391 814>; st,adc-clock-source = "ASYNC"; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_EXTENDED"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "extended"; st,adc-internal-regulator = "startup-hw-status"; st,adc-has-deep-powerdown; st,adc-has-channel-preselection; @@ -846,8 +846,8 @@ sampling-times = <2 4 8 13 20 40 80 815>; num-sampling-time-common-channels = <2>; st,adc-clock-source = "ASYNC"; - st,adc-sequencer = "NOT_FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "fixed"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-hw-status"; status = "disabled"; }; diff --git a/dts/arm/st/u5/stm32u595.dtsi b/dts/arm/st/u5/stm32u595.dtsi index 28b09d0ffc5e3..1d84a0b2f8fa8 100644 --- a/dts/arm/st/u5/stm32u595.dtsi +++ b/dts/arm/st/u5/stm32u595.dtsi @@ -84,8 +84,8 @@ STM32_ADC_RES(8, 0x03)>; sampling-times = <5 6 12 20 36 68 391 814>; st,adc-clock-source = "ASYNC"; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_EXTENDED"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "extended"; st,adc-internal-regulator = "startup-hw-status"; st,adc-has-deep-powerdown; st,adc-has-channel-preselection; @@ -109,8 +109,8 @@ STM32_ADC_RES(8, 0x03)>; sampling-times = <5 6 12 20 36 68 391 814>; st,adc-clock-source = "ASYNC"; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_EXTENDED"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "extended"; st,adc-internal-regulator = "startup-hw-status"; st,adc-has-deep-powerdown; st,adc-has-channel-preselection; diff --git a/dts/arm/st/wb/stm32wb.dtsi b/dts/arm/st/wb/stm32wb.dtsi index 210d551f49b2b..34e62cc81087d 100644 --- a/dts/arm/st/wb/stm32wb.dtsi +++ b/dts/arm/st/wb/stm32wb.dtsi @@ -431,8 +431,8 @@ STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)>; sampling-times = <3 7 13 25 48 93 248 641>; - st,adc-sequencer = "FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "programmable"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; st,adc-has-differential-support; st,adc-has-deep-powerdown; diff --git a/dts/arm/st/wba/stm32wba.dtsi b/dts/arm/st/wba/stm32wba.dtsi index 5ba50bec97553..f509d0fd9caf4 100644 --- a/dts/arm/st/wba/stm32wba.dtsi +++ b/dts/arm/st/wba/stm32wba.dtsi @@ -502,8 +502,8 @@ sampling-times = <2 4 8 13 20 40 80 815>; num-sampling-time-common-channels = <2>; st,adc-clock-source = "ASYNC"; - st,adc-sequencer = "NOT_FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "fixed"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-hw-status"; status = "disabled"; }; diff --git a/dts/arm/st/wl/stm32wl.dtsi b/dts/arm/st/wl/stm32wl.dtsi index 1bb90f8fe80e8..d5149ecb67483 100644 --- a/dts/arm/st/wl/stm32wl.dtsi +++ b/dts/arm/st/wl/stm32wl.dtsi @@ -364,8 +364,8 @@ STM32_ADC_RES(6, 0x03)>; sampling-times = <2 4 8 13 20 40 80 161>; num-sampling-time-common-channels = <2>; - st,adc-sequencer = "NOT_FULLY_CONFIGURABLE"; - st,adc-oversampler = "OVERSAMPLER_MINIMAL"; + st,adc-sequencer = "fixed"; + st,adc-oversampler = "minimal"; st,adc-internal-regulator = "startup-sw-delay"; status = "disabled"; }; diff --git a/dts/bindings/adc/st,stm32-adc.yaml b/dts/bindings/adc/st,stm32-adc.yaml index 75fc57cfbb74c..fe2584ad4c847 100644 --- a/dts/bindings/adc/st,stm32-adc.yaml +++ b/dts/bindings/adc/st,stm32-adc.yaml @@ -97,25 +97,25 @@ properties: type: string required: true enum: - - "NOT_FULLY_CONFIGURABLE" - - "FULLY_CONFIGURABLE" + - "fixed" + - "programmable" description: | Type of ADC sequencer: - - "NOT_FULLY_CONFIGURABLE": Not fully configurable sequencer - - "FULLY_CONFIGURABLE": Fully configurable sequencer + - "fixed": Channels of a sequence are sampled from lowest to highest. + - "programmable": Channels of a sequence can be sampled in any order. st,adc-oversampler: type: string required: true enum: - - "OVERSAMPLER_NONE" - - "OVERSAMPLER_MINIMAL" - - "OVERSAMPLER_EXTENDED" + - "none" + - "minimal" + - "extended" description: | Type of ADC oversampler: - - "OVERSAMPLER_NONE": No oversampler - - "OVERSAMPLER_MINIMAL": Oversampler with 8 possible oversampling values (2, 4, 8, ..., 256) - - "OVERSAMPLER_EXTENDED": Oversampler with 1024 possible oversampling values (1..1024) + - "none": No oversampler + - "minimal": Oversampler with 8 possible oversampling values (2, 4, 8, ..., 256) + - "extended": Oversampler with 1024 possible oversampling values (1..1024) st,adc-internal-regulator: type: string