ZMOD4510 Nitrogen Dioxide and Ozone Firmware Documentation |

hsxxxx.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
19 #ifndef HSXXXX_H
20 #define HSXXXX_H
21
22 #include <stdbool.h>
23 #include "hal/hal.h"
24
28 typedef struct {
29 float temperature;
30 float humidity;
31 } HSxxxx_Results_t;
32
36 typedef struct {
37 Interface_t* interface;
38 uint8_t i2cAddress;
39 } HSxxxx_t;
40
57 int
58 HSxxxx_Init ( HSxxxx_t* sensor, Interface_t* hal );
59
76 int
77 HSxxxx_Measure ( HSxxxx_t* sensor, HSxxxx_Results_t* results );
78
92 char const*
93 HSxxxx_Name ( HSxxxx_t* sensor );
94
101 static inline int
102 HSxxxx_MeasurementDuration ( HSxxxx_t* sensor ) {
103 if ( sensor ) {
104 if ( sensor -> i2cAddress == 0x44 ) {
105 return 35;
106 }
107 else if ( sensor -> i2cAddress == 0x54 ) {
108 return 2;
109 }
110 }
111 return 0;
112 }
113
114 #endif /* HSXXXX_H */
115
hal.h
Renesas Environmental Sensor HAL definitions.
HSxxxx_t
Data structure holding information required for HSxxxx API operation.
Definition: hsxxxx.h:36
HSxxxx_Results_t
Data structure holding humidity/temperature results.
Definition: hsxxxx.h:28
HSxxxx_t::interface
Interface_t * interface
Definition: hsxxxx.h:37
HSxxxx_Name
char const * HSxxxx_Name(HSxxxx_t *sensor)
Return the temperature/humidity sensor type name.
HSxxxx_Init
int HSxxxx_Init(HSxxxx_t *sensor, Interface_t *hal)
Initialize the sensor object.
HSxxxx_Results_t::humidity
float humidity
Definition: hsxxxx.h:30
HSxxxx_t::i2cAddress
uint8_t i2cAddress
Definition: hsxxxx.h:38
HSxxxx_Measure
int HSxxxx_Measure(HSxxxx_t *sensor, HSxxxx_Results_t *results)
Perform one temperature measurement.
Interface_t
A structure of pointers to hardware specific functions.
Definition: hal.h:78
HSxxxx_Results_t::temperature
float temperature
Definition: hsxxxx.h:29