/* This function gets the gyro ODR according to HZ */
static uint8_t drv_gyro_bosch_bmi260_hz2odr(uint32_t hz)
/* This function gets the gyro ODR according to HZ */
static uint8_t drv_gyro_bosch_bmi260_hz2odr(uint32_t hz)
{
    if(hz > 1600)
        return BMI2_GYR_ODR_3200HZ ;
    else if(hz > 800)
        return BMI2_GYR_ODR_1600HZ;
    else if(hz > 400)
        return BMI2_GYR_ODR_800HZ;
    else if(hz > 200)
        return BMI2_GYR_ODR_400HZ;
    else if(hz > 100)
        return BMI2_GYR_ODR_200HZ;
    else if(hz > 50)
        return BMI2_GYR_ODR_100HZ;
    else if(hz > 25)
        return BMI2_GYR_ODR_50HZ;
    else
        return BMI2_GYR_ODR_25HZ;
}