ICM20948 DMP代码详解(58)
接前一篇文章:ICM20948 DMP代码详解(57)
上一回解析了inv_icm20948_set_matrix函数中调用inv_icm20948_set_chip_to_body_axis_quaternion函数的代码片段,本回继续解析inv_icm20948_set_matrix函数的后续内容。为了便于理解和回顾,再次贴出该函数源码,在EMD-Core\sources\Invn\Devices\Drivers\ICM20948\Icm20948Setup.c中,如下:
int inv_icm20948_set_matrix(struct inv_icm20948 * s, const float matrix[9], enum inv_icm20948_sensor sensor)
{
int32_t mounting_mq30[9];
int result = 0;
int i;
for(i = 0; i < 9; ++i)
mounting_mq30[i] = (int32_t)(matrix[i] * (1 << 30));
// Convert mounting matrix in char
DmpDriver_convertion(s-&