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;
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;
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;
75 
82 typedef struct {
83  uint8_t *adc_result;
84  float humidity_pct;
85  float temperature_degc;
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_ */
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.
float temperature
Definition: ulp_o3.h:66
Variables that describe the library version.
Definition: ulp_o3.h:35
uint16_t FAST_AQI
Definition: ulp_o3.h:69
float O3_conc_ppb
Definition: ulp_o3.h:67
uint16_t EPA_AQI
Definition: ulp_o3.h:72
Variables that receive the algorithm outputs.
Definition: ulp_o3.h:64
Variables that are needed for algorithm.
Definition: ulp_o3.h:82
int8_t init_ulp_o3(ulp_o3_handle_t *handle)
Initializes the ULP O3 algorithm.
zmod4xxx types
uint32_t sample_cnt
Definition: ulp_o3.h:53
Device structure ZMOD4xxx.
Definition: zmod4xxx_types.h:100
Variables that describe the sensor or the algorithm state.
Definition: ulp_o3.h:52
float gcda
Definition: ulp_o3.h:55