Class BME68x

    • Field Detail

      • MIN_TEMPERATURE_CELSIUS

        public static int MIN_TEMPERATURE_CELSIUS
      • MAX_TEMPERATURE_CELSIUS

        public static int MAX_TEMPERATURE_CELSIUS
      • MIN_PRESSURE_HPA

        public static int MIN_PRESSURE_HPA
      • MAX_PRESSURE_HPA

        public static int MAX_PRESSURE_HPA
      • MIN_HUMIDITY_PERCENT

        public static int MIN_HUMIDITY_PERCENT
      • MAX_HUMIDITY_PERCENT

        public static int MAX_HUMIDITY_PERCENT
    • Constructor Detail

      • BME68x

        public BME68x()
      • BME68x

        public BME68x​(int controller)
        Create a new BME680 sensor driver connected on the given bus.
        Parameters:
        controller - I2C bus the sensor is connected to.
      • BME68x

        public BME68x​(int controller,
                      int address)
        Create a new BME680 sensor driver connected on the given bus and address.
        Parameters:
        controller - I2C bus the sensor is connected to.
        address - I2C address of the sensor.
    • Method Detail

      • initialise

        public void initialise()
        Initialise the device. bme68x_init
      • softReset

        public void softReset()
        Initiate a soft reset. bme68x_soft_reset
      • getChipId

        public byte getChipId()
        Get the chip id. read_chip_id
        Returns:
        chip identifier
      • getVariantId

        public byte getVariantId()
        Get the chip variant id. read_variant_id
        Returns:
        chip variant identifier
      • getUniqueId

        public byte getUniqueId()
        Get the chip's identifier. Note not documented.
        Returns:
        chip unique id
      • getOperatingMode

        public BME68x.OperatingMode getOperatingMode()
        Get the operating mode. bme68x_get_op_mode
        Returns:
        Current operating mode
      • setOperatingMode

        public void setOperatingMode​(BME68x.OperatingMode mode)
        Set the operating mode. bme68x_set_op_mode
        Parameters:
        mode - Target operating mode
      • getHumidityOversample

        public BME68x.OversamplingMultiplier getHumidityOversample()
        Get humidity oversampling mode
        Returns:
        Current humidity oversampling mode
      • getTemperatureOversample

        public BME68x.OversamplingMultiplier getTemperatureOversample()
        Get temperature oversampling mode
        Returns:
        Current temperature oversampling mode
      • getPressureOversample

        public BME68x.OversamplingMultiplier getPressureOversample()
        Get pressure oversampling mode
        Returns:
        Current pressure oversampling mode
      • getIirFilterConfig

        public BME68x.IirFilterCoefficient getIirFilterConfig()
        Get the IIR filter configuration
        Returns:
        IIR filter configuration
      • calculateMeasureDuration

        public int calculateMeasureDuration​(BME68x.OperatingMode targetOperatingMode)
        Calculate the duration in microseconds to take to take TPHG readings using the currently configured humidity, temperature and pressure oversampling modes. Can be used to get the remaining duration that can be used for heating. bme68x_get_meas_dur
        Parameters:
        targetOperatingMode - Operating mode
        Returns:
        remaining duration in microseconds
      • calculateMeasureDuration

        public static int calculateMeasureDuration​(BME68x.OversamplingMultiplier humidityOversampling,
                                                   BME68x.OversamplingMultiplier temperatureOversampling,
                                                   BME68x.OversamplingMultiplier pressureOversampling,
                                                   BME68x.OperatingMode targetOperatingMode)
        Calculate the duration in microseconds to take to take TPHG readings using the specified humidity, temperature and pressure oversampling modes. Can be used to get the remaining duration that can be used for heating. bme68x_get_meas_dur
        Parameters:
        humidityOversampling - Humidity oversampling mode
        temperatureOversampling - Temperature oversampling mode
        pressureOversampling - Pressure oversampling mode
        targetOperatingMode - Operating mode
        Returns:
        remaining duration in microseconds
      • getSensorData

        public BME68x.Data[] getSensorData()
        Read the pressure, temperature and humidity and gas data from the sensor, compensates the data and store it in the bme68x_data structure instance passed by the user. bme68x_get_data
        Returns:
        Sensor data
      • getSensorData

        public BME68x.Data[] getSensorData​(BME68x.OperatingMode operatingMode)
        Read the pressure, temperature and humidity and gas data from the sensor, compensates the data and store it in the bme68x_data structure instance passed by the user. bme68x_get_data
        Parameters:
        operatingMode - Device operating mode
        Returns:
        Sensor data
      • getGasResistance

        public float getGasResistance()
      • getHeaterConfiguration

        public BME68x.HeaterConfig getHeaterConfiguration()
        Get the gas configuration of the sensor. Note not fully working hence package-private. bme68x_get_heatr_conf
        Returns:
        the heater configuration
      • lowGasSelfTestCheck

        public void lowGasSelfTestCheck()
        Self-test of low gas variant of BME68X (i.e. the BME680) bme68x_low_gas_selftest_check