Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Some issues of GPIO interrupt

Hi, I have some questions about GPIO interrupt.

Now, I want to know the state of the pin, So I use the gpio_pin_read(PIN) to get the state. But when the pin is suspended, the value returned from gpio_pin_read(PIN) is uncentain. Actually, it must be low when pin is suspended. What can I do to get the right state?

Someone told me to config pull_cfg as pulldown. I tried it but not work. After configed as pulldown, gpio_pin_read(PIN) only got low.

And another question. Use GPIO interrupt, configed as LOTOHI.  Sometimes the pin changed from low to hign, there wasn't interrupt handling. I used the oscilloscope to check the pin state, it viewed low to high. This situation is accidental.

Parents Reply Children
Related