接前一篇文章:ICM20948 DMP代码详解(40)
上一回解析了inv_icm20948_read_secondary函数的第1段代码,本回解析余下的两段代码。为了便于理解和回顾,再次贴出该函数源码,在EMD-Core\sources\Invn\Devices\Drivers\ICM20948\Icm20948AuxTransport.c中,如下:
/*
* inv_configure_secondary_read(): set secondary registers for reading.
The chip must be set as bank 3 before calling.
* This is derived from inv_icm20948_read_secondary in linux...
* for now, uses a very simple data struct for the registers
*
* index gives the mapping to the particular SLVx registers
* addr is the physical address of the device to be accessed
* reg is the device register we wish to access
* len is the number of bytes to be read
*
*/
int