HTS221
Arduino library for the HTS221 humidity and temperature sensor
Loading...
Searching...
No Matches
HTS221_Driver.c File Reference

HTS221 driver file. More...

#include "HTS221_Driver.h"
#include <stdio.h>
Include dependency graph for HTS221_Driver.c:

Functions

uint8_t HTS221_IO_Write (void *handle, uint8_t WriteAddr, uint8_t *pBuffer, uint16_t nBytesToWrite)
 Write bytes to the HTS221 over its configured I2C interface.
 
uint8_t HTS221_IO_Read (void *handle, uint8_t ReadAddr, uint8_t *pBuffer, uint16_t nBytesToRead)
 Read bytes from the HTS221 over its configured I2C interface.
 
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_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_Temperature (void *handle, int16_t *value)
 Read the temperature output and convert it using the factory calibration.
 
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). 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.
 
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.
 

Detailed Description

HTS221 driver file.

Author
HESA Application Team
Version
V1.1
Date
10-August-2016
Attention

© COPYRIGHT(c) 2017 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.