Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces 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 "pprzlink/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 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

#define AIRSPEED_AMSYS_ADDR   0xE8

Definition at line 36 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_periodic().

#define AIRSPEED_AMSYS_FILTER   0

Definition at line 49 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init().

#define AIRSPEED_AMSYS_I2C_DEV   i2c0

Definition at line 52 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_periodic().

#define AIRSPEED_AMSYS_MAXPRESURE   2068

Definition at line 46 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().

#define AIRSPEED_AMSYS_NBSAMPLES_AVRG   10

Definition at line 44 of file airspeed_amsys.c.

#define AIRSPEED_AMSYS_OFFSET_MAX   29491

Definition at line 40 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().

#define AIRSPEED_AMSYS_OFFSET_MIN   3277

Definition at line 41 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().

#define AIRSPEED_AMSYS_OFFSET_NBSAMPLES_AVRG   60

Definition at line 43 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 42 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init().

#define AIRSPEED_AMSYS_SCALE   1

Definition at line 38 of file airspeed_amsys.c.

Referenced by airspeed_amsys_init().

Function Documentation

void airspeed_amsys_downlink ( void  )

Definition at line 135 of file airspeed_amsys.c.

References 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

float airspeed_amsys

Definition at line 77 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().

uint16_t airspeed_amsys_cnt

Definition at line 88 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().

volatile bool airspeed_amsys_i2c_done

Definition at line 83 of file airspeed_amsys.c.

struct i2c_transaction airspeed_amsys_i2c_trans
float airspeed_amsys_offset

Definition at line 74 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().

bool airspeed_amsys_offset_init

Definition at line 86 of file airspeed_amsys.c.

double airspeed_amsys_offset_tmp

Definition at line 87 of file airspeed_amsys.c.

float airspeed_amsys_p

Definition at line 76 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().

uint16_t airspeed_amsys_raw

Definition at line 71 of file airspeed_amsys.c.

float airspeed_amsys_tmp

Definition at line 75 of file airspeed_amsys.c.

bool airspeed_amsys_valid

Definition at line 73 of file airspeed_amsys.c.

float airspeed_filter

Definition at line 79 of file airspeed_amsys.c.

Referenced by airspeed_amsys_read_event().

float airspeed_old = 0.0

Definition at line 85 of file airspeed_amsys.c.

float airspeed_scale

Definition at line 78 of file airspeed_amsys.c.

float airspeed_temperature = 0.0

Definition at line 84 of file airspeed_amsys.c.

uint16_t tempAS_amsys_raw

Definition at line 72 of file airspeed_amsys.c.