Use uC hysteresis to evaluate signal
You could use a simple RC network.


Short the capacitor using the GPIO pin
Turn the GPIO to input
Measure the time for the input to reach a '1'
Use the RC time constant to calculate the input voltage


Temperature variation of the GPIO pin threshold is up to you to discover, but hysteresis does not enter into it. You are only using the positive threshold value. 







simulate this circuit &ndash; Schematic created using CircuitLab