I have been using bspI2cInit() with Ti-RTOS 2.13.0.6 but does not seem to be supported with TI-RTOS 2.14 ? I have found sensortagI2cOpen() and am trying that... is this correct one to use to Setup I2C for sensors ?
The problem I am having is that when I try to run the function 'sensorMpu9250Init' I am getting an 'exception handler' when the following line is trying to be executed
if (!SENSOR_SELECT())
Here is how I am setting up the mpu9250
1. In my main I have
/* Initialise I2C */ Bool retVal=sensortagI2cOpen(); if (retVal==FALSE) { System_printf("sensortagI2cOpen did not initialise properly!\n"); }
2. In my _Init function I have the following:
SetupWakeOnMotion();
3. SetupWakeOnMotion() is defined as follows:
void SetupWakeOnMotion(void) { // Power up the board PIN_setOutputValue(hGpioPin, Board_MPU_POWER, Board_MPU_POWER_OFF); delay_ms(100); PIN_setOutputValue(hGpioPin, Board_MPU_POWER, Board_MPU_POWER_ON); sensorMpu9250Init(); sensorMpu9250Enable((0x01 << MPU_AX_ACC_X) | (0x01 << MPU_AX_ACC_Y) | (0x01 << MPU_AX_ACC_Z) ); // Enable interrupt from 9250 sensorMpu9250IntEnable(true); // TODO make it adjustable // sensorMpu9250AccSetRange(ACC_RANGE_8G); // Enable Wake-on-Motion sensorMpu9250WomEnable(); }
Is there a doc that describes correctly how to setup the CC2650 over I2C to setup the MPU9250? What am I missing here?