Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
meteo_stick.c File Reference
#include "modules/meteo/meteo_stick.h"
#include "modules/core/abi.h"
#include "mcu_periph/sys_time.h"
#include "peripherals/ads1220.h"
#include "mcu_periph/pwm_input.h"
#include "generated/airframe.h"
#include "pprzlink/messages.h"
#include "modules/datalink/downlink.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.
#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 SEND_MS_SYNC   FALSE
 Send over telemetry synchrone to reading.
#define LOG_MS   TRUE
 Includes to log on SD card as ASCII csv.
#define LOG_MS_FLIGHTRECORDER   FALSE
 Includes and function to log to flight recorder.
#define MS_LOG_FILE   flightrecorder_sdlog

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)
static void meteo_stick_send_data (struct transport_tx *trans, struct link_device *device)
 Funnction to send over different transport and device.
void meteo_stick_init (void)
 Init function.
void meteo_stick_periodic (void)
 Periodic function.
void meteo_stick_event (void)
 Event function.
void meteo_stick_report (void)

Variables

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

Macro Definition Documentation

◆ LOG_MS

#define LOG_MS   TRUE

Includes to log on SD card as ASCII csv.

TRUE by default

Definition at line 198 of file meteo_stick.c.

◆ LOG_MS_FLIGHTRECORDER

#define LOG_MS_FLIGHTRECORDER   FALSE

Includes and function to log to flight recorder.

FALSE by default

Definition at line 262 of file meteo_stick.c.

◆ MS_DIFF_PRESSURE_OFFSET

#define MS_DIFF_PRESSURE_OFFSET   0.0f

Definition at line 54 of file meteo_stick.c.

Referenced by get_diff().

◆ MS_DIFF_PRESSURE_SCALE

#define MS_DIFF_PRESSURE_SCALE   1.0f

Definition at line 57 of file meteo_stick.c.

Referenced by get_diff().

◆ MS_HUMIDTY_OFFSET

#define MS_HUMIDTY_OFFSET   0.0f

Definition at line 48 of file meteo_stick.c.

Referenced by get_humidity().

◆ MS_HUMIDTY_SCALE

#define MS_HUMIDTY_SCALE   1.0f

Definition at line 51 of file meteo_stick.c.

Referenced by get_humidity().

◆ MS_LOG_FILE

#define MS_LOG_FILE   flightrecorder_sdlog

Definition at line 267 of file meteo_stick.c.

◆ MS_PITOT_COUNTER

#define MS_PITOT_COUNTER   20

Definition at line 129 of file meteo_stick.c.

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

◆ MS_PITOT_FILTER

#define MS_PITOT_FILTER   0.6

Definition at line 131 of file meteo_stick.c.

Referenced by meteo_stick_event().

◆ MS_PRESSURE_OFFSET

#define MS_PRESSURE_OFFSET   0.0f

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

Definition at line 36 of file meteo_stick.c.

Referenced by get_pressure().

◆ MS_PRESSURE_SCALE

#define MS_PRESSURE_SCALE   1.0f

Definition at line 39 of file meteo_stick.c.

Referenced by get_pressure().

◆ MS_TEMPERATURE_OFFSET

#define MS_TEMPERATURE_OFFSET   0.0f

Definition at line 42 of file meteo_stick.c.

Referenced by get_temp().

◆ MS_TEMPERATURE_SCALE

#define MS_TEMPERATURE_SCALE   1.0f

Definition at line 45 of file meteo_stick.c.

Referenced by get_temp().

◆ SEND_MS_SYNC

#define SEND_MS_SYNC   FALSE

Send over telemetry synchrone to reading.

FALSE by default (the asynchronous report function is used by default)

Definition at line 189 of file meteo_stick.c.

Function Documentation

◆ get_diff()

float get_diff ( uint32_t raw)
inlinestatic

Definition at line 133 of file meteo_stick.c.

References ADS1220_GAIN_2, Ads1220GainTable, 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:

◆ get_humidity()

float get_humidity ( uint32_t raw)
inlinestatic

Definition at line 151 of file meteo_stick.c.

References meteo_stick, MS_HUMIDTY_OFFSET, MS_HUMIDTY_SCALE, mtostk_get_calibrated_value(), MTOSTK_HUMIDITY, and S1.

Referenced by meteo_stick_periodic().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_pitot()

float get_pitot ( uint32_t raw)
inlinestatic

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

◆ get_pressure()

float get_pressure ( uint32_t raw)
inlinestatic

Definition at line 96 of file meteo_stick.c.

References 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:

◆ get_temp()

float get_temp ( uint32_t raw)
inlinestatic

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

◆ meteo_stick_event()

void meteo_stick_event ( void )

◆ meteo_stick_init()

◆ meteo_stick_periodic()

void meteo_stick_periodic ( void )

◆ meteo_stick_report()

void meteo_stick_report ( void )

Definition at line 498 of file meteo_stick.c.

References DefaultChannel, DefaultDevice, and meteo_stick_send_data().

Here is the call graph for this function:

◆ meteo_stick_send_data()

void meteo_stick_send_data ( struct transport_tx * trans,
struct link_device * device )
static

Funnction to send over different transport and device.

Definition at line 171 of file meteo_stick.c.

References gps, meteo_stick, and stateGetPositionLla_i().

Referenced by meteo_stick_periodic(), and meteo_stick_report().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ maxAdc

const float maxAdc = 8388608.0f
static

Prescaling of data according to datasheets.

Definition at line 94 of file meteo_stick.c.

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

◆ meteo_stick

struct MeteoStick meteo_stick

◆ pitot_counter

int pitot_counter
static

Definition at line 127 of file meteo_stick.c.

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

◆ pitot_offset

float pitot_offset
static

Definition at line 126 of file meteo_stick.c.

Referenced by get_diff(), and meteo_stick_event().