RRH46410 Firmware Documentation
HS3xxx Sensor API

HS3xxx Temperature/Humidity Sensor API. More...

Files

file  hs3xxx.h
 HS3xxx sensor declarations.
 

Functions

int HS3xxx_Init (HSxxxx_t *sensor, Interface_t *hal)
 Initialize the sensor object. More...
 
int HS3xxx_ReadID (HSxxxx_t *sensor, uint32_t *id)
 Read the unique sensor ID of the HS3xxx. More...
 
int HS3xxx_Measure (HSxxxx_t *sensor, HSxxxx_Results_t *results)
 Execute a temperature/humidity measurement cycle. More...
 
int HS3xxx_MeasureStart (HSxxxx_t *sensor)
 Start a temperature/humidity measurement cycle. More...
 
int HS3xxx_MeasureRead (HSxxxx_t *sensor, HSxxxx_Results_t *results)
 Read temperature/humidity results. More...
 

Enumerations

enum  HTError_t { hteStaleData = 1 }
 Error code definitions specific for the HS3xxx API. More...
 

Detailed Description

HS3xxx Temperature/Humidity Sensor API.

HS3xxx is a series of highly-accurate, fully-calibrated relative humidity and temperature sensors.

The HS3xxx API provides convenient access to the temperature & humidity measurement capabilities of the sensor.

Enumeration Type Documentation

◆ HTError_t

enum HTError_t

Error code definitions specific for the HS3xxx API.

Enumerator
hteStaleData 

Sensor reported stale data.

Function Documentation

◆ HS3xxx_Init()

int HS3xxx_Init ( HSxxxx_t sensor,
Interface_t hal 
)

Initialize the sensor object.

This function tries accessing the HS3xxx I2C address using hal as hardware interface. On success, the sensor object is initialized and can be used afterwards. Otherwise, an error code is returned and the sensor object is not usable.

Note
The HS3xxx API requires that the HAL interface object has the Interface_t::i2cRead and Interface_t::i2cWrite members defined. In addition, HS3xxx_Measure() requires the Interface_t::msSleep member, however, the check for this function is done in HS3xxx_Measure() and not in HS3xxx_Init().
Parameters
sensorPointer to sensor object to be initialized
halPointer to HAL object providing physical communication
Returns
int Error code
Return values
0On success
otherOn error

◆ HS3xxx_Measure()

int HS3xxx_Measure ( HSxxxx_t sensor,
HSxxxx_Results_t results 
)

Execute a temperature/humidity measurement cycle.

This function starts a measurement cycle in non-hold mode, waits for the result to be available and reads it. This is a convenience function which calls HS3xxx_MeasureStart() and HS3xxx_MeasureRead() with a delay between both calls, to allow the sensor to complete its measurement.

Parameters
sensorPointer to an initialized sensor object
resultsPointer to a data structure, to store results in
Returns
int Error code
Return values
0On success
otherOn error

◆ HS3xxx_MeasureRead()

int HS3xxx_MeasureRead ( HSxxxx_t sensor,
HSxxxx_Results_t results 
)

Read temperature/humidity results.

This function reads the temperature/humidity results from a measurement that has been started through HS3xxx_MeasureStart() previously.

Parameters
sensorPointer to an initialized sensor object
resultsPointer to a data structure, to store results in
Returns
int Error code
Return values
0On success
otherOn error

◆ HS3xxx_MeasureStart()

int HS3xxx_MeasureStart ( HSxxxx_t sensor)

Start a temperature/humidity measurement cycle.

Parameters
sensorPointer to an initialized sensor object
Returns
int Error code
Return values
0On success
otherOn error

◆ HS3xxx_ReadID()

int HS3xxx_ReadID ( HSxxxx_t sensor,
uint32_t *  id 
)

Read the unique sensor ID of the HS3xxx.

Parameters
sensorPointer to an initialized sensor object
idPointer buffer to store the ID
Returns
int Error code
Return values
0On success
otherOn error