bmi2_ois.c
/*!
 * @brief This API writes data to the given OIS register address of bmi2 sensor.
 */
@brief This API writes data to the given OIS register address of bmi2 sensor.
@brief This API writes data to the given OIS register address of bmi2 sensor .
int8_t bmi2_ois_set_regs(uint8_t ois_reg_addr,
                         const uint8_t *ois_reg_data,
                         uint16_t data_len,
                         struct bmi2_ois_dev *ois_dev)
{
    int8_t rslt;
    rslt = null_ptr_check(ois_dev);
    if ((rslt == BMI2_OIS_OK) && (ois_reg_data != NULL))
    {
        ois_reg_addr = (ois_reg_addr & BMI2_OIS_SPI_WR_MASK);
        ois_dev->intf_rslt = ois_dev->ois_write(ois_reg_addr, ois_reg_data, data_len, ois_dev->intf_ptr);
        if (ois_dev->intf_rslt != BMI2_INTF_RET_SUCCESS)
        {
            rslt = BMI2_OIS_E_COM_FAIL;
        }
    }
    else
    {
        rslt = BMI2_OIS_E_NULL_PTR;
    }
    return rslt;
}
int8_t bmi2_ois_set_regs ( uint8_t ois_reg_addr , const uint8_t * ois_reg_data , uint16_t data_len , struct bmi2_ois_dev * ois_dev ) { int8_t rslt ; rslt = null_ptr_check ( ois_dev ) ; if ( ( rslt == BMI2_OIS_OK ) && ( ois_reg_data != NULL ) ) { ois_reg_addr = ( ois_reg_addr & BMI2_OIS_SPI_WR_MASK ) ; ois_dev -> intf_rslt = ois_dev -> ois_write ( ois_reg_addr , ois_reg_data , data_len , ois_dev -> intf_ptr ) ; if ( ois_dev -> intf_rslt != BMI2_INTF_RET_SUCCESS ) { rslt = BMI2_OIS_E_COM_FAIL ; } } else { rslt = BMI2_OIS_E_NULL_PTR ; } return rslt ; }
@brief This API writes data to the given OIS register address of bmi2 sensor.
@brief This API writes data to the given OIS register address of bmi2 sensor .
/* Variable to define error */ /* Null-pointer check */ /* Configuring reg_addr for SPI Interface */ /* Burst write to OIS register through OIS interface */