Hello @Walson,
First of all, I want to clarify that there are several ways to configure GPIOs, where in chapter 13 called "General Purpose Input/Output (GPIO)" of the reference manual, all the possible configurations are listed.
Having clarified this, the first thing to do in order to use a peripheral is to activate its clock so that it can be configured. After this, the peripheral is configured as denoted by the application, either input, output or some other configuration mode. Finally, you may or may not enable interrupt for this peripheral, for example, activating the interrupt to use with a push button.
If you need an example of how to implement a pin as input to use with a push button, you can check out the example of the SDK (version 2.16) called "igpio_input_interrupt", paying extra attention to these functions:
-GPIO_PinInit(EXAMPLE_SW_GPIO, EXAMPLE_SW_GPIO_PIN, &sw_config);
-GPIO_PortEnableInterrupts(EXAMPLE_SW_GPIO, 1U << EXAMPLE_SW_GPIO_PIN);
On the other hand, if you need an example of how to implement a pin as output, you can check out the example of the SDK (version 2.16) called "igpio_led_output", paying extra attention to the configuration function (GPIO_pin init). You can compare these examples to know what are the differences about these GPIO configurations. Remember to consult the readme.txt file to understand how it works.
Also, if you experience any issue, do not hesitate to let me know.
BR,
Habib.