Part Number: LAUNCHXL-CC2650
Other Parts Discussed in Thread: BLE-STACK
Tool/software: TI-RTOS
Hi
I am using cc2650 Launchxl MCU and Contiki SW stack, so from this cc2650 I need to read temperature sensor data using I2C communication
I am trying to use I2C functions that is there in i2c.c, i2c.h files inside driverlib folder
I have used some functions to read data but it is not communicating please anyone tell me what might be the problem
int baseAddress = 0x4F;
int slaveAddres = 0x27;
bool bFast = true;
int rateclk = 400000;
bool breceive = true;
void fgt_i2c_init()
{
I2CMasterInitExpClk(baseAddress,rateclk,bFast);
I2CSlaveInit(baseAddress,slaveAddres);
I2CSlaveEnable(baseAddress);
}
void i2c_read_data()
{
uint32_t data;
I2CMasterControl(baseAddress, I2C_MASTER_CMD_SINGLE_RECEIVE);
I2CMasterSlaveAddrSet(baseAddress,slaveAddres,breceive);
uint32_t sstatus = I2CSlaveStatus(baseAddress);
if(sstatus==I2C_SLAVE_ACT_TREQ ) //master has requested a data 0x00000002
{
data = I2CSlaveDataGet(baseAddress);
printf("\nmessage from readF temp: %d",(unsigned int)data);
}
}
thank you