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.
Ah, I see.
I've found this function in C:\ncs\v2.0.2\modules\hal\nordic\nrfx\hal\nrf_gpio.h
But, how can I include it in my project?
If I try #include <modules/hal/nordic/nrfx/hal/nrf_gpio.h>
it does not find the file.
I do not understand the include paths when using NCS. They do not correspond exactly with file system folder structure.
Thanks again!
Pedro.
Hi Pedro,
You should include it like this:
#include <hal/nrf_gpio.h>
Thanks Einar!
How can I find in the future the include path for other .h files? They do not correspond with the system folder structure.
Pedro,
Actually, you can use still use Zephyr's gpio_pin_get() to get the state of the the output pin.
The trick is to configure the pin as both an output and input in Zephyr, like this:
gpio_pin_configure_dt(&led1, GPIO_OUTPUT_INACTIVE | GPIO_INPUT);
and now gpio_pin_get() will work.
Thank you Joe! This also works.
Anyway, I'm curious about knowing how to know the include path for any .h file, which does not corresponds with the system folder structure. Somebody knows?
Regards,
Pedro.