Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
meteo_stick_calib.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <time.h>
+ Include dependency graph for meteo_stick_calib.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Sensors_params
 Calibration_params structure initialized with calibvration data read from meteostick eeprom. More...
 
struct  Calibration_params
 

Macros

#define MTOSTK_MAX_SEEK_ARRAY_SIZE   20
 
#define MTOSTK_MAX_POLY_ARRAY_SIZE   6
 
#define MTOSTK_MAX_TEMP_ARRAY_SIZE   6
 
#define UUID_LEN   13
 

Typedefs

typedef uint32_t mtostk_time_t
 time in seconds since 01/01/1970 More...
 

Enumerations

enum  Mtostk_sensors {
  MTOSTK_TEMP = 0, MTOSTK_ABS_PRESS, MTOSTK_DIF_PRESS, MTOSTK_HUMIDITY,
  MTOSTK_NUM_SENSORS
}
 

Functions

bool mtostk_populate_cal_from_buffer (Calibration_params *cp, uint8_t *eeprom_buffer)
 Initializes a Calibration_params structure from memory buffer. More...
 
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 More...
 

Detailed Description

Parser for calibration data coming from 25AA256 EEPROM of the Meteo Stick

Definition in file meteo_stick_calib.h.


Data Structure Documentation

◆ Sensors_params

struct Sensors_params

Calibration_params structure initialized with calibvration data read from meteostick eeprom.

Definition at line 73 of file meteo_stick_calib.h.

Data Fields
float coeffs[MTOSTK_MAX_TEMP_ARRAY_SIZE][MTOSTK_MAX_POLY_ARRAY_SIZE]
uint16_t num_coeff
uint16_t num_temp
float temps[MTOSTK_MAX_TEMP_ARRAY_SIZE]
mtostk_time_t timestamp

◆ Calibration_params

struct Calibration_params

Definition at line 81 of file meteo_stick_calib.h.

+ Collaboration diagram for Calibration_params:
Data Fields
Sensors_params params[MTOSTK_NUM_SENSORS]
char uuid[13]

Macro Definition Documentation

◆ MTOSTK_MAX_POLY_ARRAY_SIZE

#define MTOSTK_MAX_POLY_ARRAY_SIZE   6

Definition at line 39 of file meteo_stick_calib.h.

◆ MTOSTK_MAX_SEEK_ARRAY_SIZE

#define MTOSTK_MAX_SEEK_ARRAY_SIZE   20

Definition at line 38 of file meteo_stick_calib.h.

◆ MTOSTK_MAX_TEMP_ARRAY_SIZE

#define MTOSTK_MAX_TEMP_ARRAY_SIZE   6

Definition at line 40 of file meteo_stick_calib.h.

◆ UUID_LEN

#define UUID_LEN   13

Definition at line 41 of file meteo_stick_calib.h.

Typedef Documentation

◆ mtostk_time_t

time in seconds since 01/01/1970

@notes we don't use libc time_t because it can be a 64 bits type to avoid Y2038 bug we instead keep a 32 bits type but unsigned. We don't care date before 1970, and 4e9 seconds since 1/1/70 make us bug free until 2100

Definition at line 61 of file meteo_stick_calib.h.

Enumeration Type Documentation

◆ Mtostk_sensors

Enumerator
MTOSTK_TEMP 
MTOSTK_ABS_PRESS 
MTOSTK_DIF_PRESS 
MTOSTK_HUMIDITY 
MTOSTK_NUM_SENSORS 

Definition at line 43 of file meteo_stick_calib.h.

Function Documentation

◆ 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

Parameters
[in]cppointer to calibration structure
[in]typesensor type
[in]uncaluncalibrated value
[in]tempcurrent temperature (not relevant for calibration of temperature sensor)
Returns
calibrated value

Definition at line 71 of file meteo_stick_calib.c.

References Sensors_params::coeffs, mtostk_apply_polynomial(), mtostk_apply_polynomial_temp(), MTOSTK_NUM_SENSORS, MTOSTK_TEMP, Sensors_params::num_coeff, Sensors_params::num_temp, Calibration_params::params, Sensors_params::timestamp, and type().

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

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

◆ 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.

Precondition
the memory buffer must be initialized with data read from the spi eeprom embeded on the meteostick
Parameters
[out]cppointer to the Calibration_params structure to be initialized
[in]eeprom_bufferpointer to word aligned buffer of bytes

Definition at line 53 of file meteo_stick_calib.c.

References MTOSTK_NUM_SENSORS, mtostk_populate_sensor_from_buffer(), mtostk_populate_uuid_from_buffer(), MTOSTK_TEMP, Calibration_params::params, and Calibration_params::uuid.

Referenced by meteo_stick_periodic().

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