Subversion Repositories Code-Repo

Compare Revisions

Ignore whitespace Rev 202 → Rev 222

/PIC Stuff/PICX_16F1829_BLE_IMU/I2C.c
188,7 → 188,9
case I2C_SEND_ADDR:
// Send address with write bit set
data_ptr->operating_state = I2C_CHECK_ACK_RECV;
SSP1BUF = (data_ptr->master_dest_addr << 1) | 0x1;
char tmp = (data_ptr->master_dest_addr << 1);
tmp |= 0x1;
SSP1BUF = tmp;
break;
case I2C_CHECK_ACK_RECV:
// Check if ACK is received
239,7 → 241,7
case I2C_IDLE:
break;
case I2C_SEND_ADDR:
// Send the address with read bit set
// Send the address with write bit set
data_ptr->operating_state = I2C_CHECK_ACK_SEND;
SSP1BUF = (data_ptr->master_dest_addr << 1) | 0x0;
break;
272,7 → 274,9
case I2C_SEND_ADDR_2:
// Send the address with read bit set
data_ptr->operating_state = I2C_CHECK_ACK_RECV;
SSP1BUF = (data_ptr->master_dest_addr << 1) | 0x1;
char tmp = (data_ptr->master_dest_addr << 1);
tmp |= 0x1;
SSP1BUF = tmp;
break;
case I2C_CHECK_ACK_RECV:
// Check if ACK is received