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

    Variable bmp280Const

    bmp280: {
        addressPrimary: number;
        addressSecondary: number;
        calibrationLength: number;
        chipId: number;
        dataLength: number;
        oversampling: {
            skipped: number;
            x1: number;
            x16: number;
            x2: number;
            x4: number;
            x8: number;
        };
        register: {
            calibration: number;
            chipId: number;
            config: number;
            ctrlMeas: number;
            data: number;
            reset: number;
            status: number;
        };
        resetWord: number;
        sim: {
            statusIdle: number;
            burst(): Buffer;
            burstFor(celsius: number, hectopascals: number): Buffer;
            calibration(): Buffer;
            part(address: number): hal.I2cPart;
            reporting(
                address: number,
                celsius: number,
                hectopascals: number,
            ): hal.I2cPart;
        };
        skippedOutput: number;
        calibration(bytes: Uint8Array): Bmp280Calibration;
        configBits(config: Bmp280Config): number;
        configFromBits(bits: number): Bmp280Config;
        ctrlMeasBits(ctrl: Bmp280CtrlMeas): number;
        ctrlMeasFromBits(bits: number): Bmp280CtrlMeas;
        imageUpdating(status: number): boolean;
        measurementBytes(pressure: number, temperature: number): Buffer;
        measuring(status: number): boolean;
        oversamplingFactor(code: number): number;
        parseMeasurement(bytes: Uint8Array): Bmp280RawMeasurement;
        pressureSkipped(pressure: number): boolean;
        standbyMicros(code: number): number;
        temperatureSkipped(temperature: number): boolean;
    } = ...

    A Bosch BMP280 pressure and temperature sensor, the BME280 without humidity.

    Type Declaration

    • addressPrimary: number

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

    • addressSecondary: number

      The address it answers on with SDO high.

    • calibrationLength: number

      How many bytes the calibration block holds.

    • chipId: number

      The value its chip-ID register reads, which confirms the part.

    • dataLength: number

      How many bytes one measurement burst holds.

    • 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: {
          calibration: number;
          chipId: number;
          config: number;
          ctrlMeas: number;
          data: number;
          reset: number;
          status: number;
      }

      The registers a driver reads and writes.

      • calibration: number

        The first of the 24 calibration bytes.

      • chipId: number

        The chip-ID register.

      • config: number

        The configuration register.

      • ctrlMeas: number

        The measurement-control register.

      • data: number

        The first of the six data bytes.

      • 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): Buffer;
          calibration(): Buffer;
          part(address: number): hal.I2cPart;
          reporting(
              address: number,
              celsius: number,
              hectopascals: number,
          ): hal.I2cPart;
      }

      A BMP280 that is not there, for a bus with nothing plugged in. A BMP280 is a BME280 without humidity, so part holds the temperature and pressure half of a real part and reads 20.44 C and 848.05 hPa.

      • statusIdle: number

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

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

          Returns Buffer

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

          Parameters

          • celsius: number

            The temperature.

          • hectopascals: number

            The pressure.

          Returns Buffer

          The bytes a burst read would return.

      • calibration: function
      • part: function
        • A part holding a real part's trimming and one measurement it took.

          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, within a hundredth of a degree and of a hectopascal.

          Parameters

          • address: number

            The address it answers to.

          • celsius: number

            The temperature it reports.

          • hectopascals: number

            The pressure it reports.

          Returns hal.I2cPart

          The part, to put on a simulated bus.

    • skippedOutput: number

      The raw output a channel reports when its measurement is switched off.

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

        Parameters

        • bytes: Uint8Array

          The 24-byte calibration block.

        Returns Bmp280Calibration

        The calibration, to reuse for every measurement.

        If the block is the wrong length.

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

        Parameters

        • status: number

          The status register.

        Returns boolean

        Whether the image registers are being reloaded.

    • measurementBytes: function
      • Builds the six data-register bytes a part reports for two raw outputs.

        The inverse of parseMeasurement, so a node can be written and tested against what a sensor sends without one attached.

        Parameters

        • pressure: number

          The 20-bit uncompensated pressure.

        • temperature: number

          The 20-bit uncompensated temperature.

        Returns Buffer

        The six bytes in read order.

    • 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, 0 to 7.

        Returns number

        The sample count, or 0 when the measurement is switched off.

    • parseMeasurement: function
      • Splits a six-byte data read into its two uncompensated outputs.

        Parameters

        • bytes: Uint8Array

          The six data registers in read order.

        Returns Bmp280RawMeasurement

        The raw pressure and temperature, before compensation.

        If the read is the wrong length.

    • pressureSkipped: function
      • Reports whether a raw pressure says the measurement is switched off.

        Parameters

        • pressure: number

          The 20-bit uncompensated pressure.

        Returns boolean

        Whether the channel's oversampling is set to skip.

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

        Parameters

        • code: number

          The standby code, 0 to 7.

        Returns number

        The standby time in microseconds.

    • temperatureSkipped: function
      • Reports whether a raw temperature says the measurement is switched off.

        Parameters

        • temperature: number

          The 20-bit uncompensated temperature.

        Returns boolean

        Whether the channel's oversampling is set to skip.