Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
airspeed_amsys.c File Reference
#include "sensors/airspeed_amsys.h"
#include "state.h"
#include "mcu_periph/i2c.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "subsystems/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_t 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_t airspeed_amsys_i2c_done
 
float airspeed_temperature = 0.0
 
float airspeed_old = 0.0
 
bool_t airspeed_amsys_offset_init
 
double airspeed_amsys_offset_tmp
 
uint16_t airspeed_amsys_cnt
 

Macro Definition Documentation

#define AIRSPEED_AMSYS_ADDR   0xE8

Definition at line 35 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_periodic().

#define AIRSPEED_AMSYS_FILTER   0

Definition at line 48 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init().

#define AIRSPEED_AMSYS_I2C_DEV   i2c0

Definition at line 51 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_periodic().

#define AIRSPEED_AMSYS_MAXPRESURE   2068

Definition at line 45 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().

#define AIRSPEED_AMSYS_NBSAMPLES_AVRG   10

Definition at line 43 of file airspeed_amsys.c.

#define AIRSPEED_AMSYS_OFFSET_MAX   29491

Definition at line 39 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().

#define AIRSPEED_AMSYS_OFFSET_MIN   3277

Definition at line 40 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().

#define AIRSPEED_AMSYS_OFFSET_NBSAMPLES_AVRG   60

Definition at line 42 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init(), and airspeed_amsys_read_event().

#define AIRSPEED_AMSYS_OFFSET_NBSAMPLES_INIT   40

Definition at line 41 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init().

#define AIRSPEED_AMSYS_SCALE   1

Definition at line 37 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init().

Function Documentation

void airspeed_amsys_downlink ( void  )

Definition at line 124 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:

void airspeed_amsys_read_periodic ( void  )

Variable Documentation

uint16_t airspeed_amsys_cnt

Definition at line 79 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init(), and airspeed_amsys_read_event().

volatile bool_t airspeed_amsys_i2c_done

Definition at line 74 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init().

struct i2c_transaction airspeed_amsys_i2c_trans
float airspeed_amsys_offset

Definition at line 65 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init(), and airspeed_amsys_read_event().

bool_t airspeed_amsys_offset_init

Definition at line 77 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init(), and airspeed_amsys_read_event().

double airspeed_amsys_offset_tmp

Definition at line 78 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init(), and airspeed_amsys_read_event().

float airspeed_amsys_p
uint16_t airspeed_amsys_raw
float airspeed_amsys_tmp

Definition at line 66 of file airspeed_amsys.c.

Referenced by airspeed_amsys_downlink(), and airspeed_amsys_read_event().

bool_t airspeed_amsys_valid

Definition at line 64 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init(), and airspeed_amsys_read_event().

float airspeed_filter

Definition at line 70 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init(), and airspeed_amsys_read_event().

float airspeed_old = 0.0

Definition at line 76 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().

float airspeed_scale

Definition at line 69 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init(), and airspeed_amsys_read_event().

float airspeed_temperature = 0.0

Definition at line 75 of file airspeed_amsys.c.

Referenced by airspeed_amsys_downlink(), and airspeed_amsys_read_event().

uint16_t tempAS_amsys_raw

Definition at line 63 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().