/* This function validates the chip ID of device */
static int drv_baro_bosch_bmp380_validate_id(i2c_dev_t *drv, uint8_t id_value)
/* This function validates the chip ID of device */
static int drv_baro_bosch_bmp380_validate_id(i2c_dev_t *drv, uint8_t id_value)
{
    int     ret = 0;
    uint8_t value = 0;
    if (drv == NULL) {
        return -1;
    }
    ret = sensor_i2c_read(drv, BMP380_CHIP_ID_ADDR, &value, I2C_DATA_LEN, I2C_OP_RETRIES);
    if (unlikely(ret) != 0) {
        return ret;
    }
    if (id_value != value) {
        return -1;
    }
    return 0;
}