Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Fork of X_NUCLEO_IKS01A1 by
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] i2c device 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_OK in 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:
- 
  pfData the pointer to data output 
- Return values:
- 
  HUM_TEMP_OK in 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:
- 
  pfData the pointer to data output 
- Return values:
- 
  HUM_TEMP_OK in 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_Init the configuration setting for the HTS221 
- Return values:
- 
  HUM_TEMP_OK in 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] pBuffer pointer to the byte-array to read data in to [in] RegisterAddr specifies internal address register to read from. [in] NumByteToRead number of bytes to be read. 
- Return values:
- 
  HUM_TEMP_OK if ok, HUM_TEMP_ERROR if 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] pBuffer pointer to the byte-array data to send [in] RegisterAddr specifies internal address register to read from. [in] NumByteToWrite number of bytes to write. 
- Return values:
- 
  HUM_TEMP_OK if ok, HUM_TEMP_ERROR if 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_OK in 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_OK in 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_id the pointer where the ID of the device is stored 
- Return values:
- 
  HUM_TEMP_OK in 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_OK in 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.
Generated on Thu Jul 14 2022 01:14:01 by
 1.7.2
 1.7.2 
    