This code implements the basic functions for an I2C slave device using the SSP module. All I2C functions are handled in an ISR. Bytes written to the slave are stored in a buffer. After a number of bytes have been written, the master device can then read the bytes back from the buffer.