Subversion Repositories Code-Repo

Compare Revisions

Ignore whitespace Rev 281 → Rev 282

/PIC Stuff/PICX_12F1840_Clock/I2C1.c
6,6 → 6,9
// Set up the data structures for the base_I2C.code
// Should be called once before any i2c routines are called
void I2C1_Init(void) {
I2C_1_CLK_TRIS = 1;
I2C_1_DAT_TRIS = 1;
i2c_data.buffer_in_len = 0;
i2c_data.buffer_in_read_ind = 0;
i2c_data.buffer_in_write_ind = 0;
22,11 → 25,6
 
// Setup the PIC to operate as a master.
void I2C1_Configure_Master(uint8_t speed) {
// i2c_data.operating_mode = I2C_MODE_MASTER;
 
I2C_1_CLK_TRIS = 1;
I2C_1_DAT_TRIS = 1;
 
SSP1STAT = 0x0;
SSP1CON1 = 0x0;
SSP1CON2 = 0x0;