ZMOD4510 Nitrogen Dioxide and Ozone Firmware Documentation |

no2_o3.h
Go to the documentation of this file.
1 /*****************************************************************************
2 * Copyright (c) 2024 Renesas Electronics Corporation
3 * All Rights Reserved.
4 *
5 * This code is proprietary to Renesas, and is license pursuant to the terms and
6 * conditions that may be accessed at:
7 * https://www.renesas.com/eu/en/document/msc/renesas-software-license-terms-gas-sensor-software
8 *****************************************************************************/
9
23 #ifndef NO2_O3_H_
24 #define NO2_O3_H_
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 #include <stdint.h>
31 #include <math.h>
32 #include "zmod4xxx_types.h"
33
37 typedef struct {
38 uint8_t major;
39 uint8_t minor;
40 uint8_t patch;
41 } algorithm_version;
42
47 #define NO2_O3_OK (0)
48 #define NO2_O3_STABILIZATION (1)
49 #define NO2_O3_DAMAGE (-102)
55 typedef struct {
56 uint32_t sample_counter;
57 float rmoxs_smooth[4];
58 float logrmoxs_mean[4];
59 float logrmoxs_var[4];
60 float o3_1min_ppb;
61 float o3_1h_ppb;
62 float o3_8h_ppb;
63 float no2_1min_ppb;
64 float no2_1h_ppb;
65 } no2_o3_handle_t;
66
70 typedef struct {
71 float rmox[4];
72 float temperature;
73 float O3_conc_ppb;
74 float NO2_conc_ppb;
75 uint16_t
76 FAST_AQI;
77 uint16_t
78 EPA_AQI;
79 } no2_o3_results_t;
80
87 typedef struct {
88 uint8_t *adc_result;
89 float humidity_pct;
90 float temperature_degc;
91 } no2_o3_inputs_t;
92
98 int8_t init_no2_o3(no2_o3_handle_t *handle);
99
108 int8_t calc_no2_o3(no2_o3_handle_t *handle, const zmod4xxx_dev_t *dev,
109 const no2_o3_inputs_t *algo_input,
110 no2_o3_results_t *results);
111
112 #ifdef __cplusplus
113 }
114 #endif
115
116 #endif /* NO2_O3_H_ */
117
calc_no2_o3
int8_t calc_no2_o3(no2_o3_handle_t *handle, const zmod4xxx_dev_t *dev, const no2_o3_inputs_t *algo_input, no2_o3_results_t *results)
calculates NO2 O3 results from present sample.
init_no2_o3
int8_t init_no2_o3(no2_o3_handle_t *handle)
Initializes the NO2 O3 algorithm.
no2_o3_handle_t::sample_counter
uint32_t sample_counter
Definition: no2_o3.h:56
algorithm_version
Variables that describe the library version.
Definition: no2_o3.h:37
no2_o3_handle_t
Variables that describe the sensor or the algorithm state.
Definition: no2_o3.h:55
no2_o3_inputs_t
Variables that are needed for algorithm.
Definition: no2_o3.h:87
no2_o3_results_t::FAST_AQI
uint16_t FAST_AQI
Definition: no2_o3.h:76
no2_o3_results_t::temperature
float temperature
Definition: no2_o3.h:72
no2_o3_results_t::EPA_AQI
uint16_t EPA_AQI
Definition: no2_o3.h:78
no2_o3_results_t::NO2_conc_ppb
float NO2_conc_ppb
Definition: no2_o3.h:74
zmod4xxx_types.h
zmod4xxx types
zmod4xxx_dev_t
Device structure ZMOD4xxx.
Definition: zmod4xxx_types.h:100
no2_o3_results_t::O3_conc_ppb
float O3_conc_ppb
Definition: no2_o3.h:73
no2_o3_results_t
Variables that receive the algorithm outputs.
Definition: no2_o3.h:70