Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
meteo_stick.c File Reference
#include "modules/meteo/meteo_stick.h"
#include "subsystems/abi.h"
#include "peripherals/ads1220.h"
#include "mcu_periph/pwm_input.h"
#include "generated/airframe.h"
+ Include dependency graph for meteo_stick.c:

Go to the source code of this file.

Macros

#define MS_PRESSURE_OFFSET   0.0f
 Default scale and offset Only used if calibration from EEPROM is not used/available. More...
 
#define MS_PRESSURE_SCALE   1.0f
 
#define MS_TEMPERATURE_OFFSET   0.0f
 
#define MS_TEMPERATURE_SCALE   1.0f
 
#define MS_HUMIDTY_OFFSET   0.0f
 
#define MS_HUMIDTY_SCALE   1.0f
 
#define MS_DIFF_PRESSURE_OFFSET   0.0f
 
#define MS_DIFF_PRESSURE_SCALE   1.0f
 
#define MS_PITOT_COUNTER   20
 
#define MS_PITOT_FILTER   0.6
 
#define LOG_MS   TRUE
 Includes to log on SD card. More...
 
#define SEND_MS   TRUE
 

Functions

static float get_pressure (uint32_t raw)
 
static float get_temp (uint32_t raw)
 
static float get_diff (uint32_t raw)
 
static float get_pitot (uint32_t raw)
 
static float get_humidity (uint32_t raw)
 
void meteo_stick_init (void)
 Init function. More...
 
void meteo_stick_periodic (void)
 Periodic function. More...
 
void meteo_stick_event (void)
 Event function. More...
 

Variables

struct MeteoStick meteo_stick
 General structure. More...
 
static const float maxAdc = 8388608.0f
 Prescaling of data according to datasheets. More...
 
static float pitot_offset
 
static int pitot_counter
 

Macro Definition Documentation

#define LOG_MS   TRUE

Includes to log on SD card.

TRUE by default

Definition at line 172 of file meteo_stick.c.

#define MS_DIFF_PRESSURE_OFFSET   0.0f

Definition at line 51 of file meteo_stick.c.

Referenced by get_diff().

#define MS_DIFF_PRESSURE_SCALE   1.0f

Definition at line 54 of file meteo_stick.c.

Referenced by get_diff().

#define MS_HUMIDTY_OFFSET   0.0f

Definition at line 45 of file meteo_stick.c.

Referenced by get_humidity().

#define MS_HUMIDTY_SCALE   1.0f

Definition at line 48 of file meteo_stick.c.

Referenced by get_humidity().

#define MS_PITOT_COUNTER   20

Definition at line 126 of file meteo_stick.c.

Referenced by meteo_stick_event(), meteo_stick_init(), and meteo_stick_periodic().

#define MS_PITOT_FILTER   0.6

Definition at line 128 of file meteo_stick.c.

Referenced by meteo_stick_event().

#define MS_PRESSURE_OFFSET   0.0f

Default scale and offset Only used if calibration from EEPROM is not used/available.

Definition at line 33 of file meteo_stick.c.

Referenced by get_pressure().

#define MS_PRESSURE_SCALE   1.0f

Definition at line 36 of file meteo_stick.c.

Referenced by get_pressure().

#define MS_TEMPERATURE_OFFSET   0.0f

Definition at line 39 of file meteo_stick.c.

Referenced by get_temp().

#define MS_TEMPERATURE_SCALE   1.0f

Definition at line 42 of file meteo_stick.c.

Referenced by get_temp().

#define SEND_MS   TRUE

Definition at line 185 of file meteo_stick.c.

Function Documentation

static float get_diff ( uint32_t  raw)
inlinestatic

Definition at line 130 of file meteo_stick.c.

References ADS1220_GAIN_2, Ads1220GainTable, MeteoStick::current_temperature, maxAdc, meteo_stick, MS_DIFF_PRESSURE_OFFSET, MS_DIFF_PRESSURE_SCALE, MTOSTK_DIF_PRESS, mtostk_get_calibrated_value(), and pitot_offset.

Referenced by get_pitot(), and meteo_stick_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static float get_humidity ( uint32_t  raw)
inlinestatic

Definition at line 148 of file meteo_stick.c.

References MeteoStick::current_temperature, meteo_stick, MS_HUMIDTY_OFFSET, MS_HUMIDTY_SCALE, mtostk_get_calibrated_value(), and MTOSTK_HUMIDITY.

Referenced by meteo_stick_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static float get_pitot ( uint32_t  raw)
inlinestatic

Definition at line 143 of file meteo_stick.c.

References get_diff().

Referenced by meteo_stick_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static float get_pressure ( uint32_t  raw)
inlinestatic

Definition at line 93 of file meteo_stick.c.

References MeteoStick::current_temperature, maxAdc, meteo_stick, MS_PRESSURE_OFFSET, MS_PRESSURE_SCALE, MTOSTK_ABS_PRESS, and mtostk_get_calibrated_value().

Referenced by meteo_stick_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static float get_temp ( uint32_t  raw)
inlinestatic

Definition at line 104 of file meteo_stick.c.

References ADS1220_GAIN_4, Ads1220GainTable, maxAdc, meteo_stick, MS_TEMPERATURE_OFFSET, MS_TEMPERATURE_SCALE, mtostk_get_calibrated_value(), and MTOSTK_TEMP.

Referenced by meteo_stick_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const float maxAdc = 8388608.0f
static

Prescaling of data according to datasheets.

Definition at line 91 of file meteo_stick.c.

Referenced by get_diff(), get_pressure(), and get_temp().

struct MeteoStick meteo_stick

General structure.

Definition at line 85 of file meteo_stick.c.

Referenced by get_diff(), get_humidity(), get_pressure(), get_temp(), meteo_stick_event(), meteo_stick_init(), and meteo_stick_periodic().

int pitot_counter
static

Definition at line 124 of file meteo_stick.c.

Referenced by meteo_stick_event(), meteo_stick_init(), and meteo_stick_periodic().

float pitot_offset
static

Definition at line 123 of file meteo_stick.c.

Referenced by get_diff(), and meteo_stick_event().