cancel
Showing results for 
Search instead for 
Did you mean: 

Read GPIO Analog

NASI
Senior

Hello,

I set one of GPIO to Analog mode and I want to read its value, by using HAL library.

Should I just use HAL_GPIO_ReadPin to read the value?

Thank you.

10 REPLIES 10

The GPIO analogue option is not to be confused with an ADC input, but in principle has two functions:

  • Disconnecting the external pin from the digital function. This is useful, for example, to disconnect the Schmitt trigger present at the digital input from a floating input, because this can lead to high-frequency switching of this trigger with associated current consumption.
  • Connecting any analogue peripherals (e.g. opamp, comparator, ADC) that may be present, but do not necessarily have to be in the respective case.

from

https://community.st.com/t5/stm32-mcus-products/use-gpio-analog-for-adc-read-value-on-stm32h735/td-p/75324

 

If you feel a post has answered your question, please click "Accept as Solution".