GPIO (General Purpose Input/Output) ports are I/O ports widely used in the world of microcontrollers, especially in the field of embedded electronics. Usage of this term appeared in the early 80s. GPIO are placed on an electronic circuit in order to communicate with electronic components and external circuits. These can be detectors or sensors to capture data, or to control commands. GPIO contacts have no purpose, so they are usually unassigned by default.
GPIO is present in the first place on boards with microcontrollers, such as the Arduino and its Atmel AVR or similar boards or some DSP test boards, also Arduino compatible boards including ESP8266 or ESP32, or the DSPs themselves. The Raspberry Pi has GPIO connectors since its first version, allowing it to be used both as a personal computer, and also as like a microcontroller board for purely electronic applications.
A large part of the single-board, development-oriented computers, such as the Arndale Board, Banana Pi, BeagleBoard, Cubieboard, Firefly, Odroid, OLinuXino, etc. also incorporate series of GPIO connectors. More recently, few PC motherboards also have them.
A GPIO connector can only process digital signals, 1 or 0, a connection on an analog medium will require a CAN/DAC. An analog-to-digital converter (ADC) is an electronic device whose function is to translate an analog quantity into a digital value encoded on several bits. The converted signal is usually an electrical voltage.
Programming and Capabilities
These connectors are managed by the operating system kernel drivers. Linux natively recognizes GPIO ports, complete documentation is available on the official website of the kernel and explains how to program drivers. Microsoft Windows also includes specific development APIs for creating GPIO drivers.
In addition to the standard kernel library, there are higher-level specialized libraries, which make it easier to program GPIO connectors or manage standard devices. Some also allow portability on compatible pinout devices but different architecture. The RaspberryPi for example, has WiringPi library (in C) to manage the most popular expansion cards of this board.
A GPIO connector can be configured to act as an input (receiving a signal) or output (transmitting a signal). When configured as output, one can write to an internal register in order to change the state of an output. When configured as an entry, its status can be detected by reading the contents of an internal register.