ZMOD4510 Ultra-Low Power Ozone Firmware Documentation |

ulp_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
21 #ifndef ULP_O3_H_
22 #define ULP_O3_H_
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #include <stdint.h>
29 #include <math.h>
30 #include "zmod4xxx_types.h"
31
35 typedef struct {
36 uint8_t major;
37 uint8_t minor;
38 uint8_t patch;
39 } algorithm_version;
40
44 #define ULP_O3_OK (0)
45 #define ULP_O3_STABILIZATION (1)
46 #define ULP_O3_DAMAGE (-102)
52 typedef struct {
53 uint32_t sample_cnt;
54 float smooth_rmox;
55 float gcda;
56 float o3_conc_ppb;
57 float o3_1h_ppb;
58 float o3_8h_ppb;
59 } ulp_o3_handle_t;
60
64 typedef struct {
65 float rmox[8];
66 float temperature;
67 float O3_conc_ppb;
69 uint16_t FAST_AQI;
72 uint16_t EPA_AQI;
74 } ulp_o3_results_t;
75
82 typedef struct {
83 uint8_t *adc_result;
84 float humidity_pct;
85 float temperature_degc;
86 } ulp_o3_inputs_t;
87
93 int8_t init_ulp_o3(ulp_o3_handle_t *handle);
94
103 int8_t calc_ulp_o3(ulp_o3_handle_t *handle, zmod4xxx_dev_t *dev,
104 const ulp_o3_inputs_t *algo_input,
105 ulp_o3_results_t *results);
106
107 #ifdef __cplusplus
108 }
109 #endif
110
111 #endif /* ULP_O3_H_ */
calc_ulp_o3
int8_t calc_ulp_o3(ulp_o3_handle_t *handle, zmod4xxx_dev_t *dev, const ulp_o3_inputs_t *algo_input, ulp_o3_results_t *results)
calculates results from present sample.
ulp_o3_results_t::temperature
float temperature
Definition: ulp_o3.h:66
algorithm_version
Variables that describe the library version.
Definition: ulp_o3.h:35
ulp_o3_results_t::FAST_AQI
uint16_t FAST_AQI
Definition: ulp_o3.h:69
ulp_o3_results_t::O3_conc_ppb
float O3_conc_ppb
Definition: ulp_o3.h:67
ulp_o3_results_t::EPA_AQI
uint16_t EPA_AQI
Definition: ulp_o3.h:72
ulp_o3_results_t
Variables that receive the algorithm outputs.
Definition: ulp_o3.h:64
ulp_o3_inputs_t
Variables that are needed for algorithm.
Definition: ulp_o3.h:82
init_ulp_o3
int8_t init_ulp_o3(ulp_o3_handle_t *handle)
Initializes the ULP O3 algorithm.
zmod4xxx_types.h
zmod4xxx types
ulp_o3_handle_t::sample_cnt
uint32_t sample_cnt
Definition: ulp_o3.h:53
zmod4xxx_dev_t
Device structure ZMOD4xxx.
Definition: zmod4xxx_types.h:100
ulp_o3_handle_t
Variables that describe the sensor or the algorithm state.
Definition: ulp_o3.h:52
ulp_o3_handle_t::gcda
float gcda
Definition: ulp_o3.h:55