2019-01-26 17:02:19 +00:00
|
|
|
/*
|
|
|
|
* rte_wx.h
|
|
|
|
*
|
|
|
|
* Created on: 26.01.2019
|
|
|
|
* Author: mateusz
|
|
|
|
*/
|
|
|
|
|
2020-08-18 21:22:25 +00:00
|
|
|
#include "station_config.h"
|
|
|
|
|
2019-01-26 17:02:19 +00:00
|
|
|
#include "drivers/_dht22.h"
|
|
|
|
#include "drivers/dallas.h"
|
2020-08-18 21:22:25 +00:00
|
|
|
#include "drivers/analog_anemometer.h"
|
|
|
|
#include "umb_master/umb_master.h"
|
|
|
|
#include "umb_master/umb_qf_t.h"
|
|
|
|
|
|
|
|
|
|
|
|
//#ifdef _SENSOR_MS5611
|
2019-01-26 17:02:19 +00:00
|
|
|
#include "drivers/ms5611.h"
|
2020-08-18 21:22:25 +00:00
|
|
|
//#endif
|
|
|
|
|
|
|
|
//#ifdef _SENSOR_BME280
|
2020-06-23 22:17:59 +00:00
|
|
|
#include "drivers/bme280.h"
|
2020-08-18 21:22:25 +00:00
|
|
|
//#endif
|
2019-01-26 17:02:19 +00:00
|
|
|
|
|
|
|
#ifndef RTE_WX_H_
|
|
|
|
#define RTE_WX_H_
|
|
|
|
|
2020-01-04 13:15:33 +00:00
|
|
|
#define WIND_AVERAGE_LEN 18
|
|
|
|
|
2020-03-06 19:24:20 +00:00
|
|
|
#define PRESSURE_AVERAGE_LN 4
|
|
|
|
|
2020-04-04 21:09:00 +00:00
|
|
|
#define RTE_WX_MEASUREMENT_WIND 460
|
|
|
|
#define RTE_WX_MEASUREMENT_TEMPERATURE 100
|
|
|
|
#define RTE_WX_MEASUREMENT_PRESSUERE 300
|
|
|
|
|
2019-01-26 17:02:19 +00:00
|
|
|
extern float rte_wx_temperature_dallas, rte_wx_temperature_dallas_valid;
|
2019-12-22 11:34:03 +00:00
|
|
|
extern float rte_wx_temperature_dalls_slew_rate;
|
2019-10-27 19:50:01 +00:00
|
|
|
extern float rte_wx_temperature_average_dallas_valid;
|
|
|
|
extern float rte_wx_temperature_min_dallas_valid, rte_wx_temperature_max_dallas_valid;
|
|
|
|
extern float rte_wx_temperature_ms, rte_wx_temperature_ms_valid;
|
2019-01-26 17:02:19 +00:00
|
|
|
extern float rte_wx_pressure, rte_wx_pressure_valid;
|
2020-03-06 19:24:20 +00:00
|
|
|
extern float rte_wx_pressure_history[PRESSURE_AVERAGE_LN];
|
|
|
|
extern uint8_t rte_wx_pressure_it;
|
2019-01-26 17:02:19 +00:00
|
|
|
|
2019-12-27 21:07:24 +00:00
|
|
|
extern uint16_t rte_wx_windspeed_pulses;
|
2020-01-04 13:15:33 +00:00
|
|
|
extern uint16_t rte_wx_windspeed[WIND_AVERAGE_LEN];
|
|
|
|
extern uint8_t rte_wx_windspeed_it;
|
|
|
|
extern uint16_t rte_wx_winddirection[WIND_AVERAGE_LEN];
|
|
|
|
extern uint8_t rte_wx_winddirection_it;
|
2020-02-01 22:20:17 +00:00
|
|
|
extern uint16_t rte_wx_winddirection_last;
|
2020-01-04 13:15:33 +00:00
|
|
|
extern uint16_t rte_wx_average_windspeed;
|
|
|
|
extern uint16_t rte_wx_max_windspeed;
|
|
|
|
extern int16_t rte_wx_average_winddirection;
|
2019-12-27 21:07:24 +00:00
|
|
|
|
2020-06-24 16:45:06 +00:00
|
|
|
extern int8_t rte_wx_humidity, rte_wx_humidity_valid;
|
2020-06-21 21:11:16 +00:00
|
|
|
|
2019-05-05 07:48:51 +00:00
|
|
|
extern uint8_t rte_wx_tx20_excessive_slew_rate;
|
|
|
|
|
2019-01-26 17:02:19 +00:00
|
|
|
extern dht22Values rte_wx_dht, rte_wx_dht_valid;
|
|
|
|
|
2020-03-23 20:41:01 +00:00
|
|
|
extern dallas_qf_t rte_wx_current_dallas_qf, rte_wx_error_dallas_qf;
|
|
|
|
extern dallas_average_t rte_wx_dallas_average;
|
2020-08-18 21:22:25 +00:00
|
|
|
extern analog_wind_qf_t rte_wx_wind_qf;
|
|
|
|
|
|
|
|
//#ifdef _SENSOR_MS5611
|
2019-01-26 17:02:19 +00:00
|
|
|
extern ms5611_qf_t rte_wx_ms5611_qf;
|
2020-08-18 21:22:25 +00:00
|
|
|
//#endif
|
|
|
|
|
|
|
|
#ifdef _SENSOR_BME280
|
2020-06-24 16:45:06 +00:00
|
|
|
extern bme280_qf_t rte_wx_bme280_qf;
|
2020-08-18 21:22:25 +00:00
|
|
|
#endif
|
2019-01-26 17:02:19 +00:00
|
|
|
|
2020-02-23 17:22:37 +00:00
|
|
|
#ifdef _UMB_MASTER
|
|
|
|
|
2020-02-23 06:50:22 +00:00
|
|
|
extern umb_frame_t rte_wx_umb;
|
2020-03-07 18:13:24 +00:00
|
|
|
extern umb_context_t rte_wx_umb_context;
|
2020-03-20 21:53:24 +00:00
|
|
|
extern uint8_t rte_wx_umb_last_status;
|
|
|
|
extern int16_t rte_wx_umb_channel_values[UMB_CHANNELS_STORAGE_CAPAC][2];
|
2020-04-10 20:54:30 +00:00
|
|
|
// stores the value in 0.1 incremenets
|
2020-02-23 06:50:22 +00:00
|
|
|
#endif
|
2020-04-10 20:54:30 +00:00
|
|
|
extern umb_qf_t rte_wx_umb_qf;
|
2020-02-23 06:50:22 +00:00
|
|
|
|
2020-01-04 13:15:33 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void rte_wx_init(void);
|
2020-04-04 21:09:00 +00:00
|
|
|
void rte_wx_update_last_measuremenet_timers(uint16_t measurement_type);
|
2020-01-04 13:15:33 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2019-01-26 17:02:19 +00:00
|
|
|
|
|
|
|
#endif /* RTE_WX_H_ */
|