ZMOD4510 Ultra-Low Power 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;
32 
36 typedef struct {
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 
Renesas Environmental Sensor HAL definitions.
Data structure holding information required for HSxxxx API operation.
Definition: hsxxxx.h:36
Data structure holding humidity/temperature results.
Definition: hsxxxx.h:28
Interface_t * interface
Definition: hsxxxx.h:37
char const * HSxxxx_Name(HSxxxx_t *sensor)
Return the temperature/humidity sensor type name.
int HSxxxx_Init(HSxxxx_t *sensor, Interface_t *hal)
Initialize the sensor object.
float humidity
Definition: hsxxxx.h:30
uint8_t i2cAddress
Definition: hsxxxx.h:38
int HSxxxx_Measure(HSxxxx_t *sensor, HSxxxx_Results_t *results)
Perform one temperature measurement.
A structure of pointers to hardware specific functions.
Definition: hal.h:78
float temperature
Definition: hsxxxx.h:29