|
RocketLogger 2.1.3
|
#include <errno.h>#include <stdint.h>#include <string.h>#include <i2c/smbus.h>#include "../log.h"#include "sensor.h"#include "bme280.h"
Include dependency graph for bme280.c:Go to the source code of this file.
Functions | |
| int | bme280_get_id (void) |
| int | bme280_read_calibration (int sensor_identifier) |
| int | bme280_set_parameters (int sensor_identifier) |
| int | bme280_get_index (int sensor_identifier) |
| int | bme280_init (int sensor_identifier) |
| void | bme280_deinit (int sensor_identifier) |
| int | bme280_read (int sensor_identifier) |
| int32_t | bme280_get_value (int sensor_identifier, int channel) |
Variables | |
| const int | bme280_sensors [] = BME280_I2C_ADDRESSES |
| int32_t | bme280_temperature [sizeof(bme280_sensors)] = {0} |
| int32_t | bme280_humidity [sizeof(bme280_sensors)] = {0} |
| int32_t | bme280_pressure [sizeof(bme280_sensors)] = {0} |
| bme280_calibration_t | bme280_calibration [sizeof(bme280_sensors)] |
| void bme280_deinit | ( | int | sensor_identifier | ) |
| int bme280_get_id | ( | void | ) |
Get the device ID.
Definition at line 255 of file bme280.c.
References BME280_REG_ID, rl_log(), RL_LOG_ERROR, sensor_bus, and sensors_get_bus().
Referenced by bme280_init().
Here is the call graph for this function:| int bme280_get_index | ( | 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 378 of file bme280.c.
References bme280_sensors.
Referenced by bme280_get_value(), bme280_read(), and bme280_read_calibration().
| int32_t bme280_get_value | ( | 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 237 of file bme280.c.
References BME280_CHANNEL_HUMIDITY, BME280_CHANNEL_PRESSURE, BME280_CHANNEL_TEMPERATURE, bme280_get_index(), bme280_humidity, bme280_pressure, and bme280_temperature.
Here is the call graph for this function:| int bme280_init | ( | int | sensor_identifier | ) |
Initialize the BME280 ambient sensor.
| sensor_identifier | The I2C address of the sensor |
Definition at line 144 of file bme280.c.
References bme280_get_id(), BME280_ID, bme280_read_calibration(), bme280_set_parameters(), rl_log(), RL_LOG_ERROR, sensor_bus, sensors_get_bus(), and sensors_init_comm().
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 193 of file bme280.c.
References BME280_DATA_BLOCK_SIZE, bme280_get_index(), bme280_humidity, bme280_pressure, BME280_REG_PRESSURE_MSB, bme280_temperature, data, rl_log(), RL_LOG_ERROR, sensor_bus, sensors_get_bus(), and sensors_init_comm().
Here is the call graph for this function:| int bme280_read_calibration | ( | int | sensor_identifier | ) |
Read the sensor specific calibration values.
| sensor_identifier | The I2C address of the sensor |
Definition at line 268 of file bme280.c.
References BME280_CALIBRATION_BLOCK1_SIZE, BME280_CALIBRATION_BLOCK2_SIZE, bme280_get_index(), BME280_REG_CALIBRATION_BLOCK1, BME280_REG_CALIBRATION_BLOCK2, data, bme280_calibration::H1, bme280_calibration::H2, bme280_calibration::H3, bme280_calibration::H4, bme280_calibration::H5, bme280_calibration::H6, bme280_calibration::P1, bme280_calibration::P2, bme280_calibration::P3, bme280_calibration::P4, bme280_calibration::P5, bme280_calibration::P6, bme280_calibration::P7, bme280_calibration::P8, bme280_calibration::P9, rl_log(), RL_LOG_ERROR, sensor_bus, sensors_get_bus(), bme280_calibration::T1, bme280_calibration::T2, and bme280_calibration::T3.
Referenced by bme280_init().
Here is the call graph for this function:| int bme280_set_parameters | ( | int | sensor_identifier | ) |
Set the sensor parameter to default for continuous sensing.
| sensor_identifier | The I2C address of the sensor |
Definition at line 335 of file bme280.c.
References BME280_FILTER_OFF, BME280_MODE_NORMAL, BME280_OVERSAMPLE_HUMIDITY_1, BME280_OVERSAMPLE_PRESSURE_1, BME280_OVERSAMPLE_TEMPERATURE_1, BME280_REG_CONFIG, BME280_REG_CONTROL_HUMIDITY, BME280_REG_CONTROL_MEASURE, BME280_STANDBY_DURATION_250, rl_log(), RL_LOG_ERROR, sensor_bus, and sensors_get_bus().
Referenced by bme280_init().
Here is the call graph for this function:| bme280_calibration_t bme280_calibration[sizeof(bme280_sensors)] |
| int32_t bme280_humidity[sizeof(bme280_sensors)] = {0} |
Humidity sensor data buffer.
Definition at line 132 of file bme280.c.
Referenced by bme280_get_value(), and bme280_read().
| int32_t bme280_pressure[sizeof(bme280_sensors)] = {0} |
Pressure sensor data buffer.
Definition at line 137 of file bme280.c.
Referenced by bme280_get_value(), and bme280_read().
| const int bme280_sensors[] = BME280_I2C_ADDRESSES |
Copyright (c) 2016-2020, ETH Zurich, Computer Engineering Group 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. List of potentially connected BME280 sensors.
Definition at line 46 of file bme280.c.
Referenced by bme280_get_index().
| int32_t bme280_temperature[sizeof(bme280_sensors)] = {0} |
Temperature sensor data buffer.
Definition at line 127 of file bme280.c.
Referenced by bme280_get_value(), and bme280_read().