/* This API is used to get the FOC status from the sensor.  */
static int8_t get_foc_status(uint8_t *foc_status, struct bmi160_dev const *dev)
/* This API is used to get the FOC status from the sensor.  */
static int8_t get_foc_status(uint8_t *foc_status, struct bmi160_dev const *dev)
{
    int8_t rslt;
    uint8_t data;
    rslt = bmi160_get_regs(BMI160_STATUS_ADDR, &data, 1, dev);
    if (rslt == BMI160_OK)
    {
        *foc_status = BMI160_GET_BITS(data, BMI160_FOC_STATUS);
    }
    return rslt;
}