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.
Fork of ReferredCoursework2016 by
HTS221 Class Reference
Class representing a HTS221 sensor component. More...
#include <hts221_class.h>
Inherits HumiditySensor, and TempSensor.
Public Member Functions | |
HTS221 (DevI2C &i2c) | |
Constructor. | |
virtual | ~HTS221 () |
Destructor. | |
virtual int | Init (void *init_struct) |
Initialization of sensor. | |
virtual int | PowerOff (void) |
Enter sensor shutdown mode. | |
virtual int | ReadID (uint8_t *ht_id) |
Get ID of sensor. | |
virtual int | Reset (void) |
Reset sensor. | |
virtual int | GetHumidity (float *pfData) |
Get current humidity [%]. | |
virtual int | GetTemperature (float *pfData) |
Get current temperature in degrees Celsius [°C]. | |
virtual int | GetFahrenheit (float *pfData) |
Get current temperature in degrees Fahrenheit [°F]. | |
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
virtual int GetFahrenheit | ( | float * | pfData ) | [virtual, inherited] |
Get current temperature in degrees Fahrenheit [°F].
- Parameters:
-
[out] pfData Pointer to where to store temperature to
- Returns:
- 0 in case of success, an error code otherwise
Definition at line 64 of file TempSensor.h.
virtual int GetHumidity | ( | float * | pfData ) | [virtual] |
Get current humidity [%].
- Parameters:
-
[out] pfData Pointer to where to store humidity to
- Returns:
- 0 in case of success, an error code otherwise
Implements HumiditySensor.
Definition at line 90 of file hts221_class.h.
virtual int GetTemperature | ( | float * | pfData ) | [virtual] |
Get current temperature in degrees Celsius [°C].
- Parameters:
-
[out] pfData Pointer to where to store temperature to
- Returns:
- 0 in case of success, an error code otherwise
Implements TempSensor.
Definition at line 94 of file hts221_class.h.
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 Init | ( | void * | ptr ) | [virtual] |
Initialization of sensor.
- Parameters:
-
[out] ptr Pointer to device specific initalization structure
- Returns:
- 0 in case of success, an error code otherwise
Implements GenericSensor.
Definition at line 66 of file hts221_class.h.
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 ReadID | ( | uint8_t * | id ) | [virtual] |
Get ID of sensor.
- Parameters:
-
[out] id Pointer to where to store the ID to
- Returns:
- 0 in case of success, an error code otherwise
Implements GenericSensor.
Definition at line 78 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 Sat Jul 16 2022 05:47:22 by
