Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
baro_bmp.c File Reference

Bosch BMP085 I2C sensor interface. More...

#include "baro_bmp.h"
#include "mcu_periph/sys_time.h"
#include "mcu_periph/i2c.h"
#include "led.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "subsystems/datalink/downlink.h"
#include "estimator.h"
#include "subsystems/nav.h"
+ Include dependency graph for baro_bmp.c:

Go to the source code of this file.

Macros

#define DOWNLINK_DEVICE   DOWNLINK_AP_DEVICE
 
#define BMP_I2C_DEV   i2c0
 
#define BMP085_SLAVE_ADDR   0xEE
 
#define BARO_BMP_OFFSET_MAX   30000
 
#define BARO_BMP_OFFSET_MIN   10
 
#define BARO_BMP_OFFSET_NBSAMPLES_INIT   2
 
#define BARO_BMP_OFFSET_NBSAMPLES_AVRG   4
 
#define BARO_BMP_R   0.5
 
#define BARO_BMP_SIGMA2   0.1
 

Functions

void baro_bmp_init (void)
 
void baro_bmp_periodic (void)
 
void baro_bmp_event (void)
 

Variables

struct i2c_transaction bmp_trans
 
bool_t baro_bmp_enabled
 
float baro_bmp_r
 
float baro_bmp_sigma2
 
uint8_t baro_bmp_status
 
uint32_t baro_bmp_pressure
 
uint16_t baro_bmp_temperature
 
int32_t baro_bmp_altitude
 
int32_t baro_bmp
 
int32_t baro_bmp_temp
 
int32_t baro_bmp_offset
 
double tmp_float
 
int16_t bmp_ac1
 
int16_t bmp_ac2
 
int16_t bmp_ac3
 
uint16_t bmp_ac4
 
uint16_t bmp_ac5
 
uint16_t bmp_ac6
 
int16_t bmp_b1
 
int16_t bmp_b2
 
int16_t bmp_mb
 
int16_t bmp_mc
 
int16_t bmp_md
 
int32_t bmp_up
 
int32_t bmp_ut
 
bool_t baro_bmp_offset_init
 
int32_t baro_bmp_offset_tmp
 
uint16_t baro_bmp_cnt
 

Detailed Description

Bosch BMP085 I2C sensor interface.

This reads the values for pressure and temperature from the Bosch BMP085 sensor through I2C.

Definition in file baro_bmp.c.

Macro Definition Documentation

#define BARO_BMP_OFFSET_MAX   30000

Definition at line 61 of file baro_bmp.c.

Referenced by baro_bmp_event().

#define BARO_BMP_OFFSET_MIN   10

Definition at line 62 of file baro_bmp.c.

Referenced by baro_bmp_event().

#define BARO_BMP_OFFSET_NBSAMPLES_AVRG   4

Definition at line 64 of file baro_bmp.c.

Referenced by baro_bmp_event(), and baro_bmp_init().

#define BARO_BMP_OFFSET_NBSAMPLES_INIT   2

Definition at line 63 of file baro_bmp.c.

Referenced by baro_bmp_init().

#define BARO_BMP_R   0.5

Definition at line 65 of file baro_bmp.c.

Referenced by baro_bmp_init().

#define BARO_BMP_SIGMA2   0.1

Definition at line 66 of file baro_bmp.c.

Referenced by baro_bmp_init().

#define BMP085_SLAVE_ADDR   0xEE

Definition at line 59 of file baro_bmp.c.

Referenced by baro_bmp_event(), baro_bmp_init(), and baro_bmp_periodic().

#define BMP_I2C_DEV   i2c0

Definition at line 56 of file baro_bmp.c.

Referenced by baro_bmp_event(), baro_bmp_init(), and baro_bmp_periodic().

#define DOWNLINK_DEVICE   DOWNLINK_AP_DEVICE

Definition at line 48 of file baro_bmp.c.

Function Documentation

Variable Documentation

int32_t baro_bmp

Definition at line 78 of file baro_bmp.c.

Referenced by baro_bmp_event().

int32_t baro_bmp_altitude

Definition at line 78 of file baro_bmp.c.

Referenced by baro_bmp_event(), and baro_bmp_periodic().

uint16_t baro_bmp_cnt

Definition at line 90 of file baro_bmp.c.

Referenced by baro_bmp_event(), and baro_bmp_init().

bool_t baro_bmp_enabled

Definition at line 70 of file baro_bmp.c.

Referenced by baro_bmp_init().

int32_t baro_bmp_offset

Definition at line 78 of file baro_bmp.c.

Referenced by baro_bmp_event().

bool_t baro_bmp_offset_init

Definition at line 88 of file baro_bmp.c.

Referenced by baro_bmp_event(), and baro_bmp_init().

int32_t baro_bmp_offset_tmp

Definition at line 89 of file baro_bmp.c.

Referenced by baro_bmp_event().

uint32_t baro_bmp_pressure

Definition at line 76 of file baro_bmp.c.

Referenced by baro_bmp_event().

float baro_bmp_r

Definition at line 71 of file baro_bmp.c.

Referenced by baro_bmp_init().

float baro_bmp_sigma2

Definition at line 72 of file baro_bmp.c.

Referenced by baro_bmp_init().

uint8_t baro_bmp_status

Definition at line 75 of file baro_bmp.c.

Referenced by baro_bmp_event(), baro_bmp_init(), and baro_bmp_periodic().

int32_t baro_bmp_temp

Definition at line 78 of file baro_bmp.c.

Referenced by baro_bmp_event().

uint16_t baro_bmp_temperature

Definition at line 77 of file baro_bmp.c.

Referenced by baro_bmp_event().

int16_t bmp_ac1

Definition at line 81 of file baro_bmp.c.

Referenced by baro_bmp_event().

int16_t bmp_ac2

Definition at line 81 of file baro_bmp.c.

Referenced by baro_bmp_event().

int16_t bmp_ac3

Definition at line 81 of file baro_bmp.c.

Referenced by baro_bmp_event().

uint16_t bmp_ac4

Definition at line 82 of file baro_bmp.c.

Referenced by baro_bmp_event().

uint16_t bmp_ac5

Definition at line 82 of file baro_bmp.c.

Referenced by baro_bmp_event().

uint16_t bmp_ac6

Definition at line 82 of file baro_bmp.c.

Referenced by baro_bmp_event().

int16_t bmp_b1

Definition at line 83 of file baro_bmp.c.

Referenced by baro_bmp_event().

int16_t bmp_b2

Definition at line 83 of file baro_bmp.c.

Referenced by baro_bmp_event().

int16_t bmp_mb

Definition at line 84 of file baro_bmp.c.

Referenced by baro_bmp_event().

int16_t bmp_mc

Definition at line 84 of file baro_bmp.c.

Referenced by baro_bmp_event().

int16_t bmp_md

Definition at line 84 of file baro_bmp.c.

Referenced by baro_bmp_event().

struct i2c_transaction bmp_trans

Definition at line 68 of file baro_bmp.c.

Referenced by baro_bmp_event(), baro_bmp_init(), and baro_bmp_periodic().

int32_t bmp_up

Definition at line 85 of file baro_bmp.c.

Referenced by baro_bmp_event().

int32_t bmp_ut

Definition at line 85 of file baro_bmp.c.

Referenced by baro_bmp_event().

double tmp_float

Definition at line 79 of file baro_bmp.c.

Referenced by baro_bmp_event().