|
RocketLogger
1.1.5
|
#include <errno.h>#include <math.h>#include <stdint.h>#include <stdio.h>#include <unistd.h>#include <fcntl.h>#include <linux/i2c-dev.h>#include <sys/ioctl.h>#include <sys/stat.h>#include <sys/types.h>#include "../log.h"#include "../types.h"
Include dependency graph for bme280.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | BME280_calibration_t |
Functions | |
| int | BME280_init (int) |
| void | BME280_close (int) |
| int | BME280_read (int) |
| int32_t | BME280_getValue (int, int) |
| int | BME280_getID (void) |
| int | BME280_readCalibration (int) |
| int | BME280_setParameters (int) |
| int | BME280_getIndex (int) |
| int32_t | BME280_compensate_temperature_fine (int, int32_t) |
| int32_t | BME280_compensate_temperature (int, int32_t) |
| uint32_t | BME280_compensate_preasure (int, int32_t, int32_t) |
| uint32_t | BME280_compensate_humidity (int, int32_t, int32_t) |
| #define BME280_CALIBRATION_BLOCK1_SIZE 26 |
Definition at line 79 of file bme280.h.
Referenced by BME280_readCalibration().
| #define BME280_CALIBRATION_BLOCK2_SIZE 7 |
Definition at line 80 of file bme280.h.
Referenced by BME280_readCalibration().
| #define BME280_CHANNEL_HUMIDITY 1 |
Definition at line 56 of file bme280.h.
Referenced by BME280_getValue().
| #define BME280_CHANNEL_PREASURE 2 |
Definition at line 57 of file bme280.h.
Referenced by BME280_getValue().
| #define BME280_CHANNEL_TEMPERATURE 0 |
Definition at line 55 of file bme280.h.
Referenced by BME280_getValue().
| #define BME280_DATA_BLOCK_SIZE 8 |
Definition at line 82 of file bme280.h.
Referenced by BME280_read().
| #define BME280_FILTER_OFF 0x00 |
Definition at line 120 of file bme280.h.
Referenced by BME280_setParameters().
| #define BME280_I2C_ADDRESS_LEFT 0x76 |
Copyright (c) 2016-2019, Swiss Federal Institute of Technology (ETH Zurich) All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| #define BME280_I2C_ADDRESSES { (BME280_I2C_ADDRESS_LEFT) } |
| #define BME280_ID 0x60 |
Definition at line 60 of file bme280.h.
Referenced by BME280_init().
| #define BME280_MODE_NORMAL 0x03 |
Definition at line 110 of file bme280.h.
Referenced by BME280_setParameters().
| #define BME280_OVERSAMPLE_HUMIDITY_1 0x01 |
Definition at line 87 of file bme280.h.
Referenced by BME280_setParameters().
| #define BME280_OVERSAMPLE_PREASURE_1 0x04 |
Definition at line 103 of file bme280.h.
Referenced by BME280_setParameters().
| #define BME280_OVERSAMPLE_TEMPERATURE_1 0x20 |
Definition at line 97 of file bme280.h.
Referenced by BME280_setParameters().
| #define BME280_REG_CALIBRATION_BLOCK1 0x88 |
Definition at line 62 of file bme280.h.
Referenced by BME280_readCalibration().
| #define BME280_REG_CALIBRATION_BLOCK2 0xE1 |
Definition at line 65 of file bme280.h.
Referenced by BME280_readCalibration().
| #define BME280_REG_CONFIG 0xF5 |
Definition at line 69 of file bme280.h.
Referenced by BME280_setParameters().
| #define BME280_REG_CONTROL_HUMIDITY 0xF2 |
Definition at line 66 of file bme280.h.
Referenced by BME280_setParameters().
| #define BME280_REG_CONTROL_MEASURE 0xF4 |
Definition at line 68 of file bme280.h.
Referenced by BME280_setParameters().
| #define BME280_REG_ID 0xD0 |
Definition at line 63 of file bme280.h.
Referenced by BME280_getID().
| #define BME280_REG_PREASURE_MSB 0xF7 |
Definition at line 70 of file bme280.h.
Referenced by BME280_read().
| #define BME280_STANDBY_DURATION_250 0x60 |
Definition at line 115 of file bme280.h.
Referenced by BME280_setParameters().
| void BME280_close | ( | int | sensor_identifier | ) |
| uint32_t BME280_compensate_humidity | ( | int | sensor_identifier, |
| int32_t | humidity_raw, | ||
| int32_t | temperature_raw | ||
| ) |
Get the compensated relative humidity in micros (0.0001 percents).
| sensor_identifier | The I2C address of the sensor |
| humidity_raw | The raw humidity reading |
| temperature_raw | The raw temperature reading |
Definition at line 398 of file bme280.c.
References BME280_calibration, BME280_compensate_temperature_fine(), BME280_getIndex(), BME280_calibration_t::H1, BME280_calibration_t::H2, BME280_calibration_t::H3, BME280_calibration_t::H4, BME280_calibration_t::H5, and BME280_calibration_t::H6.
Referenced by BME280_read().
Here is the call graph for this function:| uint32_t BME280_compensate_preasure | ( | int | sensor_identifier, |
| int32_t | preasure_raw, | ||
| int32_t | temperature_raw | ||
| ) |
Get the compensated preasure in milli Pascal.
| sensor_identifier | The I2C address of the sensor |
| preasure_raw | The raw preasure reading |
| temperature_raw | The raw temperature reading |
Definition at line 353 of file bme280.c.
References BME280_calibration, BME280_compensate_temperature_fine(), BME280_getIndex(), BME280_calibration_t::P1, BME280_calibration_t::P2, BME280_calibration_t::P3, BME280_calibration_t::P4, BME280_calibration_t::P5, BME280_calibration_t::P6, BME280_calibration_t::P7, BME280_calibration_t::P8, and BME280_calibration_t::P9.
Referenced by BME280_read().
Here is the call graph for this function:| int32_t BME280_compensate_temperature | ( | int | sensor_identifier, |
| int32_t | temperature_raw | ||
| ) |
Get the compensated temperature in milli degree centigrade.
| sensor_identifier | The I2C address of the sensor |
| temperature_raw | The raw temperature reading |
Definition at line 338 of file bme280.c.
References BME280_compensate_temperature_fine().
Referenced by BME280_read().
Here is the call graph for this function:| int32_t BME280_compensate_temperature_fine | ( | int | sensor_identifier, |
| int32_t | temperature_raw | ||
| ) |
Get fine grained temperature compensation value for further processing.
| sensor_identifier | The I2C address of the sensor |
| temperature_raw | The raw temperature reading |
Definition at line 311 of file bme280.c.
References BME280_calibration, BME280_getIndex(), BME280_calibration_t::T1, BME280_calibration_t::T2, and BME280_calibration_t::T3.
Referenced by BME280_compensate_humidity(), BME280_compensate_preasure(), and BME280_compensate_temperature().
Here is the call graph for this function:| int BME280_getID | ( | void | ) |
Get the device ID
| sensor_identifier | The I2C address of the sensor |
Definition at line 170 of file bme280.c.
References BME280_REG_ID, ERROR, rl_log(), sensor_bus, and Sensors_getSharedBus().
Referenced by BME280_init().
Here is the call graph for this function:| int BME280_getIndex | ( | int | sensor_identifier | ) |
Get the index of the sensor with specified address.
| sensor_identifier | The sensor address used to look up the index |
Definition at line 294 of file bme280.c.
References BME280_sensors.
Referenced by BME280_compensate_humidity(), BME280_compensate_preasure(), BME280_compensate_temperature_fine(), BME280_getValue(), BME280_read(), and BME280_readCalibration().
| int32_t BME280_getValue | ( | int | sensor_identifier, |
| int | channel | ||
| ) |
Get the values read from the sensor
| sensor_identifier | The I2C address of the sensor |
| channel | The channel of the sensor to get |
Definition at line 147 of file bme280.c.
References BME280_CHANNEL_HUMIDITY, BME280_CHANNEL_PREASURE, BME280_CHANNEL_TEMPERATURE, BME280_getIndex(), BME280_humidity, BME280_preasure, and BME280_temperature.
Here is the call graph for this function:| int BME280_init | ( | int | sensor_identifier | ) |
Initialize the light sensor
| sensor_identifier | The I2C address of the sensor |
Definition at line 49 of file bme280.c.
References BME280_getID(), BME280_ID, BME280_readCalibration(), BME280_setParameters(), ERROR, FAILURE, rl_log(), sensor_bus, Sensors_getSharedBus(), Sensors_initSharedComm(), and SUCCESS.
Here is the call graph for this function:| int BME280_read | ( | int | sensor_identifier | ) |
Read the sensor values.
| sensor_identifier | The I2C address of the sensor |
Definition at line 99 of file bme280.c.
References BME280_compensate_humidity(), BME280_compensate_preasure(), BME280_compensate_temperature(), BME280_DATA_BLOCK_SIZE, BME280_getIndex(), BME280_humidity, BME280_preasure, BME280_REG_PREASURE_MSB, BME280_temperature, ERROR, FAILURE, rl_log(), sensor_bus, Sensors_getSharedBus(), Sensors_initSharedComm(), and SUCCESS.
Here is the call graph for this function:| int BME280_readCalibration | ( | int | sensor_identifier | ) |
Read the sensor specifc calibration values.
| sensor_identifier | The I2C address of the sensor |
Definition at line 186 of file bme280.c.
References BME280_calibration, BME280_CALIBRATION_BLOCK1_SIZE, BME280_CALIBRATION_BLOCK2_SIZE, BME280_getIndex(), BME280_REG_CALIBRATION_BLOCK1, BME280_REG_CALIBRATION_BLOCK2, ERROR, FAILURE, BME280_calibration_t::H1, BME280_calibration_t::H2, BME280_calibration_t::H3, BME280_calibration_t::H4, BME280_calibration_t::H5, BME280_calibration_t::H6, BME280_calibration_t::P1, BME280_calibration_t::P2, BME280_calibration_t::P3, BME280_calibration_t::P4, BME280_calibration_t::P5, BME280_calibration_t::P6, BME280_calibration_t::P7, BME280_calibration_t::P8, BME280_calibration_t::P9, rl_log(), sensor_bus, Sensors_getSharedBus(), SUCCESS, BME280_calibration_t::T1, BME280_calibration_t::T2, and BME280_calibration_t::T3.
Referenced by BME280_init().
Here is the call graph for this function:| int BME280_setParameters | ( | int | sensor_identifier | ) |
Set the sensor parameter to default for continuous sensing.
Definition at line 253 of file bme280.c.
References BME280_FILTER_OFF, BME280_MODE_NORMAL, BME280_OVERSAMPLE_HUMIDITY_1, BME280_OVERSAMPLE_PREASURE_1, BME280_OVERSAMPLE_TEMPERATURE_1, BME280_REG_CONFIG, BME280_REG_CONTROL_HUMIDITY, BME280_REG_CONTROL_MEASURE, BME280_STANDBY_DURATION_250, ERROR, FAILURE, rl_log(), sensor_bus, Sensors_getSharedBus(), and SUCCESS.
Referenced by BME280_init().
Here is the call graph for this function: