/* This API enables or disable the step counter feature. 1 - enable step counter (0 - disable)  */
int8_t bmi160_set_step_counter(uint8_t step_cnt_enable, const struct bmi160_dev *dev)
/* This API enables or disable the step counter feature. 1 - enable step counter (0 - disable)  */
int8_t bmi160_set_step_counter(uint8_t step_cnt_enable, const struct bmi160_dev *dev)
{
    int8_t rslt;
    uint8_t data = 0;
    rslt = null_ptr_check(dev);
    if (rslt != BMI160_OK)
    {
        rslt = BMI160_E_NULL_PTR;
    }
    else
    {
        rslt = bmi160_get_regs(BMI160_INT_STEP_CONFIG_1_ADDR, &data, 1, dev);
        if (rslt == BMI160_OK)
        {
            if (step_cnt_enable == BMI160_ENABLE)
            {
                data |= (uint8_t)(step_cnt_enable << 3);
            }
            else
            {
                data &= ~BMI160_STEP_COUNT_EN_BIT_MASK;
            }
            rslt = bmi160_set_regs(BMI160_INT_STEP_CONFIG_1_ADDR, &data, 1, dev);
        }
    }
    return rslt;
}