接前一篇文章:ICM20948 DMP代码详解(63)
上一回解析完了inv_icm20948_set_fsr函数中加速度传感器组的fsr相关寄存器的设置,本回开始解析陀螺仪传感器组的fsr相关寄存器的设置。为了便于理解何回顾,再次贴出inv_icm20948_set_fsr函数代码,在EMD-Core\sources\Invn\Devices\Drivers\ICM20948\Icm20948Setup.c中,如下:
int inv_icm20948_set_fsr(struct inv_icm20948 * s, enum inv_icm20948_sensor sensor, const void * fsr)
{
int result = 0;
int * castedvalue = (int*) fsr;
if((sensor == INV_ICM20948_SENSOR_RAW_ACCELEROMETER) ||
(sensor == INV_ICM20948_SENSOR_ACCELEROMETER)){
enum mpu_accel_fs afsr;
if(*castedvalue == 2)
afsr = MPU_