STM32G0 [ADC-LL]: Some bugs in stm32g0xx_ll_adc.c
I think, there are some bugs in stm32g0xx_ll_adc.c.
In the function LL_ADC_REG_Init() is the statement "LL_ADC_REG_SetSequencerLength(ADCx, ADC_REG_InitStruct->SequencerLength) [line 713] outside of the parentheses.
I think, it should be inside the last one [move it two lines up], because the sequencer length could only be written if LL_ADC_REG_SEQ_FIXED is not set.
Setting the length in fixed sequencer mode modifies the channel selection because of the the dual mode useage of register ADC_CHSELR.
---------------------------
Another problem in the same context:
CubeMX generates a statement like LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(ADC1), LL_ADC_CHANNEL_VREFINT|LL_ADC_CHANNEL_TEMPSENSOR) if you add the two internal channels (Vref and temperature) to the ADC sequence.
I think, the parameters for the function call are wrong.
It works with LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(ADC1), LL_ADC_PATH_INTERNAL_VREFINT|LL_ADC_PATH_INTERNAL_TEMPSENSOR).
Please see the difference between LL_ADC_CHANNEL and LL_ADC_PATH.