/* This API configure the necessary setting of high-g interrupt.  */
static int8_t config_high_g_int_settg(const struct bmi160_acc_high_g_int_cfg *high_g_int_cfg, const struct bmi160_dev *dev)
/* This API configure the necessary setting of high-g interrupt.  */
static int8_t config_high_g_int_settg(const struct bmi160_acc_high_g_int_cfg *high_g_int_cfg, const struct bmi160_dev *dev)
{
    int8_t rslt;
    uint8_t temp = 0;
    uint8_t data_array[3] = { 0, 0, 0 };
    rslt = bmi160_get_regs(BMI160_INT_LOWHIGH_2_ADDR, &data_array[0], 1, dev);
    if (rslt == BMI160_OK)
    {
        temp = data_array[0] & ~BMI160_HIGH_G_HYST_MASK;
        data_array[0] = temp | ((high_g_int_cfg->high_hy << 6) & BMI160_HIGH_G_HYST_MASK);
        data_array[1] = high_g_int_cfg->high_dur;
        data_array[2] = high_g_int_cfg->high_thres;
        rslt = bmi160_set_regs(BMI160_INT_LOWHIGH_2_ADDR, data_array, 3, dev);
    }
    return rslt;
}