General Purpose Input/Output (GPIO) library for Arduino
The Arduino GPIO library has been developed to allow high performance
digital pin access. Most access functions are compiled to a single
instruction and execute in 1-2 clock cycles. The library functions are
more than 10 times faster than the Arduino digital pin functions. In
some cases as much as 100 times faster.
Additional support classes are available for Debounced Digital and
Analog Pin, Shift Register Input/Output, and Software Serial. These
also demonstrate how the GPIO template class may be used to construct
additional libraries.
This library supports boards based on ATtinyX4, ATtinyX5, ATmega168,
ATmega328P, ATmega32U4, ATmega1280, ATmega2560 and SAM3X8E.
Version: 1.11
Benchmarks for ATtiny.
Wiring | us | GPIO | us | Xn (Due/Uno/Mega) |
---|---|---|---|---|
digitalRead | 1.23/3.75/6.4 | var = pin | 0.0625/0.071 | 17/60/99 |
digitalWrite | 2.30/4.25/7.2 | pin = val | 0.125/0.048 | 48/34/56 |
shiftIn | 46/87/151 | srpi >> var | 4.8/4.6/4.6 | 9.6/19/32 |
shiftOut | 53/104/161 | srpo << val | 5.7/7.9/7.9 | 9.3/13/20 |