Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
humid_sht_i2c.c File Reference

Sensirion SHT25 humidity/temperature sensor interface. More...

#include "modules/meteo/humid_sht_i2c.h"
#include "pprzlink/messages.h"
#include "modules/datalink/downlink.h"
+ Include dependency graph for humid_sht_i2c.c:

Go to the source code of this file.

Macros

#define SHT_I2C_DEV   i2c0
 
#define SHT_SLAVE_ADDR   0x80
 
#define SHT2_WRITE_USER   0xE6
 
#define SHT2_READ_USER   0xE7
 
#define SHT2_TRIGGER_TEMP   0xF3
 
#define SHT2_TRIGGER_HUMID   0xF5
 
#define SHT2_SOFT_RESET   0xFE
 

Functions

static void humid_sht_thd (void *arg)
 
static void sht_read_serial (struct sht_humid_t *sht)
 
static int sht_read_temp (struct sht_humid_t *sht)
 
static int sht_read_humid (struct sht_humid_t *sht)
 
static int8_t humid_sht_crc (volatile uint8_t *data)
 
void humid_sht_init_i2c (void)
 
void humid_sht_periodic_i2c (void)
 

Variables

static struct sht_humid_t sht
 

Detailed Description

Sensirion SHT25 humidity/temperature sensor interface.

Definition in file humid_sht_i2c.c.

Macro Definition Documentation

◆ SHT2_READ_USER

#define SHT2_READ_USER   0xE7

Definition at line 41 of file humid_sht_i2c.c.

◆ SHT2_SOFT_RESET

#define SHT2_SOFT_RESET   0xFE

Definition at line 44 of file humid_sht_i2c.c.

◆ SHT2_TRIGGER_HUMID

#define SHT2_TRIGGER_HUMID   0xF5

Definition at line 43 of file humid_sht_i2c.c.

◆ SHT2_TRIGGER_TEMP

#define SHT2_TRIGGER_TEMP   0xF3

Definition at line 42 of file humid_sht_i2c.c.

◆ SHT2_WRITE_USER

#define SHT2_WRITE_USER   0xE6

Definition at line 40 of file humid_sht_i2c.c.

◆ SHT_I2C_DEV

#define SHT_I2C_DEV   i2c0

Definition at line 35 of file humid_sht_i2c.c.

◆ SHT_SLAVE_ADDR

#define SHT_SLAVE_ADDR   0x80

Definition at line 38 of file humid_sht_i2c.c.

Function Documentation

◆ humid_sht_crc()

static int8_t humid_sht_crc ( volatile uint8_t data)
static

Definition at line 179 of file humid_sht_i2c.c.

References foo.

Referenced by sht_read_humid(), and sht_read_temp().

+ Here is the caller graph for this function:

◆ humid_sht_init_i2c()

void humid_sht_init_i2c ( void  )

◆ humid_sht_periodic_i2c()

◆ humid_sht_thd()

static void humid_sht_thd ( void arg)
static

◆ sht_read_humid()

static int sht_read_humid ( struct sht_humid_t sht)
static

◆ sht_read_serial()

static void sht_read_serial ( struct sht_humid_t sht)
static

Definition at line 105 of file humid_sht_i2c.c.

References i2c_transaction::buf, foo, i2c_blocking_transceive(), I2CTransSuccess, sht, SHT_I2C_DEV, sht_humid_t::sht_serial1, sht_humid_t::sht_serial2, SHT_SLAVE_ADDR, sht_humid_t::sht_trans, and sys_time_usleep().

Referenced by humid_sht_thd().

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

◆ sht_read_temp()

static int sht_read_temp ( struct sht_humid_t sht)
static

Definition at line 136 of file humid_sht_i2c.c.

References i2c_transaction::buf, sht_humid_t::ftempsht_i2c, humid_sht_crc(), i2c_blocking_receive(), i2c_blocking_transmit(), I2CTransSuccess, sht, SHT2_TRIGGER_TEMP, SHT_I2C_DEV, SHT_SLAVE_ADDR, sht_humid_t::sht_trans, sys_time_usleep(), and sht_humid_t::tempsht_i2c.

Referenced by humid_sht_thd().

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

Variable Documentation

◆ sht