Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
baro_board.c File Reference
#include "subsystems/sensors/baro.h"
#include <libopencm3/stm32/f1/gpio.h>
+ Include dependency graph for baro_board.c:

Go to the source code of this file.

Macros

#define BMP085_SAMPLE_PERIOD_MS   (3 + (2 << BMP085_OSS) * 3)
 
#define BMP085_SAMPLE_PERIOD   (BMP075_SAMPLE_PERIOD_MS >> 1)
 

Functions

static void bmp085_write_reg (uint8_t addr, uint8_t value)
 
static void bmp085_read_reg16 (uint8_t addr)
 
static int16_t bmp085_read_reg16_blocking (uint8_t addr, uint32_t timeout)
 
static void bmp085_read_reg24 (uint8_t addr)
 
static void bmp085_baro_read_calibration (void)
 
void baro_init (void)
 
static int baro_eoc (void)
 
static void bmp085_request_pressure (void)
 
static void bmp085_request_temp (void)
 
static void bmp085_read_pressure (void)
 
static void bmp085_read_temp (void)
 
void baro_periodic (void)
 
void baro_board_send_reset (void)
 
static int32_t baro_apply_calibration (int32_t raw)
 
void baro_event (void(*b_abs_handler)(void), void(*b_diff_handler)(void))
 

Variables

struct Baro baro
 
struct BaroBoard baro_board
 
struct i2c_transaction baro_trans
 
struct bmp085_baro_calibration calibration
 

Macro Definition Documentation

#define BMP085_SAMPLE_PERIOD   (BMP075_SAMPLE_PERIOD_MS >> 1)

Definition at line 11 of file baro_board.c.

#define BMP085_SAMPLE_PERIOD_MS   (3 + (2 << BMP085_OSS) * 3)

Definition at line 10 of file baro_board.c.

Function Documentation

static int32_t baro_apply_calibration ( int32_t  raw)
static
void baro_board_send_reset ( void  )

Definition at line 146 of file baro_board.c.

References baro_trans, i2c_transaction::buf, i2c_submit(), I2CTransTx, i2c_transaction::len_w, i2c_transaction::slave_addr, and i2c_transaction::type.

+ Here is the call graph for this function:

static int baro_eoc ( void  )
inlinestatic

Definition at line 83 of file baro_board.c.

Referenced by baro_periodic().

+ Here is the caller graph for this function:

void baro_event ( void(*)(void)  b_abs_handler,
void(*)(void)  b_diff_handler 
)

Definition at line 170 of file baro_board.c.

void baro_init ( void  )

Definition at line 70 of file baro_board.c.

References Baro::absolute, baro, baro_board, bmp085_baro_read_calibration(), BS_UNINITIALIZED, Baro::differential, LBS_UNINITIALIZED, BaroBoard::status, and Baro::status.

+ Here is the call graph for this function:

static void bmp085_read_pressure ( void  )
inlinestatic

Definition at line 98 of file baro_board.c.

References bmp085_read_reg24().

Referenced by baro_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bmp085_read_reg16 ( uint8_t  addr)
inlinestatic

Definition at line 26 of file baro_board.c.

References baro_trans, BMP085_ADDR, i2c_transaction::buf, and i2c_transceive().

Referenced by bmp085_read_reg16_blocking(), and bmp085_read_temp().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int16_t bmp085_read_reg16_blocking ( uint8_t  addr,
uint32_t  timeout 
)
inlinestatic

Definition at line 32 of file baro_board.c.

References baro_trans, bmp085_read_reg16(), i2c_transaction::buf, I2CTransPending, I2CTransRunning, and i2c_transaction::status.

Referenced by bmp085_baro_read_calibration().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bmp085_read_reg24 ( uint8_t  addr)
inlinestatic

Definition at line 49 of file baro_board.c.

References baro_trans, BMP085_ADDR, i2c_transaction::buf, and i2c_transceive().

Referenced by bmp085_read_pressure().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bmp085_read_temp ( void  )
inlinestatic

Definition at line 103 of file baro_board.c.

References bmp085_read_reg16().

Referenced by baro_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bmp085_request_pressure ( void  )
inlinestatic

Definition at line 88 of file baro_board.c.

References BMP085_OSS, and bmp085_write_reg().

Referenced by baro_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bmp085_request_temp ( void  )
inlinestatic

Definition at line 93 of file baro_board.c.

References bmp085_write_reg().

Referenced by baro_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bmp085_write_reg ( uint8_t  addr,
uint8_t  value 
)
inlinestatic

Definition at line 15 of file baro_board.c.

References baro_trans, BMP085_ADDR, i2c_transaction::buf, i2c_transmit(), I2CTransPending, I2CTransRunning, i2c_transaction::status, and value.

Referenced by bmp085_request_pressure(), and bmp085_request_temp().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

struct Baro baro

Definition at line 5 of file baro_board.c.

struct BaroBoard baro_board

Definition at line 6 of file baro_board.c.

Referenced by baro_board_SetOffset().

struct i2c_transaction baro_trans

Definition at line 7 of file baro_board.c.

static void calibration

Definition at line 8 of file baro_board.c.

Referenced by baro_apply_calibration(), baro_event(), and bmp085_baro_read_calibration().