![]() |
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Sensor driver for BMP280 sensor. More...
#include "peripherals/bmp280.h"
Go to the source code of this file.
Functions | |
static void | parse_sensor_data (struct bmp280_t *bmp, uint8_t *data) |
local function to extract raw data from i2c buffer and compute compensation with selected precision | |
static void | parse_calib_data (struct bmp280_t *bmp, uint8_t *data) |
This internal API is used to parse the calibration data, compensates it and store it in device structure (float version) | |
static double | compensate_pressure (struct bmp280_t *bmp) |
This internal API is used to compensate the raw pressure data and return the compensated pressure data in integer data type. | |
static double | compensate_temperature (struct bmp280_t *bmp) |
This internal API is used to compensate the raw temperature data and return the compensated temperature data in float data type. | |
static bool | bmp280_config (struct bmp280_t *bmp) |
Configure the BMP280 device register by register. | |
static void | bmp280_register_write (struct bmp280_t *bmp, uint8_t reg, uint8_t value) |
Write a register with a value. | |
static void | bmp280_register_read (struct bmp280_t *bmp, uint8_t reg, uint16_t size) |
Read a register. | |
void | bmp280_init (struct bmp280_t *bmp) |
Initialize the bmp280 sensor instance. | |
void | bmp280_periodic (struct bmp280_t *bmp) |
Should be called periodically to request sensor readings. | |
void | bmp280_event (struct bmp280_t *bmp) |
Should be called in the event thread. | |
Sensor driver for BMP280 sensor.
Definition in file bmp280.c.
Configure the BMP280 device register by register.
bmp | The bmp280 instance |
Definition at line 329 of file bmp280.c.
References BMP280_CONFIG_REG_ADDR, BMP280_CTRL_MEAS_REG_ADDR, BMP280_IIR_FILTER_COEFF_16, BMP280_INACTIVITY_HALF_MS, BMP280_OVERSAMPLING_16X_P, BMP280_OVERSAMPLING_2X_T, BMP280_POWER_NORMAL_MODE, bmp280_register_write(), and foo.
Referenced by bmp280_event(), and bmp280_periodic().
Should be called in the event thread.
bmp | The bmp280 instance |
Definition at line 157 of file bmp280.c.
References bmp280_config(), BMP280_EOC_BIT, BMP280_I2C, BMP280_ID_NB, BMP280_NVRAM_COPY_BIT, BMP280_SPI, BMP280_STATUS_CONFIGURE, BMP280_STATUS_GET_CALIB, BMP280_STATUS_IDLE, BMP280_STATUS_READ_DATA_REGS, BMP280_STATUS_READ_STATUS_REG, BMP280_STATUS_UNINIT, BMP_280, compensate_pressure(), compensate_temperature(), foo, I2CTransDone, I2CTransFailed, I2CTransSuccess, parse_calib_data(), parse_sensor_data(), SPITransDone, SPITransFailed, and SPITransSuccess.
Referenced by baro_bmp280_event().
Initialize the bmp280 sensor instance.
bmp | The structure containing the configuration of the bmp280 instance |
Definition at line 48 of file bmp280.c.
References BMP280_SPI, BMP280_STATUS_UNINIT, foo, I2CTransDone, SPICphaEdge2, SPICpolIdleHigh, SPIDiv16, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, and SPITransDone.
Referenced by baro_bmp280_init().
Should be called periodically to request sensor readings.
bmp | The bmp280 instance |
Definition at line 101 of file bmp280.c.
References BMP280_CALIB_DATA_LEN, BMP280_CALIB_LSB_DATA_ADDR, BMP280_CHIP_ID_REG_ADDR, bmp280_config(), BMP280_DATA_START_REG_ADDR, BMP280_I2C, BMP280_P_T_DATA_LEN, bmp280_register_read(), BMP280_SPI, BMP280_STATUS_CONFIGURE, BMP280_STATUS_GET_CALIB, BMP280_STATUS_IDLE, BMP280_STATUS_READ_DATA_REGS, BMP280_STATUS_READ_STATUS_REG, BMP280_STATUS_REG_ADDR, BMP280_STATUS_UNINIT, foo, I2CTransDone, and SPITransDone.
Referenced by baro_bmp280_periodic().
Read a register.
bmp | The bmp280 instance |
reg | The register address |
size | The size to read (already 1 is added for the transmission of the register to read) |
Definition at line 384 of file bmp280.c.
References BMP280_READ_FLAG, BMP280_SPI, foo, i2c_transceive(), and spi_submit().
Referenced by bmp280_periodic().
Write a register with a value.
bmp | The bmp280 instance |
reg | The register address |
value | The value to write to the register |
Definition at line 359 of file bmp280.c.
References BMP280_SPI, foo, i2c_transmit(), and spi_submit().
Referenced by bmp280_config().
This internal API is used to compensate the raw pressure data and return the compensated pressure data in integer data type.
Definition at line 300 of file bmp280.c.
Referenced by bmp280_event().
This internal API is used to compensate the raw temperature data and return the compensated temperature data in float data type.
Definition at line 281 of file bmp280.c.
References foo.
Referenced by bmp280_event().
This internal API is used to parse the calibration data, compensates it and store it in device structure (float version)
Definition at line 258 of file bmp280.c.
References BMP280_CONCAT_BYTES, and foo.
Referenced by bmp280_event().
local function to extract raw data from i2c buffer and compute compensation with selected precision
Definition at line 231 of file bmp280.c.
References foo.
Referenced by bmp280_event().