Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
baro_amsys.c File Reference
#include "sensors/baro_amsys.h"
#include "mcu_periph/i2c.h"
#include "modules/core/abi.h"
#include "state.h"
#include <math.h>
#include "generated/flight_plan.h"
#include "mcu_periph/uart.h"
#include "pprzlink/messages.h"
#include "modules/datalink/downlink.h"
+ Include dependency graph for baro_amsys.c:

Go to the source code of this file.

Macros

#define BARO_AMSYS_ADDR   0xE4
 
#define BARO_AMSYS_REG   0x07
 
#define BARO_AMSYS_SCALE   1
 
#define BARO_AMSYS_MAX_PRESSURE   103400
 
#define BARO_AMSYS_OFFSET_MAX   29491
 
#define BARO_AMSYS_OFFSET_MIN   3277
 
#define BARO_AMSYS_OFFSET_NBSAMPLES_INIT   40
 
#define BARO_AMSYS_OFFSET_NBSAMPLES_AVRG   60
 
#define BARO_AMSYS_FILTER   0
 
#define BARO_AMSYS_R   0.5
 
#define BARO_AMSYS_SIGMA2   0.1
 
#define BARO_AMSYS_I2C_DEV   i2c0
 

Functions

void baro_amsys_init (void)
 
void baro_amsys_read_periodic (void)
 
void baro_amsys_read_event (void)
 

Variables

uint16_t pBaroRaw
 
uint16_t tBaroRaw
 
uint16_t baro_amsys_adc
 
float baro_amsys_offset
 
bool baro_amsys_valid
 
float baro_amsys_altitude
 
bool baro_amsys_enabled
 
float baro_amsys_r
 
float baro_amsys_sigma2
 
float baro_amsys_temp
 
float baro_amsys_p
 
float baro_amsys_offset_altitude
 
float baro_amsys_abs_altitude
 
float ref_alt_init
 
float baro_scale
 
float baro_filter
 
float baro_old
 
struct i2c_transaction baro_amsys_i2c_trans
 
bool baro_amsys_offset_init
 
double baro_amsys_offset_tmp
 
uint16_t baro_amsys_cnt
 

Macro Definition Documentation

◆ BARO_AMSYS_ADDR

#define BARO_AMSYS_ADDR   0xE4

Definition at line 39 of file baro_amsys.c.

◆ BARO_AMSYS_FILTER

#define BARO_AMSYS_FILTER   0

Definition at line 52 of file baro_amsys.c.

◆ BARO_AMSYS_I2C_DEV

#define BARO_AMSYS_I2C_DEV   i2c0

Definition at line 66 of file baro_amsys.c.

◆ BARO_AMSYS_MAX_PRESSURE

#define BARO_AMSYS_MAX_PRESSURE   103400

Definition at line 45 of file baro_amsys.c.

◆ BARO_AMSYS_OFFSET_MAX

#define BARO_AMSYS_OFFSET_MAX   29491

Definition at line 47 of file baro_amsys.c.

◆ BARO_AMSYS_OFFSET_MIN

#define BARO_AMSYS_OFFSET_MIN   3277

Definition at line 48 of file baro_amsys.c.

◆ BARO_AMSYS_OFFSET_NBSAMPLES_AVRG

#define BARO_AMSYS_OFFSET_NBSAMPLES_AVRG   60

Definition at line 50 of file baro_amsys.c.

◆ BARO_AMSYS_OFFSET_NBSAMPLES_INIT

#define BARO_AMSYS_OFFSET_NBSAMPLES_INIT   40

Definition at line 49 of file baro_amsys.c.

◆ BARO_AMSYS_R

#define BARO_AMSYS_R   0.5

Definition at line 54 of file baro_amsys.c.

◆ BARO_AMSYS_REG

#define BARO_AMSYS_REG   0x07

Definition at line 40 of file baro_amsys.c.

◆ BARO_AMSYS_SCALE

#define BARO_AMSYS_SCALE   1

Definition at line 42 of file baro_amsys.c.

◆ BARO_AMSYS_SIGMA2

#define BARO_AMSYS_SIGMA2   0.1

Definition at line 55 of file baro_amsys.c.

Function Documentation

◆ baro_amsys_init()

◆ baro_amsys_read_event()

◆ baro_amsys_read_periodic()

Variable Documentation

◆ baro_amsys_abs_altitude

float baro_amsys_abs_altitude

Definition at line 83 of file baro_amsys.c.

Referenced by baro_amsys_read_event(), and baro_amsys_read_periodic().

◆ baro_amsys_adc

uint16_t baro_amsys_adc

Definition at line 73 of file baro_amsys.c.

Referenced by baro_amsys_read_event().

◆ baro_amsys_altitude

float baro_amsys_altitude

Definition at line 76 of file baro_amsys.c.

Referenced by baro_amsys_init(), baro_amsys_read_event(), and baro_amsys_read_periodic().

◆ baro_amsys_cnt

uint16_t baro_amsys_cnt

Definition at line 95 of file baro_amsys.c.

Referenced by baro_amsys_init(), and baro_amsys_read_event().

◆ baro_amsys_enabled

bool baro_amsys_enabled

Definition at line 77 of file baro_amsys.c.

Referenced by alt_kalman(), and baro_amsys_init().

◆ baro_amsys_i2c_trans

struct i2c_transaction baro_amsys_i2c_trans

Definition at line 87 of file baro_amsys.c.

Referenced by baro_amsys_init(), baro_amsys_read_event(), and baro_amsys_read_periodic().

◆ baro_amsys_offset

float baro_amsys_offset

Definition at line 74 of file baro_amsys.c.

Referenced by baro_amsys_init(), baro_amsys_read_event(), and baro_amsys_read_periodic().

◆ baro_amsys_offset_altitude

float baro_amsys_offset_altitude

Definition at line 82 of file baro_amsys.c.

◆ baro_amsys_offset_init

bool baro_amsys_offset_init

Definition at line 93 of file baro_amsys.c.

Referenced by baro_amsys_init(), and baro_amsys_read_event().

◆ baro_amsys_offset_tmp

double baro_amsys_offset_tmp

Definition at line 94 of file baro_amsys.c.

Referenced by baro_amsys_init(), and baro_amsys_read_event().

◆ baro_amsys_p

float baro_amsys_p

Definition at line 81 of file baro_amsys.c.

Referenced by baro_amsys_init(), baro_amsys_read_event(), and baro_amsys_read_periodic().

◆ baro_amsys_r

float baro_amsys_r

Definition at line 78 of file baro_amsys.c.

Referenced by alt_kalman(), and baro_amsys_init().

◆ baro_amsys_sigma2

float baro_amsys_sigma2

Definition at line 79 of file baro_amsys.c.

Referenced by alt_kalman(), and baro_amsys_init().

◆ baro_amsys_temp

float baro_amsys_temp

Definition at line 80 of file baro_amsys.c.

Referenced by baro_amsys_read_event(), and baro_amsys_read_periodic().

◆ baro_amsys_valid

bool baro_amsys_valid

Definition at line 75 of file baro_amsys.c.

Referenced by baro_amsys_init(), and baro_amsys_read_event().

◆ baro_filter

float baro_filter

Definition at line 86 of file baro_amsys.c.

Referenced by baro_amsys_init(), and baro_amsys_read_event().

◆ baro_old

float baro_old

Definition at line 87 of file baro_amsys.c.

Referenced by baro_amsys_read_event().

◆ baro_scale

float baro_scale

Definition at line 85 of file baro_amsys.c.

Referenced by baro_amsys_init(), and baro_amsys_read_event().

◆ pBaroRaw

uint16_t pBaroRaw

Definition at line 71 of file baro_amsys.c.

Referenced by baro_amsys_init(), baro_amsys_read_event(), and baro_amsys_read_periodic().

◆ ref_alt_init

float ref_alt_init

Definition at line 84 of file baro_amsys.c.

Referenced by baro_amsys_init(), baro_amsys_read_event(), and baro_amsys_read_periodic().

◆ tBaroRaw

uint16_t tBaroRaw

Definition at line 72 of file baro_amsys.c.

Referenced by baro_amsys_init(), and baro_amsys_read_event().