Using multiple ICM20948 at the same time

By jritchey , 17 September 2019

Hello,

I am trying to communicate with multiple icm20948 at the same time and ran in to something that I am not sure I understand.

In the icm20948 device driver I see the following:


/** @brief ICM20948 driver states singleton declaration
* Because of Low-level driver limitation only one insance of the driver is allowed
*/
extern struct inv_icm20948 * icm20948_instance;
/** @brief Reset and initialize driver states
* @param[in] s handle to driver states structure
*/
static inline void inv_icm20948_reset_states(struct inv_icm20948 * s,
const struct inv_icm20948_serif * serif)
{
assert(icm20948_instance == 0);

memset(s, 0, sizeof(*s));
s->serif = *serif;
icm20948_instance = s;
}

The assert() fails if I try to communicate with more than one sensor at the same time. If I comment out the assert everything seems to work fine. Any ideas what is the purpose of this assert?

phpbb Topic ID
37633