/* This API reads the data from the given register address of the sensor.  */
int8_t bme280_get_regs(uint8_t reg_addr, uint8_t *reg_data, uint16_t len, struct bme280_dev *dev)
/* This API reads the data from the given register address of the sensor.  */
int8_t bme280_get_regs(uint8_t reg_addr, uint8_t *reg_data, uint16_t len, struct bme280_dev *dev)
{
    int8_t rslt;
    rslt = null_ptr_check(dev);
    if ((rslt == BME280_OK) && (reg_data != NULL))
    {
        if (dev->intf != BME280_I2C_INTF)
        {
            reg_addr = reg_addr | 0x80;
        }
        dev->intf_rslt = dev->read(reg_addr, reg_data, len, dev->intf_ptr);
        if (dev->intf_rslt != BME280_INTF_RET_SUCCESS)
        {
            rslt = BME280_E_COMM_FAIL;
        }
    }
    else
    {
        rslt = BME280_E_NULL_PTR;
    }
    return rslt;
}