#use i2c(SLAVE, SDA=PIN_C4, SCL=PIN_C3, address=0xa0)
//BYTE address;
BYTE buffer[10] = {0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88,0x99};
#INT_SSP
void ssp_interupt ()
{
BYTE state,dummy;
state = i2c_isr_state();
if(state >= 0x80) //Master is requesting data
{
i2c_write(buffer[state - 0x80]);
}
else
{
dummy=i2c_read(); //this line is to avoid locking the bus in case of a write
}
}
void main ()
{
enable_interrupts(GLOBAL);
enable_interrupts(INT_SSP);
while (TRUE) {}
}