This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

GPIO Port read/write SDK v12.2

I noticed that the GPIO port read and port write for SDK v12.2 changed to accommodate chips with more pins but I can't find much information about it. How do I use nrf_gpio_port_out_read() and nrf_gpio_port_out_write()? And how does NRF_GPIO_Type tie into the calls? Also, NRF_GPIO->PIN_CNF[] doesn't seem to valid anymore.

  • Hi Beat,

    If you are using the nRF52832, there is no change here, you still have the same number of pin = 32.

    If you are talking about the nRF52840, then we have 48 pin and then we have 2 GPIO port, P0 and P1. They have 2 different base address 0x50000000 and 0x50000300

    We added nrf_gpio_pin_port_decode() function to detect which base address we should use.

    If you want to access the register directly, you use NRF_P0 and NRF_P1 instead of NRF_GPIO.

Related