it is L476RG, I read the reference manual, I tried to read a 3.2v dc signal, I use
int digital_result = HAL_ADC_GetValue(&hadc1);
the vdda = 69 from the HAL_ADCEx_Calibration_GetValue function, digital_result=948; then I use formula float
real_volt=vdda/4095.0*digital_result; I got a 15.9v result, where am I wrong? it is 12 bit ADC and single-ended.
Another interesting thing is, this is 12 bit ADC, but HAL_ADC_GetValue return a uint32_t, so sometimes this return value is very large, such as 65505 for a 2.4v input, there is no offset so the data should be no-sign, shall I directly extract the 12 bits on the right (right-aligned)?