ICM20948 DMP代码详解(59)
接前一篇文章:ICM20948 DMP代码详解(58)
上一回解析完了icm20948_apply_mounting_matrix函数,本回回到icm20948_sensor_setup函数中,继续解析后续内容。为了便于理解和回顾,再次贴出icm20948_sensor_setup函数源码,在EMD-App\src\ICM20948\sensor.c中,如下:
int icm20948_sensor_setup(void)
{int rc;uint8_t i, whoami = 0xff;/** Just get the whoami*/rc = inv_icm20948_get_whoami(&icm_device, &whoami);if (interface_is_SPI() == 0) { // If we're using I2Cif (whoami == 0xff) { // if whoami fails try the other I2C Addressswitch_I2C_to_revA();rc = inv_icm20948_get_whoami(&ic