Capacitive digital sensor for relative humidity and temperature.

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   HelloWorld_ST_Sensors MOTENV_Mbed mbed-os-mqtt-client HTS221_JS ... more

Embed: (wiki syntax)

« Back to documentation index

HTS221_Public_Functions

HTS221_Public_Functions
[HTS221_DRIVER]

Functions

HTS221_Error_et HTS221_Get_DriverVersion (HTS221_DriverVersion_st *version)
 Get the version of this driver.
HTS221_Error_et HTS221_Get_DeviceID (void *handle, uint8_t *deviceid)
 Get device type ID.
HTS221_Error_et HTS221_Set_InitConfig (void *handle, HTS221_Init_st *pxInit)
 Initializes the HTS221 with the specified parameters in HTS221_Init_st struct.
HTS221_Error_et HTS221_Get_InitConfig (void *handle, HTS221_Init_st *pxInit)
 Returns a HTS221_Init_st struct with the actual configuration.
HTS221_Error_et HTS221_DeInit (void *handle)
 De initialization function for HTS221.
HTS221_Error_et HTS221_Get_Measurement (void *handle, uint16_t *humidity, int16_t *temperature)
 Read HTS221 output registers, and calculate humidity and temperature.
HTS221_Error_et HTS221_Get_RawMeasurement (void *handle, int16_t *humidity, int16_t *temperature)
 Read HTS221 output registers.
HTS221_Error_et HTS221_Get_Humidity (void *handle, uint16_t *value)
 Read HTS221 Humidity output registers, and calculate humidity.
HTS221_Error_et HTS221_Get_HumidityRaw (void *handle, int16_t *value)
 Read HTS221 humidity output registers.
HTS221_Error_et HTS221_Get_Temperature (void *handle, int16_t *value)
 Read HTS221 temperature output registers, and calculate temperature.
HTS221_Error_et HTS221_Get_TemperatureRaw (void *handle, int16_t *value)
 Read HTS221 temperature output registers.
HTS221_Error_et HTS221_Get_DataStatus (void *handle, HTS221_BitStatus_et *humidity, HTS221_BitStatus_et *temperature)
 Get the availability of new data for humidity and temperature.
HTS221_Error_et HTS221_Activate (void *handle)
 Exit from power down mode.
HTS221_Error_et HTS221_DeActivate (void *handle)
 Put the sensor in power down mode.
HTS221_Error_et HTS221_IsMeasurementCompleted (void *handle, HTS221_BitStatus_et *Is_Measurement_Completed)
 Check if the single measurement has completed.
HTS221_Error_et HTS221_Set_AvgHT (void *handle, HTS221_Avgh_et avgh, HTS221_Avgt_et avgt)
 Set_ humidity and temperature average mode.
HTS221_Error_et HTS221_Set_AvgH (void *handle, HTS221_Avgh_et avgh)
 Set humidity average mode.
HTS221_Error_et HTS221_Set_AvgT (void *handle, HTS221_Avgt_et avgt)
 Set temperature average mode.
HTS221_Error_et HTS221_Get_AvgHT (void *handle, HTS221_Avgh_et *avgh, HTS221_Avgt_et *avgt)
 Get humidity and temperature average mode.
HTS221_Error_et HTS221_Set_BduMode (void *handle, HTS221_State_et status)
 Set block data update mode.
HTS221_Error_et HTS221_Get_BduMode (void *handle, HTS221_State_et *status)
 Get block data update mode.
HTS221_Error_et HTS221_Set_PowerDownMode (void *handle, HTS221_BitStatus_et status)
 Enter or exit from power down mode.
HTS221_Error_et HTS221_Get_PowerDownMode (void *handle, HTS221_BitStatus_et *status)
 Get if HTS221 is in active mode or in power down mode.
HTS221_Error_et HTS221_Set_Odr (void *handle, HTS221_Odr_et odr)
 Set the output data rate mode.
HTS221_Error_et HTS221_Get_Odr (void *handle, HTS221_Odr_et *odr)
 Get the output data rate mode.
HTS221_Error_et HTS221_MemoryBoot (void *handle)
 Reboot Memory Content.
HTS221_Error_et HTS221_Set_HeaterState (void *handle, HTS221_State_et status)
 Configure the internal heater.
HTS221_Error_et HTS221_Get_HeaterState (void *handle, HTS221_State_et *status)
 Get the internal heater.
HTS221_Error_et HTS221_StartOneShotMeasurement (void *handle)
 Set ONE_SHOT bit to start a new conversion (ODR mode has to be 00).
HTS221_Error_et HTS221_Set_IrqActiveLevel (void *handle, HTS221_DrdyLevel_et value)
 Set level configuration of the interrupt pin DRDY.
HTS221_Error_et HTS221_Get_IrqActiveLevel (void *handle, HTS221_DrdyLevel_et *value)
 Get level configuration of the interrupt pin DRDY.
HTS221_Error_et HTS221_Set_IrqOutputType (void *handle, HTS221_OutputType_et value)
 Set Push-pull/open drain configuration for the interrupt pin DRDY.
HTS221_Error_et HTS221_Get_IrqOutputType (void *handle, HTS221_OutputType_et *value)
 Get the configuration for the interrupt pin DRDY.
HTS221_Error_et HTS221_Set_IrqEnable (void *handle, HTS221_State_et status)
 Enable/disable the interrupt mode.
HTS221_Error_et HTS221_Get_IrqEnable (void *handle, HTS221_State_et *status)
 Get the interrupt mode.
void HTS221_assert_failed (uint8_t *file, uint32_t line)
 Reports the name of the source file and the source line number where the assert_param error has occurred.

Function Documentation

HTS221_Error_et HTS221_Activate ( void *  handle )

Exit from power down mode.

Parameters:
*handleDevice handle.
void.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 481 of file HTS221_driver.c.

void HTS221_assert_failed ( uint8_t *  file,
uint32_t  line 
)

Reports the name of the source file and the source line number where the assert_param error has occurred.

Parameters:
file,:pointer to the source file name
line,:assert_param error line source number
Return values:
:None

Definition at line 1029 of file HTS221_driver.c.

HTS221_Error_et HTS221_DeActivate ( void *  handle )

Put the sensor in power down mode.

Parameters:
*handleDevice handle.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 503 of file HTS221_driver.c.

HTS221_Error_et HTS221_DeInit ( void *  handle )

De initialization function for HTS221.

This function put the HTS221 in power down, make a memory boot and clear the data output flags.

Parameters:
*handleDevice handle.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 259 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_AvgHT ( void *  handle,
HTS221_Avgh_et avgh,
HTS221_Avgt_et avgt 
)

Get humidity and temperature average mode.

Parameters:
*handleDevice handle.
avghpointer to the returned value with the humidity average mode.
avgtpointer to the returned value with the temperature average mode.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 634 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_BduMode ( void *  handle,
HTS221_State_et status 
)

Get block data update mode.

Parameters:
*handleDevice handle.
Pointerto the returned value with block data update mode status.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 682 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_DataStatus ( void *  handle,
HTS221_BitStatus_et humidity,
HTS221_BitStatus_et temperature 
)

Get the availability of new data for humidity and temperature.

Parameters:
*handleDevice handle.
humiditypointer to the returned humidity data status [HTS221_SET/HTS221_RESET].
temperaturepointer to the returned temperature data status [HTS221_SET/HTS221_RESET]. This parameter is a pointer to HTS221_BitStatus_et.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 461 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_DeviceID ( void *  handle,
uint8_t *  deviceid 
)

Get device type ID.

Parameters:
*handleDevice handle.
deviceidpointer to the returned device type ID.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 155 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_DriverVersion ( HTS221_DriverVersion_st version )

Get the version of this driver.

Parameters:
pxVersionpointer to a HTS221_DriverVersion_st structure that contains the version information. This parameter is a pointer to HTS221_DriverVersion_st.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 140 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_HeaterState ( void *  handle,
HTS221_State_et status 
)

Get the internal heater.

Parameters:
*handleDevice handle.
Pointerto the returned status of the internal heater [HTS221_ENABLE/HTS221_DISABLE].
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 844 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_Humidity ( void *  handle,
uint16_t *  value 
)

Read HTS221 Humidity output registers, and calculate humidity.

Parameters:
*handleDevice handle.
Pointerto the returned humidity value that must be divided by 10 to get the value in [%].
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 331 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_HumidityRaw ( void *  handle,
int16_t *  value 
)

Read HTS221 humidity output registers.

Parameters:
*handleDevice handle.
Pointerto the returned humidity raw value.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 375 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_InitConfig ( void *  handle,
HTS221_Init_st pxInit 
)

Returns a HTS221_Init_st struct with the actual configuration.

Parameters:
*handleDevice handle.
pxInitpointer to a HTS221_Init_st structure. This parameter is a pointer to HTS221_Init_st.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 227 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_IrqActiveLevel ( void *  handle,
HTS221_DrdyLevel_et value 
)

Get level configuration of the interrupt pin DRDY.

Parameters:
*handleDevice handle.
Pointerto the returned status of the level configuration [HTS221_ENABLE/HTS221_DISABLE].
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 915 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_IrqEnable ( void *  handle,
HTS221_State_et status 
)

Get the interrupt mode.

Parameters:
*handleDevice handle.
Pointerto the returned status of the interrupt mode configuration [HTS221_ENABLE/HTS221_DISABLE].
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 1007 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_IrqOutputType ( void *  handle,
HTS221_OutputType_et value 
)

Get the configuration for the interrupt pin DRDY.

Parameters:
*handleDevice handle.
Pointerto the returned value with output type configuration.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 961 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_Measurement ( void *  handle,
uint16_t *  humidity,
int16_t *  temperature 
)

Read HTS221 output registers, and calculate humidity and temperature.

Parameters:
*handleDevice handle.
humiditypointer to the returned humidity value that must be divided by 10 to get the value in [%].
temperaturepointer to the returned temperature value that must be divided by 10 to get the value in ['C].
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 292 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_Odr ( void *  handle,
HTS221_Odr_et odr 
)

Get the output data rate mode.

Parameters:
*handleDevice handle.
Pointerto the returned value with output data rate mode.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 775 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_PowerDownMode ( void *  handle,
HTS221_BitStatus_et status 
)

Get if HTS221 is in active mode or in power down mode.

Parameters:
*handleDevice handle.
Pointerto the returned value with HTS221 status.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 729 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_RawMeasurement ( void *  handle,
int16_t *  humidity,
int16_t *  temperature 
)

Read HTS221 output registers.

Humidity and temperature.

Parameters:
*handleDevice handle.
humiditypointer to the returned humidity raw value.
temperaturepointer to the returned temperature raw value.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 311 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_Temperature ( void *  handle,
int16_t *  value 
)

Read HTS221 temperature output registers, and calculate temperature.

Parameters:
*handleDevice handle.
Pointerto the returned temperature value that must be divided by 10 to get the value in ['C].
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 394 of file HTS221_driver.c.

HTS221_Error_et HTS221_Get_TemperatureRaw ( void *  handle,
int16_t *  value 
)

Read HTS221 temperature output registers.

Parameters:
*handleDevice handle.
Pointerto the returned temperature raw value.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 440 of file HTS221_driver.c.

HTS221_Error_et HTS221_IsMeasurementCompleted ( void *  handle,
HTS221_BitStatus_et Is_Measurement_Completed 
)

Check if the single measurement has completed.

Parameters:
*handleDevice handle.
tmpis set to 1, when the measure is completed
Return values:
Status[HTS221_ERROR, HTS221_OK]

Definition at line 528 of file HTS221_driver.c.

HTS221_Error_et HTS221_MemoryBoot ( void *  handle )

Reboot Memory Content.

Parameters:
*handleDevice handle.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 794 of file HTS221_driver.c.

HTS221_Error_et HTS221_Set_AvgH ( void *  handle,
HTS221_Avgh_et  avgh 
)

Set humidity average mode.

Parameters:
*handleDevice handle.
avghis the average mode for humidity, this parameter is HTS221_Avgh_et.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 581 of file HTS221_driver.c.

HTS221_Error_et HTS221_Set_AvgHT ( void *  handle,
HTS221_Avgh_et  avgh,
HTS221_Avgt_et  avgt 
)

Set_ humidity and temperature average mode.

Parameters:
*handleDevice handle.
avghis the average mode for humidity, this parameter is HTS221_Avgh_et.
avgtis the average mode for temperature, this parameter is HTS221_Avgt_et.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 553 of file HTS221_driver.c.

HTS221_Error_et HTS221_Set_AvgT ( void *  handle,
HTS221_Avgt_et  avgt 
)

Set temperature average mode.

Parameters:
*handleDevice handle.
avgtis the average mode for temperature, this parameter is HTS221_Avgt_et.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 607 of file HTS221_driver.c.

HTS221_Error_et HTS221_Set_BduMode ( void *  handle,
HTS221_State_et  status 
)

Set block data update mode.

Parameters:
*handleDevice handle.
statuscan be HTS221_ENABLE: enable the block data update, output data registers are updated once both MSB and LSB are read.
statuscan be HTS221_DISABLE: output data registers are continuously updated. This parameter is a HTS221_BitStatus_et.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 656 of file HTS221_driver.c.

HTS221_Error_et HTS221_Set_HeaterState ( void *  handle,
HTS221_State_et  status 
)

Configure the internal heater.

Parameters:
*handleDevice handle.
Thestatus of the internal heater [HTS221_ENABLE/HTS221_DISABLE]. This parameter is a HTS221_State_et.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR]

Definition at line 818 of file HTS221_driver.c.

HTS221_Error_et HTS221_Set_InitConfig ( void *  handle,
HTS221_Init_st pxInit 
)

Initializes the HTS221 with the specified parameters in HTS221_Init_st struct.

Parameters:
*handleDevice handle.
pxInitpointer to a HTS221_Init_st structure that contains the configuration. This parameter is a pointer to HTS221_Init_st.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 171 of file HTS221_driver.c.

HTS221_Error_et HTS221_Set_IrqActiveLevel ( void *  handle,
HTS221_DrdyLevel_et  value 
)

Set level configuration of the interrupt pin DRDY.

Parameters:
*handleDevice handle.
statuscan be HTS221_LOW_LVL: active level is LOW.
statuscan be HTS221_HIGH_LVL: active level is HIGH. This parameter is a HTS221_State_et.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 889 of file HTS221_driver.c.

HTS221_Error_et HTS221_Set_IrqEnable ( void *  handle,
HTS221_State_et  status 
)

Enable/disable the interrupt mode.

Parameters:
*handleDevice handle.
statusis the enable/disable for the interrupt mode. This parameter is a HTS221_State_et.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 981 of file HTS221_driver.c.

HTS221_Error_et HTS221_Set_IrqOutputType ( void *  handle,
HTS221_OutputType_et  value 
)

Set Push-pull/open drain configuration for the interrupt pin DRDY.

Parameters:
*handleDevice handle.
valueis the output type configuration. This parameter is a HTS221_OutputType_et.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 935 of file HTS221_driver.c.

HTS221_Error_et HTS221_Set_Odr ( void *  handle,
HTS221_Odr_et  odr 
)

Set the output data rate mode.

Parameters:
*handleDevice handle.
odris the output data rate mode. This parameter is a HTS221_Odr_et.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 749 of file HTS221_driver.c.

HTS221_Error_et HTS221_Set_PowerDownMode ( void *  handle,
HTS221_BitStatus_et  status 
)

Enter or exit from power down mode.

Parameters:
*handleDevice handle.
statuscan be HTS221_SET: HTS221 in power down mode.
statuscan be HTS221_REET: HTS221 in active mode. This parameter is a HTS221_BitStatus_et.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 703 of file HTS221_driver.c.

HTS221_Error_et HTS221_StartOneShotMeasurement ( void *  handle )

Set ONE_SHOT bit to start a new conversion (ODR mode has to be 00).

Once the measurement is done, ONE_SHOT bit is self-cleared.

Parameters:
*handleDevice handle.
Return values:
Errorcode [HTS221_OK, HTS221_ERROR].

Definition at line 863 of file HTS221_driver.c.