/* This API sets the humidity over sampling settings of the sensor. 
This API sets the humidity oversampling settings of the sensor. */
static int8_t set_osr_humidity_settings(const struct bme280_settings *settings, struct bme280_dev *dev)
/* This API sets the humidity over sampling settings of the sensor. 
This API sets the humidity oversampling settings of the sensor. */
static int8_t set_osr_humidity_settings(const struct bme280_settings *settings, struct bme280_dev *dev)
{
    int8_t rslt;
    uint8_t ctrl_hum;
    uint8_t ctrl_meas;
    uint8_t reg_addr = BME280_CTRL_HUM_ADDR;
    ctrl_hum = settings->osr_h & BME280_CTRL_HUM_MSK;
    rslt = bme280_set_regs(&reg_addr, &ctrl_hum, 1, dev);
    if (rslt == BME280_OK)
    {
        reg_addr = BME280_CTRL_MEAS_ADDR;
        rslt = bme280_get_regs(reg_addr, &ctrl_meas, 1, dev);
        if (rslt == BME280_OK)
        {
            rslt = bme280_set_regs(&reg_addr, &ctrl_meas, 1, dev);
        }
    }
    return rslt;
}