/* This API sets the data ready interrupt for both accel and gyro. This interrupt occurs when new accel and gyro data come. 
This API sets the data ready interrupt for both accel and gyro. This interrupt occurs when new accel and gyro data comes. */
static int8_t set_accel_gyro_data_ready_int(const struct bmi160_int_settg *int_config, const struct bmi160_dev *dev)
/* This API sets the data ready interrupt for both accel and gyro. This interrupt occurs when new accel and gyro data come. 
This API sets the data ready interrupt for both accel and gyro. This interrupt occurs when new accel and gyro data comes. */
static int8_t set_accel_gyro_data_ready_int(const struct bmi160_int_settg *int_config, const struct bmi160_dev *dev)
{
    int8_t rslt;
    rslt = null_ptr_check(dev);
    if ((rslt != BMI160_OK) || (int_config == NULL))
    {
        rslt = BMI160_E_NULL_PTR;
    }
    else
    {
        rslt = enable_data_ready_int(dev);
        if (rslt == BMI160_OK)
        {
            rslt = set_intr_pin_config(int_config, dev);
            if (rslt == BMI160_OK)
            {
                rslt = map_hardware_interrupt(int_config, dev);
            }
        }
    }
    return rslt;
}