bmi2_ois.c
/*!
 * @brief This API enables/disables accelerometer/gyroscope data read through
 * OIS interface.
 */
@brief This API enables/disables accelerometer/gyroscope data read through
OIS interface.
@brief This API enables / disables accelerometer / gyroscope data read through OIS interface .
int8_t bmi2_ois_set_config(struct bmi2_ois_dev *ois_dev)
{
    int8_t rslt;
    uint8_t reg_data = 0;
    rslt = null_ptr_check(ois_dev);
    if (rslt == BMI2_OIS_OK)
    {
        rslt = bmi2_ois_get_regs(BMI2_OIS_CONFIG_ADDR, &reg_data, 1, ois_dev);
        if (rslt == BMI2_OIS_OK)
        {
            reg_data = BMI2_SET_BIT_POS0(reg_data, BMI2_OIS_LP_FILTER_EN, ois_dev->lp_filter_en);
            reg_data = BMI2_OIS_SET_BITS(reg_data, BMI2_OIS_LP_FILTER_CONFIG, ois_dev->lp_filter_config);
            reg_data = BMI2_OIS_SET_BITS(reg_data, BMI2_OIS_LP_FILTER_MUTE, ois_dev->lp_filter_mute);
            reg_data = BMI2_OIS_SET_BITS(reg_data, BMI2_OIS_ACC_EN, ois_dev->acc_en);
            reg_data = BMI2_OIS_SET_BITS(reg_data, BMI2_OIS_GYR_EN, ois_dev->gyr_en);
            rslt = bmi2_ois_set_regs(BMI2_OIS_CONFIG_ADDR, &reg_data, 1, ois_dev);
        }
    }
    return rslt;
}
int8_t bmi2_ois_set_config ( struct bmi2_ois_dev * ois_dev ) { int8_t rslt ; uint8_t reg_data = 0 ; rslt = null_ptr_check ( ois_dev ) ; if ( rslt == BMI2_OIS_OK ) { rslt = bmi2_ois_get_regs ( BMI2_OIS_CONFIG_ADDR , & reg_data , 1 , ois_dev ) ; if ( rslt == BMI2_OIS_OK ) { reg_data = BMI2_SET_BIT_POS0 ( reg_data , BMI2_OIS_LP_FILTER_EN , ois_dev -> lp_filter_en ) ; reg_data = BMI2_OIS_SET_BITS ( reg_data , BMI2_OIS_LP_FILTER_CONFIG , ois_dev -> lp_filter_config ) ; reg_data = BMI2_OIS_SET_BITS ( reg_data , BMI2_OIS_LP_FILTER_MUTE , ois_dev -> lp_filter_mute ) ; reg_data = BMI2_OIS_SET_BITS ( reg_data , BMI2_OIS_ACC_EN , ois_dev -> acc_en ) ; reg_data = BMI2_OIS_SET_BITS ( reg_data , BMI2_OIS_GYR_EN , ois_dev -> gyr_en ) ; rslt = bmi2_ois_set_regs ( BMI2_OIS_CONFIG_ADDR , & reg_data , 1 , ois_dev ) ; } } return rslt ; }
@brief This API enables/disables accelerometer/gyroscope data read through
 OIS interface.
@brief This API enables / disables accelerometer / gyroscope data read through OIS interface .
/* Variable to define error */ /* Variable to store data */ /* Null-pointer check */ /* Enable/Disable Low pass filter */ /* Configures Low pass filter cut-off frequency */ /* Low pass filter - mute on secondary interface */ /* Enable/Disable ois on accelerometer */ /* Enable/Disable ois on gyroscope */ /* Set the OIS configurations */