EcmaTC53 / spec

Ecma TC53 spec work
23 stars 9 forks source link

Can someone explain Digital.InputPullUpDown? #7

Closed dtex closed 3 years ago

dtex commented 3 years ago

PullUp and PullDown are known to me, but I'm not sure what this constant means.

I thought I knew, or at least thought I should know, but now that I really want to know Google is failing me.

phoddie commented 3 years ago

It is present to support MCUs which have a PullUpDown mode on GPIO. ESP32 was the motivation with GPIO_PULLUP_PULLDOWN.

dtex commented 3 years ago

That was the clue (search term) I needed. Found this:

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.