Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
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.

Referenced by humid_sht_thd().

◆ SHT2_TRIGGER_HUMID

#define SHT2_TRIGGER_HUMID   0xF5

Definition at line 43 of file humid_sht_i2c.c.

Referenced by sht_read_humid().

◆ SHT2_TRIGGER_TEMP

#define SHT2_TRIGGER_TEMP   0xF3

Definition at line 42 of file humid_sht_i2c.c.

Referenced by sht_read_temp().

◆ 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.

Referenced by humid_sht_thd(), sht_read_humid(), sht_read_serial(), and sht_read_temp().

◆ SHT_SLAVE_ADDR

#define SHT_SLAVE_ADDR   0x80

Definition at line 38 of file humid_sht_i2c.c.

Referenced by humid_sht_thd(), sht_read_humid(), sht_read_serial(), and sht_read_temp().

Function Documentation

◆ humid_sht_crc()

int8_t humid_sht_crc ( volatile uint8_t * data)
static

Definition at line 179 of file humid_sht_i2c.c.

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 )

Definition at line 57 of file humid_sht_i2c.c.

References humid_sht_thd(), pprz_bsem_init(), PPRZ_NORMAL_PRIO, pprz_thread_create(), sht, and SHT2_UNINIT.

Here is the call graph for this function:

◆ humid_sht_periodic_i2c()

void humid_sht_periodic_i2c ( void )

Definition at line 64 of file humid_sht_i2c.c.

References DefaultChannel, DefaultDevice, pprz_bsem_wait_timeout(), sht, and SHT2_READING.

Here is the call graph for this function:

◆ humid_sht_thd()

void humid_sht_thd ( void * arg)
static

Definition at line 77 of file humid_sht_i2c.c.

References i2c_blocking_transmit(), I2CTransSuccess, pprz_bsem_signal(), sht, SHT2_READING, SHT2_SOFT_RESET, SHT_I2C_DEV, sht_read_humid(), sht_read_serial(), sht_read_temp(), SHT_SLAVE_ADDR, and sys_time_usleep().

Referenced by humid_sht_init_i2c().

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

◆ sht_read_humid()

int sht_read_humid ( struct sht_humid_t * sht)
static

Definition at line 158 of file humid_sht_i2c.c.

References humid_sht_crc(), i2c_blocking_receive(), i2c_blocking_transmit(), I2CTransSuccess, sht, SHT2_TRIGGER_HUMID, SHT_I2C_DEV, SHT_SLAVE_ADDR, 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_serial()

void sht_read_serial ( struct sht_humid_t * sht)
static

Definition at line 105 of file humid_sht_i2c.c.

References i2c_blocking_transceive(), I2CTransSuccess, sht, SHT_I2C_DEV, SHT_SLAVE_ADDR, 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()

int sht_read_temp ( struct sht_humid_t * sht)
static

Definition at line 136 of file humid_sht_i2c.c.

References humid_sht_crc(), i2c_blocking_receive(), i2c_blocking_transmit(), I2CTransSuccess, sht, SHT2_TRIGGER_TEMP, SHT_I2C_DEV, SHT_SLAVE_ADDR, 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:

Variable Documentation

◆ sht