Page 1 of 1

[Answered] Meaning of GPIO_PULLUP_PULLDOWN

Posted: Wed Nov 02, 2016 5:32 am
by kolban
Looking at the GPIO API I see a function called gpio_set_pull_mode(). I'm wondering how to describe this function. For input, I can imagine no signal (floating input) being treated as high with "pull up" and low with "pull down". What then does the option GPIO_PULLUP_PULLDOWN mean?

Does this function have any semantics for GPIO pins flagged as "output"?

Re: Meaning of GPIO_PULLUP_PULLDOWN

Posted: Wed Dec 28, 2016 1:46 am
by kolban
*bump*

Re: Meaning of GPIO_PULLUP_PULLDOWN

Posted: Wed Dec 28, 2016 9:53 pm
by ESP_Angus
This took me a moment to understand as well, had to check with coworkers. Setting GPIO_PULLUP_PULLDOWN turns on both pull-up and pull-down resistors, which pulls the pin voltage to approximately VCC/2.

Not useful for digital GPIO functions, but you can use this to bias the input when sampling an analog signal.