Tool/software: TI-RTOS
Hi,
I´m using the CC2650 launchpad and I,ve found and issue I can´t resolve. I´m trying to do some I2c readings controlling them with a timer. The fact is that when I try to do a I2cparams transfer at the timer´s callback it never gets succesfull. Here is the code:
static void Lecturas_Handler(UArg arg) //The callback function from the timer
{
lecturas();
}
//////////////***********************////////////////////
static float lecturas(void)
{
I2C_Transaction i2cTrans;
uint8_t rxBuf[32] = {0}; //Receive buffer
uint8_t txBuf[32] = {0}; //Transmit buffer
uint8_t error1=0;
coordenadas acel;
RAW raw;
float modulo=0.0;
handle = I2C_open(Board_I2C, ¶ms);
if(!handle) {
printf("clsdbvjlbsvklb");
//Error
}
//Read Acel
//Address = 0x28
txBuf[0] = 0x28;
i2cTrans.writeCount = 1;
i2cTrans.writeBuf = txBuf;
i2cTrans.readCount = 6;
i2cTrans.readBuf = rxBuf;
i2cTrans.slaveAddress = 0x6B;
do
{
error1=I2C_transfer(handle, &i2cTrans);
}while(!error1);
error1=0;
}
When the programme arrives at the transfer, the returning value never becomes "TRUE".
Is this the right way to do it or is there another solution?