What is a GPIO line?
A General Purposes Input Output (GPIO) line is a pin of a microcontroller or CPU or other integrated circuit whose behavior is controllable by the user at runtime. So, a GPIO pin has no predefined usage, but the developer has the ability to set it for input or output usage (for simpler implementations) or as an IRQ source or other functionalities.
In general, a GPIO line can:
Be enabled/disabled.
Be configured as input or output.
Have readable/writable output values (typically, high is 1 and low is 0).
Have readable input values (typically, high is 1 and low is 0).
Have default pulled-up or pulled-down input values.
Have input values to be used as IRQ source.
The GPIO lines are so generic that if adequately used in a dedicated program, they can be used to emulate another digital interface controller; in fact, inside the Linux kernel, we can find several kinds of peripheral controllers emulated via GPIO (the most famous and used are the keyboard, I2C and W1 controllers; in particular...