Firmware Library for X-NUCLEO-IKS01A1 (MEMS Inertial & Environmental Sensors) Expansion Board

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   MultiTech_Dragonfly_2015_ATT_Gov_Solutions_Hackathon_Example HelloWorld_IKS01A1 LoRaWAN-test-10secs ServoMotorDemo ... more

Fork of X_NUCLEO_IKS01A1 by ST Expansion SW Team

Embed: (wiki syntax)

« Back to documentation index

HTS221 Class Reference

Class representing a HTS221 sensor component. More...

#include <hts221_class.h>

Public Member Functions

 HTS221 (DevI2C &i2c)
 Constructor.
virtual ~HTS221 ()
 Destructor.
virtual int PowerOff (void)
 Enter sensor shutdown mode.
virtual int Reset (void)
 Reset sensor.

Protected Member Functions

HUM_TEMP_StatusTypeDef HTS221_Init (HUM_TEMP_InitTypeDef *HTS221_Init)
 Set HTS221 Initialization.
HUM_TEMP_StatusTypeDef HTS221_Power_OFF (void)
 Enter the shutdown mode for HTS221.
HUM_TEMP_StatusTypeDef HTS221_ReadID (uint8_t *ht_id)
 Read ID address of HTS221.
HUM_TEMP_StatusTypeDef HTS221_RebootCmd (void)
 Reboot memory content of HTS221.
HUM_TEMP_StatusTypeDef HTS221_GetHumidity (float *pfData)
 Read HTS221 output register, and calculate the humidity.
HUM_TEMP_StatusTypeDef HTS221_GetTemperature (float *pfData)
 Read HTS221 output register, and calculate the temperature.
HUM_TEMP_StatusTypeDef HTS221_Power_On (void)
 Exit the shutdown mode for HTS221.
HUM_TEMP_StatusTypeDef HTS221_Calibration (void)
 HTS221 Calibration procedure.
void HTS221_IO_ITConfig (void)
 Configures HTS221 interrupt lines for NUCLEO boards.
HUM_TEMP_StatusTypeDef HTS221_IO_Init (void)
 Configures HTS221 I2C interface.
HUM_TEMP_StatusTypeDef HTS221_IO_Read (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToRead)
 Utility function to read data from HTS221.
HUM_TEMP_StatusTypeDef HTS221_IO_Write (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToWrite)
 Utility function to write data to HTS221.

Detailed Description

Class representing a HTS221 sensor component.

Definition at line 51 of file hts221_class.h.


Constructor & Destructor Documentation

HTS221 ( DevI2C &  i2c )

Constructor.

Parameters:
[in]i2cdevice I2C to be used for communication

Definition at line 56 of file hts221_class.h.

virtual ~HTS221 (  ) [virtual]

Destructor.

Definition at line 63 of file hts221_class.h.


Member Function Documentation

HUM_TEMP_StatusTypeDef HTS221_Calibration ( void   ) [protected]

HTS221 Calibration procedure.

Return values:
HUM_TEMP_OKin case of success, an error code otherwise

Definition at line 52 of file hts221_class.cpp.

HUM_TEMP_StatusTypeDef HTS221_GetHumidity ( float *  pfData ) [protected]

Read HTS221 output register, and calculate the humidity.

Parameters:
pfDatathe pointer to data output
Return values:
HUM_TEMP_OKin case of success, an error code otherwise

Definition at line 232 of file hts221_class.cpp.

HUM_TEMP_StatusTypeDef HTS221_GetTemperature ( float *  pfData ) [protected]

Read HTS221 output register, and calculate the temperature.

Parameters:
pfDatathe pointer to data output
Return values:
HUM_TEMP_OKin case of success, an error code otherwise

Definition at line 302 of file hts221_class.cpp.

HUM_TEMP_StatusTypeDef HTS221_Init ( HUM_TEMP_InitTypeDef HTS221_Init ) [protected]

Set HTS221 Initialization.

Parameters:
HTS221_Initthe configuration setting for the HTS221
Return values:
HUM_TEMP_OKin case of success, an error code otherwise

Definition at line 146 of file hts221_class.cpp.

HUM_TEMP_StatusTypeDef HTS221_IO_Init ( void   ) [protected]

Configures HTS221 I2C interface.

Returns:
HUM_TEMP_OK in case of success, an error code otherwise

Definition at line 122 of file hts221_class.h.

void HTS221_IO_ITConfig ( void   ) [protected]

Configures HTS221 interrupt lines for NUCLEO boards.

Definition at line 113 of file hts221_class.h.

HUM_TEMP_StatusTypeDef HTS221_IO_Read ( uint8_t *  pBuffer,
uint8_t  RegisterAddr,
uint16_t  NumByteToRead 
) [protected]

Utility function to read data from HTS221.

Parameters:
[out]pBufferpointer to the byte-array to read data in to
[in]RegisterAddrspecifies internal address register to read from.
[in]NumByteToReadnumber of bytes to be read.
Return values:
HUM_TEMP_OKif ok,
HUM_TEMP_ERRORif an I2C error has occured

Definition at line 135 of file hts221_class.h.

HUM_TEMP_StatusTypeDef HTS221_IO_Write ( uint8_t *  pBuffer,
uint8_t  RegisterAddr,
uint16_t  NumByteToWrite 
) [protected]

Utility function to write data to HTS221.

Parameters:
[in]pBufferpointer to the byte-array data to send
[in]RegisterAddrspecifies internal address register to read from.
[in]NumByteToWritenumber of bytes to write.
Return values:
HUM_TEMP_OKif ok,
HUM_TEMP_ERRORif an I2C error has occured

Definition at line 156 of file hts221_class.h.

HUM_TEMP_StatusTypeDef HTS221_Power_OFF ( void   ) [protected]

Enter the shutdown mode for HTS221.

Return values:
HUM_TEMP_OKin case of success, an error code otherwise

Definition at line 393 of file hts221_class.cpp.

HUM_TEMP_StatusTypeDef HTS221_Power_On ( void   ) [protected]

Exit the shutdown mode for HTS221.

Return values:
HUM_TEMP_OKin case of success, an error code otherwise

Definition at line 367 of file hts221_class.cpp.

HUM_TEMP_StatusTypeDef HTS221_ReadID ( uint8_t *  ht_id ) [protected]

Read ID address of HTS221.

Parameters:
ht_idthe pointer where the ID of the device is stored
Return values:
HUM_TEMP_OKin case of success, an error code otherwise

Definition at line 190 of file hts221_class.cpp.

HUM_TEMP_StatusTypeDef HTS221_RebootCmd ( void   ) [protected]

Reboot memory content of HTS221.

Return values:
HUM_TEMP_OKin case of success, an error code otherwise

Definition at line 204 of file hts221_class.cpp.

virtual int PowerOff ( void   ) [virtual]

Enter sensor shutdown mode.

Returns:
0 in case of success, an error code otherwise

Definition at line 74 of file hts221_class.h.

virtual int Reset ( void   ) [virtual]

Reset sensor.

Returns:
0 in case of success, an error code otherwise

Definition at line 86 of file hts221_class.h.