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

    Variable scd4xConst

    scd4x: {
        address: number;
        co2MaxPpm: number;
        command: {
            getAutomaticSelfCalibrationEnabled: number;
            getDataReadyStatus: number;
            getSensorAltitude: number;
            getSerialNumber: number;
            getTemperatureOffset: number;
            measureSingleShot: number;
            measureSingleShotRhtOnly: number;
            performFactoryReset: number;
            performForcedRecalibration: number;
            performSelfTest: number;
            persistSettings: number;
            powerDown: number;
            readMeasurement: number;
            reinit: number;
            setAmbientPressure: number;
            setAutomaticSelfCalibrationEnabled: number;
            setSensorAltitude: number;
            setTemperatureOffset: number;
            startLowPowerPeriodicMeasurement: number;
            startPeriodicMeasurement: number;
            stopPeriodicMeasurement: number;
            wakeUp: number;
        };
        defaultTemperatureOffsetMilliCelsius: number;
        forcedRecalibrationFailed: number;
        lowPowerPeriodicMeasurementIntervalMs: number;
        periodicMeasurementIntervalMs: number;
        powerUpTimeMs: number;
        allowedDuringMeasurement(command: number): boolean;
        ambientPressurePascals(word: number): number;
        ambientPressureWord(pascals: number): number;
        automaticSelfCalibrationEnabled(word: number): boolean;
        automaticSelfCalibrationWord(enabled: boolean): number;
        celsius(raw: number): number;
        commandFrame(command: number): Buffer;
        crc(data: Uint8Array): number;
        dataReady(word: number): boolean;
        forcedRecalibrationCorrectionPpm(word: number): number | null;
        forcedRecalibrationWord(correctionPpm: number | null): number;
        humidityMilliPercent(raw: number): number;
        humidityRaw(milliPercent: number): number;
        maxDurationMs(command: number): number | null;
        measurementBytes(
            co2Ppm: number,
            temperatureRaw: number,
            humidityRaw: number,
        ): Buffer;
        measurementFromPhysical(
            co2Ppm: number,
            milliCelsius: number,
            humidityMilliPercent: number,
        ): sensors.Scd4xMeasurement;
        milliCelsius(raw: number): number;
        parseMeasurement(bytes: Uint8Array): sensors.Scd4xMeasurement;
        relativeHumidityPercent(raw: number): number;
        selfTestPassed(word: number): boolean;
        serialNumber(frame: Uint8Array): number;
        serialNumberFrame(serial: number): Buffer;
        temperatureOffsetMilliCelsius(word: number): number;
        temperatureOffsetWord(milliCelsius: number): number;
        temperatureRaw(milliCelsius: number): number;
        word(frame: Uint8Array): number;
        wordFrame(value: number): Buffer;
        writeFrame(command: number, value: number): Buffer;
    }

    A Sensirion SCD40 or SCD41 photoacoustic CO2, humidity, and temperature sensor.

    Type Declaration

    • address: number

      The only address the part answers on.

    • co2MaxPpm: number

      The highest concentration the part reports, in parts per million.

    • command: {
          getAutomaticSelfCalibrationEnabled: number;
          getDataReadyStatus: number;
          getSensorAltitude: number;
          getSerialNumber: number;
          getTemperatureOffset: number;
          measureSingleShot: number;
          measureSingleShotRhtOnly: number;
          performFactoryReset: number;
          performForcedRecalibration: number;
          performSelfTest: number;
          persistSettings: number;
          powerDown: number;
          readMeasurement: number;
          reinit: number;
          setAmbientPressure: number;
          setAutomaticSelfCalibrationEnabled: number;
          setSensorAltitude: number;
          setTemperatureOffset: number;
          startLowPowerPeriodicMeasurement: number;
          startPeriodicMeasurement: number;
          stopPeriodicMeasurement: number;
          wakeUp: number;
      }

      The command words a driver writes.

      • getAutomaticSelfCalibrationEnabled: number

        Read whether automatic self-calibration is on.

      • getDataReadyStatus: number

        Ask whether a result is waiting.

      • getSensorAltitude: number

        Read the installation altitude.

      • getSerialNumber: number

        Read the serial number.

      • getTemperatureOffset: number

        Read the temperature offset.

      • measureSingleShot: number

        Take one measurement and return to idle.

      • measureSingleShotRhtOnly: number

        Take one humidity and temperature measurement, without CO2.

      • performFactoryReset: number

        Restore the factory settings.

      • performForcedRecalibration: number

        Run a forced recalibration against a known concentration.

      • performSelfTest: number

        Run the self test.

      • persistSettings: number

        Copy the settings to non-volatile memory.

      • powerDown: number

        Enter sleep, SCD41 only.

      • readMeasurement: number

        Read the latest result.

      • reinit: number

        Reinitialise from the stored settings.

      • setAmbientPressure: number

        Write the ambient pressure, which overrides the altitude.

      • setAutomaticSelfCalibrationEnabled: number

        Turn automatic self-calibration on or off.

      • setSensorAltitude: number

        Write the installation altitude.

      • setTemperatureOffset: number

        Write the temperature offset.

      • startLowPowerPeriodicMeasurement: number

        Start low-power periodic measurement.

      • startPeriodicMeasurement: number

        Start periodic measurement.

      • stopPeriodicMeasurement: number

        Leave periodic measurement.

      • wakeUp: number

        Leave sleep, SCD41 only.

    • defaultTemperatureOffsetMilliCelsius: number

      The temperature offset the part powers up with, in milli-degrees Celsius.

    • forcedRecalibrationFailed: number

      The word a forced recalibration returns when it did not take.

    • lowPowerPeriodicMeasurementIntervalMs: number

      How often low-power periodic measurement produces a result, in milliseconds.

    • periodicMeasurementIntervalMs: number

      How often periodic measurement produces a result, in milliseconds.

    • powerUpTimeMs: number

      How long the part takes to become ready after power-up, in milliseconds.

    • allowedDuringMeasurement: function
      • Reports whether the part accepts a command while it is measuring.

        Parameters

        • command: number

          The command word.

        Returns boolean

        Whether the command can be sent without stopping measurement first.

    • ambientPressurePascals: function
      • Converts an ambient-pressure word to pascals.

        Parameters

        • word: number

          The word the part holds.

        Returns number

        The pressure.

    • ambientPressureWord: function
      • Builds the ambient-pressure word for a pressure in pascals.

        Parameters

        • pascals: number

          The ambient pressure the part should compensate for.

        Returns number

        The word to write, in hundreds of pascals.

    • automaticSelfCalibrationEnabled: function
      • Reports whether a self-calibration word says the feature is on.

        Parameters

        • word: number

          The word the part returned.

        Returns boolean

        Whether automatic self-calibration is enabled.

    • automaticSelfCalibrationWord: function
      • Builds the word that turns automatic self-calibration on or off.

        Parameters

        • enabled: boolean

          Whether the feature should run.

        Returns number

        The word to write.

    • celsius: function
      • Converts a raw temperature word to degrees Celsius.

        Parameters

        • raw: number

          The 16-bit word.

        Returns number

        The temperature.

    • commandFrame: function
      • Builds the two bytes that send a command with no argument.

        Parameters

        • command: number

          The command word.

        Returns Buffer

        The bytes to write.

    • crc: function
      • Computes the Sensirion CRC-8 the part appends to every word.

        Parameters

        • data: Uint8Array

          The bytes the checksum covers.

        Returns number

        The checksum.

    • dataReady: function
      • Reports whether a data-ready word says a measurement is waiting.

        Parameters

        • word: number

          The word the data-ready command returned.

        Returns boolean

        Whether a result can be read.

    • forcedRecalibrationCorrectionPpm: function
      • Reads the correction a forced recalibration applied.

        Parameters

        • word: number

          The word the recalibration returned.

        Returns number | null

        The correction in parts per million, or null if the recalibration did not take, which means the part had not measured for long enough.

    • forcedRecalibrationWord: function
      • Builds the word a part returns for a forced-recalibration outcome.

        Parameters

        • correctionPpm: number | null

          The correction applied, or null for a failure.

        Returns number

        The word.

    • humidityMilliPercent: function
      • Converts a raw humidity word to milli-percent relative humidity.

        Parameters

        • raw: number

          The 16-bit word.

        Returns number

        The humidity, exact in integer arithmetic.

    • humidityRaw: function
      • Builds the raw humidity word for a humidity in milli-percent.

        Parameters

        • milliPercent: number

          The relative humidity.

        Returns number

        The 16-bit word, clamped to the part's range.

    • maxDurationMs: function
      • Returns how long a command may take before its result can be read.

        Parameters

        • command: number

          The command word.

        Returns number | null

        The datasheet's worst case in milliseconds, or null for a command that returns immediately.

    • measurementBytes: function
      • Builds the nine bytes the part sends for three raw words.

        The inverse of parseMeasurement.

        Parameters

        • co2Ppm: number

          The CO2 concentration in parts per million.

        • temperatureRaw: number

          The raw temperature word.

        • humidityRaw: number

          The raw humidity word.

        Returns Buffer

        The frame, each word followed by its CRC.

    • measurementFromPhysical: function
      • Builds the measurement a part reporting these physical values would send.

        Parameters

        • co2Ppm: number

          The CO2 concentration in parts per million.

        • milliCelsius: number

          The temperature in milli-degrees Celsius.

        • humidityMilliPercent: number

          The relative humidity in milli-percent.

        Returns sensors.Scd4xMeasurement

        The measurement, with the raw words the part would carry.

    • milliCelsius: function
      • Converts a raw temperature word to milli-degrees Celsius.

        Parameters

        • raw: number

          The 16-bit word.

        Returns number

        The temperature, exact in integer arithmetic.

    • parseMeasurement: function
      • Parses and CRC-checks a nine-byte measurement frame.

        Parameters

        • bytes: Uint8Array

          The frame as the device sent it, each word followed by its CRC.

        Returns sensors.Scd4xMeasurement

        The raw words and the physical values they carry.

        If any checksum does not match.

    • relativeHumidityPercent: function
      • Converts a raw humidity word to a relative humidity percentage.

        Parameters

        • raw: number

          The 16-bit word.

        Returns number

        The humidity.

    • selfTestPassed: function
      • Reports whether a self-test word says the part passed.

        Parameters

        • word: number

          The word the self test returned.

        Returns boolean

        Whether the part reported no malfunction.

    • serialNumber: function
      • Reads a serial number out of the nine bytes the part sends.

        Parameters

        • frame: Uint8Array

          The three words and their checksums.

        Returns number

        The 48-bit serial number.

        If any checksum does not match.

    • serialNumberFrame: function
      • Builds the nine bytes the part sends for a serial number.

        Parameters

        • serial: number

          The 48-bit serial number.

        Returns Buffer

        The three words, each followed by its CRC.

    • temperatureOffsetMilliCelsius: function
      • Converts a temperature-offset word to milli-degrees Celsius.

        Parameters

        • word: number

          The word the part returned.

        Returns number

        The offset.

    • temperatureOffsetWord: function
      • Builds the temperature-offset word for an offset in milli-degrees Celsius.

        Parameters

        • milliCelsius: number

          The offset to subtract from the reading.

        Returns number

        The word to write.

    • temperatureRaw: function
      • Builds the raw temperature word for a temperature in milli-degrees Celsius.

        Parameters

        • milliCelsius: number

          The temperature.

        Returns number

        The 16-bit word, clamped to the part's range.

    • word: function
      • Reads a CRC-checked word off the bus.

        Parameters

        • frame: Uint8Array

          The two data bytes and their checksum.

        Returns number

        The word.

        If the checksum does not match.

    • wordFrame: function
      • Builds the three bytes the part sends for a word, its checksum last.

        Parameters

        • value: number

          The word.

        Returns Buffer

        The two data bytes and their checksum.

    • writeFrame: function
      • Builds the five bytes that send a command with an argument.

        Parameters

        • command: number

          The command word.

        • value: number

          The argument.

        Returns Buffer

        The command, the argument, and the argument's checksum.