|
HTS221
Arduino library for the HTS221 humidity and temperature sensor
|

Functions | |
| HTS221_Error_et | HTS221_ReadReg (void *handle, uint8_t RegAddr, uint16_t NumByteToRead, uint8_t *Data) |
| HTS221_Error_et | HTS221_WriteReg (void *handle, uint8_t RegAddr, uint16_t NumByteToWrite, uint8_t *Data) |
| 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. This function put the HTS221 in power down, make a memory boot and clear the data output flags. | |
| HTS221_Error_et | HTS221_IsMeasurementCompleted (void *handle, HTS221_BitStatus_et *Is_Measurement_Completed) |
| Check if the single measurement has completed. | |
| 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. Humidity and temperature. | |
| HTS221_Error_et | HTS221_Get_Humidity (void *handle, uint16_t *value) |
| Read the humidity output and convert it using the factory calibration. | |
| HTS221_Error_et | HTS221_Get_HumidityRaw (void *handle, int16_t *value) |
| Read HTS221 humidity output registers. | |
| HTS221_Error_et | HTS221_Get_TemperatureRaw (void *handle, int16_t *value) |
| Read HTS221 temperature output registers. | |
| HTS221_Error_et | HTS221_Get_Temperature (void *handle, int16_t *value) |
| Read the temperature output and convert it using the factory calibration. | |
| 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_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). Once the measurement is done, ONE_SHOT bit is self-cleared. | |
| HTS221_Error_et | HTS221_Set_IrqActiveLevel (void *handle, HTS221_DrdyLevel_et status) |
| Set level configuration of the interrupt pin DRDY. | |
| HTS221_Error_et | HTS221_Get_IrqActiveLevel (void *handle, HTS221_DrdyLevel_et *status) |
| 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. | |
| HTS221_Error_et HTS221_Activate | ( | void * | handle | ) |
Exit from power down mode.
| handle | Device handle. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_DeActivate | ( | void * | handle | ) |
Put the sensor in power down mode.
| handle | Device handle. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| 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.
| handle | Device handle. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_AvgHT | ( | void * | handle, |
| HTS221_Avgh_et * | avgh, | ||
| HTS221_Avgt_et * | avgt | ||
| ) |
Get humidity and temperature average mode.
| handle | Device handle. |
| avgh | pointer to the returned value with the humidity average mode. |
| avgt | pointer to the returned value with the temperature average mode. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_BduMode | ( | void * | handle, |
| HTS221_State_et * | status | ||
| ) |
Get block data update mode.
| handle | Device handle. |
| status | Receives the block data update setting. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| 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.
| handle | Device handle. |
| humidity | pointer to the returned humidity data status [HTS221_SET/HTS221_RESET]. |
| temperature | pointer to the returned temperature data status [HTS221_SET/HTS221_RESET]. This parameter is a pointer to HTS221_BitStatus_et. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_DeviceID | ( | void * | handle, |
| uint8_t * | deviceid | ||
| ) |
Get device type ID.
| handle | Device handle. |
| deviceid | pointer to the returned device type ID. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_DriverVersion | ( | HTS221_DriverVersion_st * | version | ) |
Get the version of this driver.
| version | Pointer to a HTS221_DriverVersion_st structure that contains the version information. This parameter is a pointer to HTS221_DriverVersion_st. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_HeaterState | ( | void * | handle, |
| HTS221_State_et * | status | ||
| ) |
Get the internal heater.
| handle | Device handle. |
| status | Receives the internal heater state. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_Humidity | ( | void * | handle, |
| uint16_t * | value | ||
| ) |
Read the humidity output and convert it using the factory calibration.
| handle | Device handle. |
| value | Pointer to the humidity result in tenths of a percent (0-1000). |
| HTS221_OK | on success, or HTS221_ERROR if a register read fails. |
| HTS221_Error_et HTS221_Get_HumidityRaw | ( | void * | handle, |
| int16_t * | value | ||
| ) |
Read HTS221 humidity output registers.
| handle | Device handle. |
| value | Destination for the raw humidity value. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_InitConfig | ( | void * | handle, |
| HTS221_Init_st * | pxInit | ||
| ) |
Returns a HTS221_Init_st struct with the actual configuration.
| handle | Device handle. |
| pxInit | pointer to a HTS221_Init_st structure. This parameter is a pointer to HTS221_Init_st. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_IrqActiveLevel | ( | void * | handle, |
| HTS221_DrdyLevel_et * | status | ||
| ) |
Get level configuration of the interrupt pin DRDY.
| handle | Device handle. |
| status | Receives the active level selection. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_IrqEnable | ( | void * | handle, |
| HTS221_State_et * | status | ||
| ) |
Get the interrupt mode.
| handle | Device handle. |
| status | Receives the interrupt mode setting. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_IrqOutputType | ( | void * | handle, |
| HTS221_OutputType_et * | value | ||
| ) |
Get the configuration for the interrupt pin DRDY.
| handle | Device handle. |
| value | Receives the output type configuration. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_Measurement | ( | void * | handle, |
| uint16_t * | humidity, | ||
| int16_t * | temperature | ||
| ) |
Read HTS221 output registers, and calculate humidity and temperature.
| handle | Device handle. |
| humidity | pointer to the returned humidity value that must be divided by 10 to get the value in [%]. |
| temperature | pointer to the returned temperature value that must be divided by 10 to get the value in ['C]. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_Odr | ( | void * | handle, |
| HTS221_Odr_et * | odr | ||
| ) |
Get the output data rate mode.
| handle | Device handle. |
| odr | Receives the output data rate mode. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_PowerDownMode | ( | void * | handle, |
| HTS221_BitStatus_et * | status | ||
| ) |
Get if HTS221 is in active mode or in power down mode.
| handle | Device handle. |
| status | Receives the power-down bit value. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_RawMeasurement | ( | void * | handle, |
| int16_t * | humidity, | ||
| int16_t * | temperature | ||
| ) |
Read HTS221 output registers. Humidity and temperature.
| handle | Device handle. |
| humidity | pointer to the returned humidity raw value. |
| temperature | pointer to the returned temperature raw value. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Get_Temperature | ( | void * | handle, |
| int16_t * | value | ||
| ) |
Read the temperature output and convert it using the factory calibration.
| handle | Device handle. |
| value | Pointer to the temperature result in tenths of a degree Celsius. |
| HTS221_OK | on success, or HTS221_ERROR if a register read fails. |
| HTS221_Error_et HTS221_Get_TemperatureRaw | ( | void * | handle, |
| int16_t * | value | ||
| ) |
Read HTS221 temperature output registers.
| handle | Device handle. |
| value | Destination for the raw temperature value. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_IsMeasurementCompleted | ( | void * | handle, |
| HTS221_BitStatus_et * | Is_Measurement_Completed | ||
| ) |
Check if the single measurement has completed.
| handle | Device handle. |
| Is_Measurement_Completed | Receives whether the measurement is complete. |
| Status | [HTS221_ERROR, HTS221_OK] |
| HTS221_Error_et HTS221_MemoryBoot | ( | void * | handle | ) |
Reboot Memory Content.
| handle | Device handle. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_ReadReg | ( | void * | handle, |
| uint8_t | RegAddr, | ||
| uint16_t | NumByteToRead, | ||
| uint8_t * | Data | ||
| ) |
| HTS221_Error_et HTS221_Set_AvgH | ( | void * | handle, |
| HTS221_Avgh_et | avgh | ||
| ) |
Set humidity average mode.
| handle | Device handle. |
| avgh | is the average mode for humidity, this parameter is HTS221_Avgh_et. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Set_AvgHT | ( | void * | handle, |
| HTS221_Avgh_et | avgh, | ||
| HTS221_Avgt_et | avgt | ||
| ) |
Set_ humidity and temperature average mode.
| handle | Device handle. |
| avgh | is the average mode for humidity, this parameter is HTS221_Avgh_et. |
| avgt | is the average mode for temperature, this parameter is HTS221_Avgt_et. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Set_AvgT | ( | void * | handle, |
| HTS221_Avgt_et | avgt | ||
| ) |
Set temperature average mode.
| handle | Device handle. |
| avgt | is the average mode for temperature, this parameter is HTS221_Avgt_et. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Set_BduMode | ( | void * | handle, |
| HTS221_State_et | status | ||
| ) |
Set block data update mode.
| handle | Device handle. |
| status | HTS221_ENABLE holds output data until both bytes are read; HTS221_DISABLE allows continuous updates. This parameter is a HTS221_BitStatus_et. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Set_HeaterState | ( | void * | handle, |
| HTS221_State_et | status | ||
| ) |
Configure the internal heater.
| handle | Device handle. |
| status | Internal heater state [HTS221_ENABLE/HTS221_DISABLE]. This parameter is a HTS221_State_et. |
| Error | code [HTS221_OK, HTS221_ERROR] |
| HTS221_Error_et HTS221_Set_InitConfig | ( | void * | handle, |
| HTS221_Init_st * | pxInit | ||
| ) |
Initializes the HTS221 with the specified parameters in HTS221_Init_st struct.
| handle | Device handle. |
| pxInit | pointer to a HTS221_Init_st structure that contains the configuration. This parameter is a pointer to HTS221_Init_st. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Set_IrqActiveLevel | ( | void * | handle, |
| HTS221_DrdyLevel_et | status | ||
| ) |
Set level configuration of the interrupt pin DRDY.
| handle | Device handle. |
| status | Active level selection (HTS221_LOW_LVL or HTS221_HIGH_LVL). This parameter is a HTS221_DrdyLevel_et. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Set_IrqEnable | ( | void * | handle, |
| HTS221_State_et | status | ||
| ) |
Enable/disable the interrupt mode.
| handle | Device handle. |
| status | is the enable/disable for the interrupt mode. This parameter is a HTS221_State_et. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Set_IrqOutputType | ( | void * | handle, |
| HTS221_OutputType_et | value | ||
| ) |
Set Push-pull/open drain configuration for the interrupt pin DRDY.
| handle | Device handle. |
| value | is the output type configuration. This parameter is a HTS221_OutputType_et. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Set_Odr | ( | void * | handle, |
| HTS221_Odr_et | odr | ||
| ) |
Set the output data rate mode.
| handle | Device handle. |
| odr | Output data rate to set. This parameter is a HTS221_Odr_et. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_Set_PowerDownMode | ( | void * | handle, |
| HTS221_BitStatus_et | status | ||
| ) |
Enter or exit from power down mode.
| handle | Device handle. |
| status | Set HTS221_SET for power-down mode or HTS221_RESET for active mode. This parameter is a HTS221_BitStatus_et. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| 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.
| handle | Device handle. |
| Error | code [HTS221_OK, HTS221_ERROR]. |
| HTS221_Error_et HTS221_WriteReg | ( | void * | handle, |
| uint8_t | RegAddr, | ||
| uint16_t | NumByteToWrite, | ||
| uint8_t * | Data | ||
| ) |