/PIC Stuff/PIC_27J13/i2c.c |
---|
33,8 → 33,8 |
void I2C_Configure_Master(unsigned char speed) { |
i2c_data_p->operating_mode = I2C_MODE_MASTER; |
TRISCbits.TRISC3 = 1; |
TRISCbits.TRISC4 = 1; |
I2C_CLK_TRIS = 1; |
I2C_DAT_TRIS = 1; |
SSPSTAT = 0x0; |
SSPCON1 = 0x0; |
120,8 → 120,8 |
i2c_data_p->operating_mode = I2C_MODE_SLAVE; |
// Ensure the two lines are set for input (we are a slave) |
TRISCbits.TRISC3 = 1; |
TRISCbits.TRISC4 = 1; |
I2C_CLK_TRIS = 1; |
I2C_DAT_TRIS = 1; |
SSPADD = addr << 1; // Set the slave address |