pamoja for TypeScript - v0.2.0
    Preparing search index...

    Variable bme280Const

    bme280: {
        addressPrimary: number;
        addressSecondary: number;
        calibrationHumidityLength: number;
        calibrationTempPressLength: number;
        chipId: number;
        dataLength: number;
        filter: { off: number; x16: number; x2: number; x4: number; x8: number };
        mode: { forced: number; normal: number; sleep: number };
        oversampling: {
            skipped: number;
            x1: number;
            x16: number;
            x2: number;
            x4: number;
            x8: number;
        };
        register: {
            calibHumidity: number;
            calibTempPress: number;
            chipId: number;
            config: number;
            ctrlHum: number;
            ctrlMeas: number;
            data: number;
            reset: number;
            status: number;
        };
        resetWord: number;
        sim: {
            statusIdle: number;
            burst(): Buffer;
            burstFor(
                celsius: number,
                hectopascals: number,
                relativeHumidity: number,
            ): Buffer;
            calibration(): Buffer;
            calibrationHumidity(): Buffer;
            part(address: number): hal.I2cPart;
            reporting(
                address: number,
                celsius: number,
                hectopascals: number,
                relativeHumidity: number,
            ): hal.I2cPart;
        };
        standby: {
            ms0_5: number;
            ms10: number;
            ms1000: number;
            ms125: number;
            ms20: number;
            ms250: number;
            ms500: number;
            ms62_5: number;
        };
        startupMicros: number;
        calibration(
            tempPress: Uint8Array,
            humidity: Uint8Array,
        ): sensors.Bme280Calibration;
        configBits(config: sensors.Bme280Config): number;
        configFromBits(bits: number): sensors.Bme280Config;
        ctrlHumBits(humidity: number): number;
        ctrlHumFromBits(bits: number): number;
        ctrlMeasBits(ctrl: sensors.Bme280CtrlMeas): number;
        ctrlMeasFromBits(bits: number): sensors.Bme280CtrlMeas;
        filterCoefficient(code: number): number;
        imageUpdating(status: number): boolean;
        maxMeasurementMicros(
            temperature: number,
            pressure: number,
            humidity: number,
        ): number;
        measuring(status: number): boolean;
        oversamplingFactor(code: number): number;
        standbyMicros(code: number): number;
        typicalMeasurementMicros(
            temperature: number,
            pressure: number,
            humidity: number,
        ): number;
    }

    A Bosch BME280 temperature, pressure, and humidity sensor.

    Type Declaration

    • addressPrimary: number

      The address a BME280 answers on with its SDO pin low.

    • addressSecondary: number

      The address it answers on with SDO high.

    • calibrationHumidityLength: number

      How many bytes the humidity calibration block holds.

    • calibrationTempPressLength: number

      How many bytes the temperature and pressure calibration block holds.

    • chipId: number

      The value its chip-ID register reads, which tells it from a BMP280.

    • dataLength: number

      How many bytes one measurement burst holds.

    • filter: { off: number; x16: number; x2: number; x4: number; x8: number }

      The IIR filter codes, which smooth pressure and temperature across measurements.

      • off: number

        No filtering.

      • x16: number

        Coefficient 16.

      • x2: number

        Coefficient 2.

      • x4: number

        Coefficient 4.

      • x8: number

        Coefficient 8.

    • mode: { forced: number; normal: number; sleep: number }

      The power mode codes.

      • forced: number

        One measurement, then back to sleep.

      • normal: number

        Measurements on a cycle, a standby period apart.

      • sleep: number

        No measurements; the power-on default.

    • oversampling: { skipped: number; x1: number; x16: number; x2: number; x4: number; x8: number }

      The oversampling codes: how many samples each measurement averages.

      • skipped: number

        The measurement is skipped.

      • x1: number

        One sample.

      • x16: number

        Sixteen samples.

      • x2: number

        Two samples.

      • x4: number

        Four samples.

      • x8: number

        Eight samples.

    • register: {
          calibHumidity: number;
          calibTempPress: number;
          chipId: number;
          config: number;
          ctrlHum: number;
          ctrlMeas: number;
          data: number;
          reset: number;
          status: number;
      }

      The registers a driver reads and writes.

      • calibHumidity: number

        The first of the 7 humidity calibration bytes.

      • calibTempPress: number

        The first of the 26 temperature and pressure calibration bytes.

      • chipId: number

        The chip-ID register.

      • config: number

        The configuration register, config.

      • ctrlHum: number

        The humidity control register, ctrl_hum.

      • ctrlMeas: number

        The measurement control register, ctrl_meas.

      • data: number

        The first of the 8 data bytes a burst read covers.

      • reset: number

        The reset register.

      • status: number

        The status register.

    • resetWord: number

      The word written to the reset register to restart the part.

    • sim: {
          statusIdle: number;
          burst(): Buffer;
          burstFor(
              celsius: number,
              hectopascals: number,
              relativeHumidity: number,
          ): Buffer;
          calibration(): Buffer;
          calibrationHumidity(): Buffer;
          part(address: number): hal.I2cPart;
          reporting(
              address: number,
              celsius: number,
              hectopascals: number,
              relativeHumidity: number,
          ): hal.I2cPart;
      }

      A BME280 that is not there, for a bus with nothing plugged in.

      • statusIdle: number

        The status a simulated part reports when it is neither measuring nor loading.

      • burst: function
        • The eight data registers a simulated part holds: one measurement a real part took.

          Returns Buffer

      • burstFor: function
        • The eight data registers that compensate to a reading against the simulated calibration.

          Parameters

          • celsius: number

            The temperature.

          • hectopascals: number

            The pressure.

          • relativeHumidity: number

            The humidity, as a percentage.

          Returns Buffer

          The bytes a burst read would return.

      • calibration: function
        • The 26-byte temperature and pressure calibration block a simulated part holds.

          Returns Buffer

      • calibrationHumidity: function
        • The 7-byte humidity calibration block a simulated part holds.

          Returns Buffer

      • part: function
        • A part holding a real BME280's calibration and one measurement it took, which compensate to 20.44 C, 848.05 hPa, and 44.65 %.

          Parameters

          • address: number

            The address it answers to.

          Returns hal.I2cPart

          The part, to put on a simulated bus.

      • reporting: function
        • A part that reads what it is asked to, to within what its converter can represent.

          Parameters

          • address: number

            The address it answers to.

          • celsius: number

            The temperature it reports.

          • hectopascals: number

            The pressure it reports.

          • relativeHumidity: number

            The humidity it reports, as a percentage.

          Returns hal.I2cPart

          The part, to put on a simulated bus.

    • standby: {
          ms0_5: number;
          ms10: number;
          ms1000: number;
          ms125: number;
          ms20: number;
          ms250: number;
          ms500: number;
          ms62_5: number;
      }

      The normal-mode standby codes, by the period each selects.

      • ms0_5: number

        0.5 ms.

      • ms10: number

        10 ms.

      • ms1000: number

        1000 ms.

      • ms125: number

        125 ms.

      • ms20: number

        20 ms.

      • ms250: number

        250 ms.

      • ms500: number

        500 ms.

      • ms62_5: number

        62.5 ms.

    • startupMicros: number

      How long the part takes to start after a reset, in microseconds.

    • calibration: function
      • Reads the factory calibration out of the registers, once at start-up.

        Parameters

        • tempPress: Uint8Array

          The 26-byte temperature and pressure calibration block.

        • humidity: Uint8Array

          The 7-byte humidity calibration block.

        Returns sensors.Bme280Calibration

        The calibration, to reuse for every measurement.

        If either block is the wrong length.

    • configBits: function
      • Assembles the config register value.

        Parameters

        Returns number

        The register value to write.

    • configFromBits: function
      • Parses a config register value.

        Parameters

        • bits: number

          The register value, as read from the part.

        Returns sensors.Bme280Config

        The standby period, filter, and interface settings.

    • ctrlHumBits: function
      • Assembles the ctrl_hum register value, which takes effect only after the next ctrl_meas write.

        Parameters

        • humidity: number

          The humidity oversampling code.

        Returns number

        The register value to write.

    • ctrlHumFromBits: function
      • Parses a ctrl_hum register value.

        Parameters

        • bits: number

          The register value, as read from the part.

        Returns number

        The humidity oversampling code.

    • ctrlMeasBits: function
      • Assembles the ctrl_meas register value.

        Parameters

        Returns number

        The register value to write.

    • ctrlMeasFromBits: function
      • Parses a ctrl_meas register value.

        Parameters

        • bits: number

          The register value, as read from the part.

        Returns sensors.Bme280CtrlMeas

        The oversampling codes and the power mode.

    • filterCoefficient: function
      • Returns the IIR coefficient a filter code selects.

        Parameters

        • code: number

          The filter code.

        Returns number

        The coefficient, or 0 when the filter is off.

    • imageUpdating: function
      • Reports whether a status register says the calibration is being copied.

        Parameters

        • status: number

          The status register.

        Returns boolean

        Whether the calibration image is still loading.

    • maxMeasurementMicros: function
      • Returns the longest one measurement can take, which is how long a driver waits after forcing one.

        Parameters

        • temperature: number

          The temperature oversampling code.

        • pressure: number

          The pressure oversampling code.

        • humidity: number

          The humidity oversampling code.

        Returns number

        The datasheet's maximum in microseconds.

    • measuring: function
      • Reports whether a status register says a conversion is running.

        Parameters

        • status: number

          The status register.

        Returns boolean

        Whether a measurement is in progress.

    • oversamplingFactor: function
      • Returns how many samples an oversampling code averages.

        Parameters

        • code: number

          The oversampling code.

        Returns number

        The factor, or 0 when the code skips the measurement.

    • standbyMicros: function
      • Returns the standby period a standby code selects in normal mode.

        Parameters

        • code: number

          The standby code.

        Returns number

        The period in microseconds.

    • typicalMeasurementMicros: function
      • Returns the typical time one measurement takes.

        Parameters

        • temperature: number

          The temperature oversampling code.

        • pressure: number

          The pressure oversampling code.

        • humidity: number

          The humidity oversampling code.

        Returns number

        The datasheet's typical time in microseconds.