I have posted updated fast digital I/O, software I2C, and software SPI libraries as DigitalIO20130221.zip Google Code Archive - Long-term storage for Google Code Project Hosting..
The DigitalPin.h file contains the fastest pin I/O class and functions. These functions require a constant pin number.
These function execute in two cycle with constant arguments. On an Uno, two cycles is 0.125 usec. This is about 25 times faster than the standard Arduino digitalWrite().
The PinIO class has run time pin numbers and is four to five times faster than the standard digitalRead() and digitalWrite() functions. For pin 13 on an Uno, write() executes in about 0.8 usec and toggle() is faster. The standard Arduino digitalWrite() function takes about 4 usec.
This class saves overhead by not disabling PWM mode on each read/write call and by storing the port register addresses and pin bit mask in private variables.
The template class SoftSPI uses fast pin I/O to implement a software SPI bus at about 2 MHz.
The two classes FastI2cMaster and SoftI2cMaster implement software master mode I2C.
FastI2cMaster is a template class and runs at about 400 kHz.
SoftI2cMaster uses run time pin numbers and runs at about 100 kHz.
Here is an example using the highest speed digital pin class.
// Read pin 12 and write value to pin 13.
#include <DigitalIO.h>
DigitalPin<12> pin12(INPUT);
DigitalPin<13> pin13(OUTPUT);
void setup() {}
void loop() {
pin13 = pin12;
}