Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Sensor driver for BMP280 sensor. More...
Go to the source code of this file.
Data Structures | |
struct | bmp280_i2c_t |
struct | bmp280_spi_t |
struct | bmp280_reg_calib_data_t |
struct | bmp280_t |
union | bmp280_t.__unnamed315__ |
Enumerations | |
enum | bmp280_bus_t { BMP280_SPI , BMP280_I2C } |
enum | bmp_device_t { BMP_UNKOWN , BMP_280 } |
enum | bmp280_status_t { BMP280_STATUS_UNINIT , BMP280_STATUS_IDLE , BMP280_STATUS_GET_CALIB , BMP280_STATUS_CONFIGURE , BMP280_STATUS_READ_STATUS_REG , BMP280_STATUS_READ_DATA_REGS } |
Functions | |
void | bmp280_read_eeprom_calib (struct bmp280_t *bmp) |
void | bmp280_init (struct bmp280_t *bmp) |
Initialize the bmp280 sensor instance. More... | |
void | bmp280_periodic (struct bmp280_t *bmp) |
Should be called periodically to request sensor readings. More... | |
void | bmp280_event (struct bmp280_t *bmp) |
Should be called in the event thread. More... | |
Sensor driver for BMP280 sensor.
Definition in file bmp280.h.
struct bmp280_i2c_t |
Data Fields | ||
---|---|---|
struct i2c_periph * | p | Peripheral device for communication. |
uint8_t | slave_addr | The I2C slave address on the bus. |
struct i2c_transaction | trans | Transaction used during configuration and measurements. |
struct bmp280_spi_t |
Data Fields | ||
---|---|---|
struct spi_periph * | p | Peripheral device for communication. |
uint8_t | rx_buf[50] | |
uint8_t | slave_idx | Slave index used for Slave Select. |
struct spi_transaction | trans | Transaction used during configuration and measurements. |
uint8_t | tx_buf[50] | Transmit buffer. |
struct bmp280_reg_calib_data_t |
struct bmp280_t |
Data Fields | ||
---|---|---|
union bmp280_t | __unnamed__ | |
enum bmp280_bus_t | bus | The communication bus used to connect the device SPI/I2C. |
struct bmp280_reg_calib_data_t | calib | calibration data |
uint8_t | config_idx | The current configuration index. |
volatile bool | data_available | data ready flag |
enum bmp_device_t | device | The device type detected. |
bool | initialized | config done flag |
float | pressure | pressure in Pascal |
uint32_t | raw_pressure | uncompensated pressure |
uint32_t | raw_temperature | uncompensated temperature |
uint8_t * | rx_buffer | |
uint16_t * | rx_length | |
enum bmp280_status_t | status | state machine status |
float | temperature | temperature in deg Celcius |
uint8_t * | tx_buffer |
union bmp280_t.__unnamed315__ |
Data Fields | ||
---|---|---|
struct bmp280_i2c_t | i2c | I2C specific configuration. |
struct bmp280_spi_t | spi | SPI specific configuration. |
enum bmp280_bus_t |
enum bmp280_status_t |
enum bmp_device_t |
void bmp280_event | ( | struct bmp280_t * | bmp | ) |
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, bmp280_t::bus, compensate_pressure(), compensate_temperature(), bmp280_t::data_available, bmp280_t::device, I2CTransDone, I2CTransFailed, I2CTransSuccess, bmp280_t::initialized, parse_calib_data(), parse_sensor_data(), bmp280_t::rx_buffer, SPITransDone, SPITransFailed, SPITransSuccess, and bmp280_t::status.
Referenced by baro_bmp280_event().
void bmp280_init | ( | struct bmp280_t * | bmp | ) |
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, I2CTransDone, SPICphaEdge2, SPICpolIdleHigh, SPIDiv16, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, and SPITransDone.
Referenced by baro_bmp280_init().
void bmp280_periodic | ( | struct bmp280_t * | bmp | ) |
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, bmp280_t::bus, bmp280_t::data_available, I2CTransDone, bmp280_t::initialized, SPITransDone, and bmp280_t::status.
Referenced by baro_bmp280_periodic().
void bmp280_read_eeprom_calib | ( | struct bmp280_t * | bmp | ) |