So, this is the API we are going to use No specific header to include The gpio header is included by default by cpu.h GPIO_NR(port, bit) GPIO_PORT(nr) GPIO_BIT(nr) extern void gpio_init(void); extern int gpio_dir_af(int gpio, int output, int value, int afnum); extern void gpio_dir(int gpio, int output, int value); extern int gpio_get(int gpio); extern uint32_t __gpio_get(int gpio); extern void gpio_set(int gpio, int value); extern void __gpio_set(int gpio, uint32_t value); Then, there are constants to help the caller GPIO_DIR_IN, GPIO_DIR_OUT, ... Initialization can be slow (who cares) Runtime may need to be fast Sometimes, the program may directly act on registers