Hi,
I'm trying to wrap my head around doing some basic GPIO reading, writing etc. and hopefully some interrupts. Apologies if these are basic questions - I've only really had experience within the Arduino framework before this.
I've got a NRF52840 Development Kit and I'm using NRF Connect for VSCode with NRF Connect v1.9.1
I've gone through the blinky and button examples, and I can get them working, and change them to address different leds/buttons. However, I'm not sure how to generalise this to other pins.
I've read a whole load of forum posts and I'm confused as to the difference between all the seemingly different GPIO libraries: what's the distinction between the libraries "drivers/gpio.h", "nrf_gpio.h", purely "gpio.h", GPIO HAL, GPIOTE, GPIO, "device.h"? Would I need to adjust the CMakeLists.txt to use these?
Are there multiple libraries for controlling GPIO things?
I've found various GPIO headers under both NRFX (https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/gpio/hal.html#c.NRF_GPIO_PIN_MAP) and Zephyr (https://docs.zephyrproject.org/latest/reference/peripherals/gpio.html?highlight=gpio_pin_configure#c.gpio_pin_configure) etc.
I've also seen that a bunch of the forum posts are a) from about 5 years ago and b) referencing NRF SDK as opposed to NRF Connect SDK. Has there been an update to the GPIO libaries since then and is there a stark difference between the libraries available in the different SDKs?
Lastly, I've got a bit confused about the Devicetree in general. As I understand it, it's a set of files that contains a description of the hardware for each board so the program can find e.g. which pin is connected to an LED. If I wanted to say use pin P0.09 to control an LED that I'd wired in externally to the board, would I need to add in a new thing in the nrf52840dk_nrf52840.dts file?