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

Go to the source code of this file.

Macros

#define AIRSPEED_AMSYS_ADDR   0xE8
 
#define AIRSPEED_AMSYS_SCALE   1
 
#define AIRSPEED_AMSYS_OFFSET_MAX   29491
 
#define AIRSPEED_AMSYS_OFFSET_MIN   3277
 
#define AIRSPEED_AMSYS_OFFSET_NBSAMPLES_INIT   40
 
#define AIRSPEED_AMSYS_OFFSET_NBSAMPLES_AVRG   60
 
#define AIRSPEED_AMSYS_NBSAMPLES_AVRG   10
 
#define AIRSPEED_AMSYS_MAXPRESURE   2068
 
#define AIRSPEED_AMSYS_FILTER   0
 
#define AIRSPEED_AMSYS_I2C_DEV   i2c0
 

Functions

void airspeed_amsys_downlink (void)
 
void airspeed_amsys_init (void)
 
void airspeed_amsys_read_periodic (void)
 
void airspeed_amsys_read_event (void)
 

Variables

uint16_t airspeed_amsys_raw
 
uint16_t tempAS_amsys_raw
 
bool airspeed_amsys_valid
 
float airspeed_amsys_offset
 
float airspeed_amsys_tmp
 
float airspeed_amsys_p
 
float airspeed_amsys
 
float airspeed_scale
 
float airspeed_filter
 
struct i2c_transaction airspeed_amsys_i2c_trans
 
volatile bool airspeed_amsys_i2c_done
 
float airspeed_temperature = 0.0
 
float airspeed_old = 0.0
 
bool airspeed_amsys_offset_init
 
double airspeed_amsys_offset_tmp
 
uint16_t airspeed_amsys_cnt
 

Macro Definition Documentation

◆ AIRSPEED_AMSYS_ADDR

#define AIRSPEED_AMSYS_ADDR   0xE8

Definition at line 36 of file airspeed_amsys.c.

◆ AIRSPEED_AMSYS_FILTER

#define AIRSPEED_AMSYS_FILTER   0

Definition at line 49 of file airspeed_amsys.c.

◆ AIRSPEED_AMSYS_I2C_DEV

#define AIRSPEED_AMSYS_I2C_DEV   i2c0

Definition at line 52 of file airspeed_amsys.c.

◆ AIRSPEED_AMSYS_MAXPRESURE

#define AIRSPEED_AMSYS_MAXPRESURE   2068

Definition at line 46 of file airspeed_amsys.c.

◆ AIRSPEED_AMSYS_NBSAMPLES_AVRG

#define AIRSPEED_AMSYS_NBSAMPLES_AVRG   10

Definition at line 44 of file airspeed_amsys.c.

◆ AIRSPEED_AMSYS_OFFSET_MAX

#define AIRSPEED_AMSYS_OFFSET_MAX   29491

Definition at line 40 of file airspeed_amsys.c.

◆ AIRSPEED_AMSYS_OFFSET_MIN

#define AIRSPEED_AMSYS_OFFSET_MIN   3277

Definition at line 41 of file airspeed_amsys.c.

◆ AIRSPEED_AMSYS_OFFSET_NBSAMPLES_AVRG

#define AIRSPEED_AMSYS_OFFSET_NBSAMPLES_AVRG   60

Definition at line 43 of file airspeed_amsys.c.

◆ AIRSPEED_AMSYS_OFFSET_NBSAMPLES_INIT

#define AIRSPEED_AMSYS_OFFSET_NBSAMPLES_INIT   40

Definition at line 42 of file airspeed_amsys.c.

◆ AIRSPEED_AMSYS_SCALE

#define AIRSPEED_AMSYS_SCALE   1

Definition at line 38 of file airspeed_amsys.c.

Function Documentation

◆ airspeed_amsys_downlink()

void airspeed_amsys_downlink ( void  )

Definition at line 135 of file airspeed_amsys.c.

References airspeed_amsys, airspeed_amsys_p, airspeed_amsys_raw, airspeed_amsys_tmp, airspeed_temperature, DefaultChannel, and DefaultDevice.

Referenced by airspeed_amsys_read_event(), and airspeed_amsys_read_periodic().

+ Here is the caller graph for this function:

◆ airspeed_amsys_init()

◆ airspeed_amsys_read_event()

◆ airspeed_amsys_read_periodic()

void airspeed_amsys_read_periodic ( void  )

Variable Documentation

◆ airspeed_amsys

◆ airspeed_amsys_cnt

uint16_t airspeed_amsys_cnt

Definition at line 88 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init(), and airspeed_amsys_read_event().

◆ airspeed_amsys_i2c_done

volatile bool airspeed_amsys_i2c_done

Definition at line 83 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init().

◆ airspeed_amsys_i2c_trans

struct i2c_transaction airspeed_amsys_i2c_trans

◆ airspeed_amsys_offset

float airspeed_amsys_offset

Definition at line 74 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init(), and airspeed_amsys_read_event().

◆ airspeed_amsys_offset_init

bool airspeed_amsys_offset_init

Definition at line 86 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init(), and airspeed_amsys_read_event().

◆ airspeed_amsys_offset_tmp

double airspeed_amsys_offset_tmp

Definition at line 87 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init(), and airspeed_amsys_read_event().

◆ airspeed_amsys_p

float airspeed_amsys_p

◆ airspeed_amsys_raw

uint16_t airspeed_amsys_raw

◆ airspeed_amsys_tmp

float airspeed_amsys_tmp

Definition at line 75 of file airspeed_amsys.c.

Referenced by airspeed_amsys_downlink(), and airspeed_amsys_read_event().

◆ airspeed_amsys_valid

bool airspeed_amsys_valid

Definition at line 73 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init(), and airspeed_amsys_read_event().

◆ airspeed_filter

float airspeed_filter

◆ airspeed_old

float airspeed_old = 0.0

Definition at line 85 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().

◆ airspeed_scale

float airspeed_scale

Definition at line 78 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init(), and airspeed_amsys_read_event().

◆ airspeed_temperature

float airspeed_temperature = 0.0

Definition at line 84 of file airspeed_amsys.c.

Referenced by airspeed_amsys_downlink(), and airspeed_amsys_read_event().

◆ tempAS_amsys_raw

uint16_t tempAS_amsys_raw

Definition at line 72 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().