The SDK defines functions for operating on "ports", which are the output space divided into 8-bit chunks:
- nrf_gpio_port_clear
- nrf_gpio_port_dir_set
- nrf_gpio_port_read
- nrf_gpio_port_set
- nrf_gpio_port_write
These functions take an argument of nrf_gpio_port_select_t, a helpful enumeration that saves the programmer from counting to 4.
Internally, they just manipulate the 32-bit IO registers with shifts and masks.
They are used in nrf6310 example code for the 6.x SDK and earlier, but are not used since then.
These "ports" are a different abstraction than the GPIOTE "PORT" signal, or "gpio PORT" in the "GPIO" section of the nRF51 reference manual, or the "GPIO port" referred to in the SVD documentation for the OUT, OUTSET, OUTCLR, IN registers.
A search through the devzone for "nrf_gpio_port_" will yield many questions with realized or latent bugs due to this confusion:
What is the use of these functions? For porting 8-bit code?
Regards, Mark