Esempio n. 1
0
static bool mpu6500Detect(void)
{
    uint8_t tmp;

    mpu6500SpiInit();

    mpu6500ReadRegister(MPU6500_RA_WHOAMI, &tmp, 1);

    if (tmp != MPU6500_WHO_AM_I_CONST)
        return false;

    return true;
}
Esempio n. 2
0
bool mpu6500SpiDetect(void)
{
    uint8_t tmp;

    mpu6500SpiInit();

    mpu6500ReadRegister(MPU_RA_WHO_AM_I, 1, &tmp);

    if (tmp == MPU6500_WHO_AM_I_CONST || tmp == MPU9250_WHO_AM_I_CONST) {
        return true;
    }

    return false;
}