Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
meteo_stick_calib.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2015 Gautier Hattenberger, Alexandre Bustico
3
*
4
* This file is part of paparazzi
5
6
* paparazzi is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2, or (at your option)
9
* any later version.
10
*
11
* paparazzi is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with paparazzi; see the file COPYING. If not, see
18
* <http://www.gnu.org/licenses/>.
19
*
20
*/
21
30
#ifndef METEO_STICK_CALIB_H
31
#define METEO_STICK_CALIB_H
32
33
#include <stdint.h>
34
#include <stdbool.h>
35
#include <stddef.h>
36
#include <time.h>
37
38
#define MTOSTK_MAX_SEEK_ARRAY_SIZE 20 // max polynom order is 4
39
#define MTOSTK_MAX_POLY_ARRAY_SIZE 6 // max polynom order is 4
40
#define MTOSTK_MAX_TEMP_ARRAY_SIZE 6 //
41
#define UUID_LEN 13 // including trailing 0
42
43
typedef
enum
{
44
MTOSTK_TEMP
= 0,
45
MTOSTK_ABS_PRESS
,
46
MTOSTK_DIF_PRESS
,
47
MTOSTK_HUMIDITY
,
48
MTOSTK_NUM_SENSORS
49
}
Mtostk_sensors
;
50
51
52
61
typedef
uint32_t
mtostk_time_t
;
62
73
typedef
struct
{
74
float
coeffs[
MTOSTK_MAX_TEMP_ARRAY_SIZE
][
MTOSTK_MAX_POLY_ARRAY_SIZE
];
75
float
temps[
MTOSTK_MAX_TEMP_ARRAY_SIZE
];
76
mtostk_time_t
timestamp
;
77
uint16_t
num_temp
;
78
uint16_t
num_coeff
;
79
}
Sensors_params
;
80
81
typedef
struct
{
82
Sensors_params
params[
MTOSTK_NUM_SENSORS
];
83
char
uuid[13];
84
}
Calibration_params
;
85
86
94
extern
bool
mtostk_populate_cal_from_buffer
(
Calibration_params
*cp,
uint8_t
*eeprom_buffer);
95
105
extern
float
mtostk_get_calibrated_value
(
Calibration_params
*cp,
Mtostk_sensors
type
,
float
uncal,
float
temp);
106
107
#endif
108
MTOSTK_MAX_POLY_ARRAY_SIZE
#define MTOSTK_MAX_POLY_ARRAY_SIZE
Definition:
meteo_stick_calib.h:39
uint16_t
unsigned short uint16_t
Definition:
types.h:16
mtostk_get_calibrated_value
float mtostk_get_calibrated_value(Calibration_params *cp, Mtostk_sensors type, float uncal, float temp)
get calibrated value for a sensor according to current temperature
Definition:
meteo_stick_calib.c:71
uint32_t
unsigned long uint32_t
Definition:
types.h:18
Calibration_params
Definition:
meteo_stick_calib.h:81
Sensors_params::num_coeff
uint16_t num_coeff
Definition:
meteo_stick_calib.h:78
Mtostk_sensors
Mtostk_sensors
Definition:
meteo_stick_calib.h:43
MTOSTK_MAX_TEMP_ARRAY_SIZE
#define MTOSTK_MAX_TEMP_ARRAY_SIZE
Definition:
meteo_stick_calib.h:40
MTOSTK_DIF_PRESS
@ MTOSTK_DIF_PRESS
Definition:
meteo_stick_calib.h:46
uint8_t
unsigned char uint8_t
Definition:
types.h:14
Sensors_params::num_temp
uint16_t num_temp
Definition:
meteo_stick_calib.h:77
MTOSTK_TEMP
@ MTOSTK_TEMP
Definition:
meteo_stick_calib.h:44
MTOSTK_HUMIDITY
@ MTOSTK_HUMIDITY
Definition:
meteo_stick_calib.h:47
Sensors_params::timestamp
mtostk_time_t timestamp
Definition:
meteo_stick_calib.h:76
mtostk_time_t
uint32_t mtostk_time_t
time in seconds since 01/01/1970
Definition:
meteo_stick_calib.h:61
type
timer subsystem type(config options) --------------------------------------------(advanced timers using RCC_APB1) TIM1 adc(if USE_AD_TIM1) radio_control/ppm(if USE_PPM_TIM1
mtostk_populate_cal_from_buffer
bool mtostk_populate_cal_from_buffer(Calibration_params *cp, uint8_t *eeprom_buffer)
Initializes a Calibration_params structure from memory buffer.
Definition:
meteo_stick_calib.c:53
MTOSTK_ABS_PRESS
@ MTOSTK_ABS_PRESS
Definition:
meteo_stick_calib.h:45
Sensors_params
Calibration_params structure initialized with calibvration data read from meteostick eeprom.
Definition:
meteo_stick_calib.h:73
MTOSTK_NUM_SENSORS
@ MTOSTK_NUM_SENSORS
Definition:
meteo_stick_calib.h:48
sw
airborne
modules
meteo
meteo_stick_calib.h
Generated on Tue Feb 1 2022 13:51:16 for Paparazzi UAS by
1.8.17