API providing a unified interface for Renesas Humidity and Temperature sensors.
More...
|
| file | hsxxxx.h |
| | Renesas humidity sensors (HS3xxx, HS4xxx) abstraction.
|
| |
API providing a unified interface for Renesas Humidity and Temperature sensors.
The Renesas HS3xxx and HS4xxx are highly accurate, ultra-low power, fully calibrated relative humidity and temperature sensors. These sensors may be used as standalone sensors or used as companion sensor for humidity and temperature sensitive applications (e.g., for Renesas gas sensors).
The present API is provided as a unified interface to both of these sensor types.
HAL API Requirements
HAL API ports to a customer specific hardware require the following function pointers of the
Interface_t HAL data structure to be initialized and working as documented:
◆ HSxxxx_Results_t
Data structure holding humidity/temperature results.
◆ humidity
◆ temperature
Temperature value in degree Celsius
◆ HSxxxx_t
Data structure holding information required for HSxxxx API operation.
◆ i2cAddress
I2C slave address of the HSxxxx sensor
◆ interface
Pointer to the hal object for physical communication
◆ HSxxxx_Init()
Initialize the sensor object.
This function tries searching for a HS4xxx sensor first, by accessing the corresponding I2C address. If no such sensor is found, the function searches for a HS3xxx.
The type of sensor being detected can be determined using the function HSxxxx_Name().
- Parameters
-
| sensor | Pointer to sensor object to be initialized. |
| hal | Pointer to hal object for physical communication. |
- Returns
- int Error code
- Return values
-
| 0 | On success |
| other | On error |
◆ HSxxxx_Measure()
Perform one temperature measurement.
This function starts a temperature/humidity measurement and waits for the availability of the result before it returns.
- Note
- This function is implemented as blocking function. Thus while the measurement is ongoing no other code is executed. Depending on the sensor the bocking time may be multiple tens of milliseconds.
- Parameters
-
| sensor | Pointer to the sensor object to be used. |
| results | Pointer to data structure for result storage. |
- Returns
- int Error code
- Return values
-
| 0 | On success |
| other | On error |
◆ HSxxxx_Name()
| char const* HSxxxx_Name |
( |
HSxxxx_t * |
sensor | ) |
|
Return the temperature/humidity sensor type name.
The function HSxxxx_Init can identify different types of temperature/ humidity sensors. This function may be used to determine the sensor type that has been identified. The identification is performed based on the sensors I2C address.
- Parameters
-
| sensor | Pointer to the sensor object to be queried. |
- Returns
- int Error code
- Return values
-
| 0 | On success |
| other | On error |