An in-depth explanation of the 8 input and output modes of GPIO of STM32, PY32 and other microcontrollers