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
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 {
50 
61 typedef struct {
64  time_t timestamp;
68 
69 typedef struct {
71  char uuid[13];
73 
74 
82 extern bool mtostk_populate_cal_from_buffer(Calibration_params *cp, uint8_t *eeprom_buffer);
83 
93 extern float mtostk_get_calibrated_value(Calibration_params *cp, Mtostk_sensors type, float uncal, float temp);
94 
95 #endif
96 
unsigned short uint16_t
Definition: types.h:16
#define MTOSTK_MAX_POLY_ARRAY_SIZE
Mtostk_sensors
#define MTOSTK_MAX_TEMP_ARRAY_SIZE
Calibration_params structure initialized with calibvration data read from meteostick eeprom...
unsigned char uint8_t
Definition: types.h:14
bool mtostk_populate_cal_from_buffer(Calibration_params *cp, uint8_t *eeprom_buffer)
Initializes a Calibration_params structure from memory buffer.
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