L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
Loading...
Searching...
No Matches
tmphm_sht45.h File Reference
#include "mysensors_def.h"
#include "stm32wlxx_hal.h"
Include dependency graph for tmphm_sht45.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tmphm_sht45_t
 Measurement data produced by the SHT45 temperature and humidity sensor. Populate by calling tmphm_sht45_Read(); check IsDataValid before using Temperature or Humidity. More...

Functions

int8_t tmphm_sht45_Is (I2C_HandleTypeDef *hi2c, int8_t tryInit)
 
  • check if tempHum sensor is present

HAL_StatusTypeDef tmphm_sht45_IsOn (I2C_HandleTypeDef *hi2c, uint8_t *onOff)
 get state - sensor does not have on/off state - only for compatibility with others
HAL_StatusTypeDef tmphm_sht45_On (I2C_HandleTypeDef *hi2c)
 Zapnutie sensora dummy.
HAL_StatusTypeDef tmphm_sht45_Off (I2C_HandleTypeDef *hi2c)
 turn off sensor - dummy
HAL_StatusTypeDef tmphm_sht45_Init (I2C_HandleTypeDef *hi2c)
 
  • initialization, check if sensor is present or not. Checks main (0x44) and alternative address (0x45) If sensor is present, fnc tempHum_Is() returns 1

HAL_StatusTypeDef tmphm_sht45_Read (I2C_HandleTypeDef *hi2c)
 
  • read temperature and humidity from sensor, values are in _tempHumData

void tmphm_sht45_LogData (char *buf)
 log data to buffer

Variables

tmphm_sht45_t _tmphm_sht45Data
 Live measurement data from the SHT45 sensor; updated by tmphm_sht45_Read().
tmphm_sht45_t _bck_tmphm_sht45Data
 Snapshot copy of the last completed SHT45 measurement; used for LoRaWAN transmission.

Function Documentation

◆ tmphm_sht45_Init()

HAL_StatusTypeDef tmphm_sht45_Init ( I2C_HandleTypeDef * hi2c)

  • initialization, check if sensor is present or not. Checks main (0x44) and alternative address (0x45) If sensor is present, fnc tempHum_Is() returns 1

Return values
-HAL_OK - sensor was found, HAL_ERROR - sensor is not present

Definition at line 76 of file tmphm_sht45.c.

References _isTempHumSensor, _tempHumAddr, and I2C_IsDeviceReadyMT().

Referenced by tmphm_sht45_Is().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tmphm_sht45_Is()

int8_t tmphm_sht45_Is ( I2C_HandleTypeDef * hi2c,
int8_t tryInit )

  • check if tempHum sensor is present

Parameters
tryInit- in case sensor is not yet initialized, 1 - attempt to initialize again, 0 - no
Return values
1- is present, 0 - is not

Definition at line 40 of file tmphm_sht45.c.

References _isTempHumSensor, and tmphm_sht45_Init().

Here is the call graph for this function:

◆ tmphm_sht45_IsOn()

HAL_StatusTypeDef tmphm_sht45_IsOn ( I2C_HandleTypeDef * hi2c,
uint8_t * onOff )

get state - sensor does not have on/off state - only for compatibility with others

Definition at line 47 of file tmphm_sht45.c.

References _isOnOff, and _isTempHumSensor.

◆ tmphm_sht45_LogData()

void tmphm_sht45_LogData ( char * buf)

log data to buffer

Definition at line 166 of file tmphm_sht45.c.

References _tmphm_sht45Data, PRIf_02, and PRIf_02D.

◆ tmphm_sht45_Off()

HAL_StatusTypeDef tmphm_sht45_Off ( I2C_HandleTypeDef * hi2c)

turn off sensor - dummy

Definition at line 70 of file tmphm_sht45.c.

References tempHum_onOff().

Here is the call graph for this function:

◆ tmphm_sht45_On()

HAL_StatusTypeDef tmphm_sht45_On ( I2C_HandleTypeDef * hi2c)

Zapnutie sensora dummy.

Definition at line 57 of file tmphm_sht45.c.

References _memsMainBlock, _tmphm_sht45Data, mems_WriteMainBlock(), and tempHum_onOff().

Here is the call graph for this function:

◆ tmphm_sht45_Read()

HAL_StatusTypeDef tmphm_sht45_Read ( I2C_HandleTypeDef * hi2c)

  • read temperature and humidity from sensor, values are in _tempHumData

Returns
- HAL_OK, HAL_ERROR, HAL_TIMEOUT - if sensor is off

Definition at line 110 of file tmphm_sht45.c.

References _isOnOff, _isTempHumSensor, _tempHumAddr, _tmphm_sht45Data, HAL_Delay(), and tempHum_CheckCrc().

Here is the call graph for this function:

Variable Documentation

◆ _bck_tmphm_sht45Data

tmphm_sht45_t _bck_tmphm_sht45Data
extern

Snapshot copy of the last completed SHT45 measurement; used for LoRaWAN transmission.

Definition at line 28 of file tmphm_sht45.c.

Referenced by sensors_CayennelFromBckData(), sensors_CopyToBck(), sensors_ReadToBckFromDataBlock(), and sensors_WriteFromBckToDataBlock().

◆ _tmphm_sht45Data

tmphm_sht45_t _tmphm_sht45Data
extern

Live measurement data from the SHT45 sensor; updated by tmphm_sht45_Read().

Definition at line 27 of file tmphm_sht45.c.

Referenced by bar_bmp585_Read(), bar_ils22qs_Read(), sensors_CopyToBck(), tmphm_sht45_LogData(), tmphm_sht45_On(), and tmphm_sht45_Read().