The Microchip SAMA5D27 MCU used by the Roadrunner SOM, has a Parallel Input/Output Controller (PIO) to configure and control all the available GPIO lines. The PIO manages up to 128 fully programmable input/output lines. Each I/O line may be dedicated as a general purpose I/O or be assigned to a function of an embedded peripheral. Look at the Roadrunner pinout to learn how the MCU GPIOs are mapped on the two, one hundred contacts, connectors of the SOM.
A general description of the features available as extracted from the SAMA5D2 Series datasheet:
34.2 Embedded Characteristics
Each I/O line is designed with an embedded pull-up resistor and an embedded pull-down resistor. Each I/O can be independently programmed in Open-Drain mode. This feature permits several drivers to be connected on the I/O line Which is driven low only by each device. An external pull-up resistor (or enabling of the internal one) is generally required to guarantee a high level on the line. Optional input glitch and debouncing filters are independently programmable on each I/O line. It is possible to configure each input for the Schmitt trigger. Each I/O group can be programmed to generate an interrupt when it detects an edge or a level on an I/O line.
If the I/O lines need to be connected to external sensors or actuators of any kind, wired in home, office or whatever else industrial environment together with many other installations, a great care has to be applied on protecting the MCU pins from ESD and EMI.
In this example the TVS, together with the series resistor, protects the I/Os from any voltage that could be dangerous for the MCU. Low pass RC filters out the high frequency noise. In this case a pull-up resistor is required to connect a simple switch, but a pull-down too may be used if the external device is capable of rising the voltage level. Finally, the mosfet offers an even greater level of division from the outside, also driving a status LED. The internal ground is isolated by the inductor that can be used by many other inputs as a common, filtered return for all of them.
On the output side too a mosfet is used in this example to design an open-drain circuit that shorts to a common return the externally powered load. An LC, to keep low the resistance to ground, composes usual low pass filter here.