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.