Is there a function to read the Vrefint_cal in Cubes HAL libraries? I'm using the F3xx. I'd like to measure the supply voltage of the micro. The formula given in the reference manual is:

$\Large VDDA = 3.3V \times \frac{Vrefint_{cal}}{Vrefint_{data}}$

I've been searching through HAL (cube) and couldn't find a method to return the Vrefint_cal. The datasheet says that it is at 0x1FFF F7BA - 0x1FFF F7BB, but I find it silly that there wouldn't be a method to read it directly.

One simple way is the following:

#define VREFINT_CAL_ADDR    0x1FFFF7BA

uint16_t vrefint_cal;                        // VREFINT calibration value


Or a more general is to simply create a pointer and assign 0x1FFFF7BA to it, and then the rest is the same.

#define VREFINT_CAL_ADDR ((uint16_t*)((uint32_t)0x1FFFF7BA))


And then, for example:

Vdd = 3300*(*VREFINT_CAL_ADDR)/ADC_raw;


Where Vdd and ADC_raw are uint16_t.