QMK has a GPIO control abstraction layer which is microcontroller agnostic. This is done to allow easy access to pin control across different platforms.
The following functions can provide basic control of GPIOs and are found in
Old AVR Examples
Old ChibiOS/ARM Examples
Set pin as input with high impedance (High-Z)
Set pin as input with builtin pull-up resistor
Set pin as input with builtin pull-down resistor
N/A (Not supported on AVR)
Set pin as output
Set pin level as high, assuming it is an output
Set pin level as low, assuming it is an output
Set pin level, assuming it is an output
Returns the level of the pin
Each microcontroller can have multiple advanced settings regarding its GPIO. This abstraction layer does not limit the use of architecture-specific functions. Advanced users should consult the datasheet of their desired device and include any needed libraries. For AVR, the standard avr/io.h library is used; for STM32, the ChibiOS PAL library is used.