Hi!
Any way in Zephyr to read the current value of a GPIO pin that is configured as OUTPUT?
Thanks!
Pedro.
Hi!
Any way in Zephyr to read the current value of a GPIO pin that is configured as OUTPUT?
Thanks!
Pedro.
Hi,
You can use nrf_gpio_pin_out_read() to read the state of an output pin in the OUT register.
Hi Einar,
I'm using NCS v2.0.2, with Zephyr, so I use gpio_pin_get()
. The problem is when GPIO is configured as output, I can not use this function to read its current value.
How can I do this?
Thanks and kind regards,
Pedro.
Hi Pedro,
You are right, gpio_pin_get()
can only be used to read an input pin. That is why I suggested that you use nrf_gpio_pin_out_read()
, which is for reading the state of an output pin
But, how can I use nrf_gpio_pin_out_read()
with NCS v2.0.2, with Zephyr? Isn't it a function of the old Nordic SDK?
It is a low-level function from nrfx that is available regardless of which SDK you are using. It exist in NCS v2.0.2, and also in the latest v2.4.2.