Hi,
I was trying nrf5-mpu-simple example with MPU9250 - SDK 14.2.0, it is giving me x, y & z axis values.
When I try WHO_AM_I with it, I am unable to do so. I have added the following code in nrf_drv_mpu_twi.c file.
static void read_whoAmIdata()
{
#define MPU_REG_WHO_AM_I 0x75
static volatile bool m_xfer_done = false;
ret_code_t err_code;
uint8_t addr8 = MPU_REG_WHO_AM_I;
printf("WHO_AM_I Tx\r\n");
m_xfer_done = false;
err_code = nrf_drv_twi_tx(&m_twi_instance, MPU_ADDRESS, &addr8, 1, false);
while (m_xfer_done == false);
printf("WHO_AM_I Tx\r\n");
m_xfer_done = false;
err_code = nrf_drv_twi_rx(&m_twi_instance, MPU_ADDRESS, &addr8, 1);
APP_ERROR_CHECK(err_code);
printf("read_data() done\r\n");
}
Please let me know where I am committing mistake.