Liking cljdoc? Tell your friends :D

dvlopt.linux.i2c.bme280

Interface for talking to BME280 sensors via I2C.

Any IO operation might throw in case of failure, and do not forget to always select the proper slave.

Relies on :

https://github.com/dvlopt/linux.i2c.clj

Interface for talking to BME280 sensors via I2C.

Any IO operation might throw in case of failure, and do not forget to always select the proper slave.

Relies on :

  https://github.com/dvlopt/linux.i2c.clj
raw docstring

compensation-wordsclj

(compensation-words bus)

Retrieves compensation words from the slave.

Each sensor behaves a little differently, hence raw data must later be adjusted using those words.

Retrieves compensation words from the slave.

Each sensor behaves a little differently, hence raw data must later be adjusted using those words.
sourceraw docstring

configureclj

(configure bus)
(configure bus configuration)

Configures a previously selected slave device.

The configuration map may have the following options :

::iir-filter

The internal IIR filter can be configured for when the environmental pressure is subject to many short-term
changes such as slamming a door or the wind blowing on the sensor. This will also affect temperature measurements.

The value is one of these coefficients :

    coefficient | samples to reach >= 75% of step response
    ------------------------------------------------------
       0 (off)  |  1
       2        |  2
       4        |  5
       8        | 11
      16        | 22

::mode

Mode is one of :

    :sleep
        No operation, all registers accessible, lower power, selected after startup.

    :forced
        Perform one measurement, store results and return to sleep mode. To do another
        measurement, call this function with forced mode again.
        Recommended for low sampling rate, or "à la carte".

    :normal
        Perpetual cycling of measurements and inactive periods.
        Recommended for high sampling rate.

If the device is currently performing a measurement, execution of mode switching is delayed
until the end of the currently running measurement period.

::oversampling.humidity ::oversampling.pressure ::oversampling.temperature

Oversamplings are one of (where 0 = disable measurement) :

    #{:x0 :x1 :x2 :x4 :x8 :x16}

::standby

Inactive duration period between 2 measurements, relevant for the :normal mode, in milliseconds.
Must be one of :

    #{:0.5-ms :10-ms :20-ms :62.5-ms :125-ms :250-ms :500-ms :1000-ms}

Cf. defaults for used values for missing options

Configures a previously selected slave device.

The configuration map may have the following options :

  ::iir-filter

    The internal IIR filter can be configured for when the environmental pressure is subject to many short-term
    changes such as slamming a door or the wind blowing on the sensor. This will also affect temperature measurements.

    The value is one of these coefficients :

        coefficient | samples to reach >= 75% of step response
        ------------------------------------------------------
           0 (off)  |  1
           2        |  2
           4        |  5
           8        | 11
          16        | 22

  ::mode

    Mode is one of :

        :sleep
            No operation, all registers accessible, lower power, selected after startup.

        :forced
            Perform one measurement, store results and return to sleep mode. To do another
            measurement, call this function with forced mode again.
            Recommended for low sampling rate, or "à la carte".

        :normal
            Perpetual cycling of measurements and inactive periods.
            Recommended for high sampling rate.

    If the device is currently performing a measurement, execution of mode switching is delayed
    until the end of the currently running measurement period.

  ::oversampling.humidity
  ::oversampling.pressure
  ::oversampling.temperature

    Oversamplings are one of (where 0 = disable measurement) :

        #{:x0 :x1 :x2 :x4 :x8 :x16}

  ::standby

    Inactive duration period between 2 measurements, relevant for the :normal mode, in milliseconds.
    Must be one of :

        #{:0.5-ms :10-ms :20-ms :62.5-ms :125-ms :250-ms :500-ms :1000-ms}


Cf. `defaults` for used values for missing options
sourceraw docstring

cycle-durationclj

(cycle-duration)
(cycle-duration configuration)

Given a configuration map, computes the duration of a single measurement cycle in milliseconds.

Returns a map containing :maximum, the maximum duration :typical, the typical duration.

Cf. configure

Given a configuration map, computes the duration of a single measurement cycle in milliseconds.

Returns a map containing :maximum, the maximum duration
                         :typical, the typical duration.

Cf. `configure`
sourceraw docstring

defaultsclj

Defaults values for options and keys used throughout this namespace.

Defaults values for options and keys used throughout this namespace.
sourceraw docstring

read-sensorsclj

(read-sensors bus compensation-words)

Reads data from the sensors and adjusts it using the given compensation-words.

Returns a map containing :

::humidity in %rH ::pressure in Pa ::temperature in °C

Cf. compensation-words

Reads data from the sensors and adjusts it using the given compensation-words.

Returns a map containing :

  ::humidity    in %rH
  ::pressure    in Pa
  ::temperature in °C


Cf. `compensation-words`
sourceraw docstring

soft-resetclj

(soft-reset bus)

Orders the slave to perform a soft reset.

Orders the slave to perform a soft reset.
sourceraw docstring

statusclj

(status bus)

Retrieves the current status of the slave and returns a map containing

::copying-nvm? True when NVM data is being copied to image registers. ::running-conversion? True when a conversion is currently running.

Retrieves the current status of the slave and returns a map containing

::copying-nvm?         True when NVM data is being copied to image registers.
::running-conversion?  True when a conversion is currently running.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close