Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
humid_sht.c File Reference

SHTxx sensor interface. More...

#include "std.h"
#include "LPC21xx.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "subsystems/datalink/downlink.h"
#include "humid_sht.h"
#include "led.h"
+ Include dependency graph for humid_sht.c:

Go to the source code of this file.

Macros

#define DOWNLINK_DEVICE   DOWNLINK_AP_DEVICE
 

Functions

uint8_t s_write_byte (uint8_t value)
 
uint8_t s_read_byte (uint8_t ack)
 
void s_transstart (void)
 
void s_connectionreset (void)
 
uint8_t s_read_statusreg (uint8_t *p_value, uint8_t *p_checksum)
 
uint8_t s_write_statusreg (uint8_t *p_value)
 
uint8_t s_measure (uint16_t *p_value, uint8_t *p_checksum, uint8_t mode)
 
uint8_t s_start_measure (uint8_t mode)
 
uint8_t s_read_measure (uint16_t *p_value, uint8_t *p_checksum)
 
void calc_sht (uint16_t hum, uint16_t tem, float *fhum, float *ftem)
 
uint8_t humid_sht_reset (void)
 
void humid_sht_init (void)
 
void humid_sht_periodic (void)
 

Variables

uint16_t humidsht
 
uint16_t tempsht
 
float fhumidsht
 
float ftempsht
 
bool_t humid_sht_available
 
uint8_t humid_sht_status
 

Detailed Description

SHTxx sensor interface.

This reads the values for humidity and temperature from the SHTxx sensor through bit banging.

Definition in file humid_sht.c.

Macro Definition Documentation

#define DOWNLINK_DEVICE   DOWNLINK_AP_DEVICE

Definition at line 19 of file humid_sht.c.

Function Documentation

void calc_sht ( uint16_t  hum,
uint16_t  tem,
float *  fhum,
float *  ftem 
)

Definition at line 196 of file humid_sht.c.

References C1, and C2.

Referenced by humid_sht_periodic().

+ Here is the caller graph for this function:

void humid_sht_init ( void  )
void humid_sht_periodic ( void  )
uint8_t humid_sht_reset ( void  )

Definition at line 227 of file humid_sht.c.

References RESET, s_connectionreset(), and s_write_byte().

+ Here is the call graph for this function:

void s_connectionreset ( void  )

Definition at line 105 of file humid_sht.c.

References DATA_SET, s_transstart(), SCK_CLR, and SCK_SET.

Referenced by humid_sht_periodic(), and humid_sht_reset().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8_t s_measure ( uint16_t p_value,
uint8_t p_checksum,
uint8_t  mode 
)

Definition at line 147 of file humid_sht.c.

References ACK, DATA_IN, HUMI, MEASURE_HUMI, MEASURE_TEMP, noACK, s_read_byte(), s_transstart(), s_write_byte(), and TEMP.

+ Here is the call graph for this function:

uint8_t s_read_byte ( uint8_t  ack)

Definition at line 61 of file humid_sht.c.

References DATA_CLR, DATA_IN, DATA_SET, SCK_CLR, SCK_SET, and val.

Referenced by s_measure(), s_read_measure(), and s_read_statusreg().

+ Here is the caller graph for this function:

uint8_t s_read_measure ( uint16_t p_value,
uint8_t p_checksum 
)

Definition at line 183 of file humid_sht.c.

References ACK, DATA_IN, noACK, and s_read_byte().

Referenced by humid_sht_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8_t s_read_statusreg ( uint8_t p_value,
uint8_t p_checksum 
)

Definition at line 124 of file humid_sht.c.

References ACK, noACK, s_read_byte(), s_transstart(), s_write_byte(), and STATUS_REG_R.

+ Here is the call graph for this function:

uint8_t s_start_measure ( uint8_t  mode)

Definition at line 168 of file humid_sht.c.

References HUMI, MEASURE_HUMI, MEASURE_TEMP, s_transstart(), s_write_byte(), and TEMP.

Referenced by humid_sht_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void s_transstart ( void  )

Definition at line 82 of file humid_sht.c.

References DATA_CLR, DATA_SET, SCK_CLR, and SCK_SET.

Referenced by s_connectionreset(), s_measure(), s_read_statusreg(), s_start_measure(), and s_write_statusreg().

+ Here is the caller graph for this function:

uint8_t s_write_byte ( uint8_t  value)

Definition at line 40 of file humid_sht.c.

References DATA_CLR, DATA_IN, DATA_SET, SCK_CLR, and SCK_SET.

Referenced by humid_sht_reset(), s_measure(), s_read_statusreg(), s_start_measure(), and s_write_statusreg().

+ Here is the caller graph for this function:

uint8_t s_write_statusreg ( uint8_t p_value)

Definition at line 136 of file humid_sht.c.

References s_transstart(), s_write_byte(), and STATUS_REG_W.

+ Here is the call graph for this function:

Variable Documentation

float fhumidsht

Definition at line 23 of file humid_sht.c.

Referenced by humid_sht_periodic().

float ftempsht

Definition at line 23 of file humid_sht.c.

Referenced by humid_hih_periodic(), and humid_sht_periodic().

bool_t humid_sht_available

Definition at line 24 of file humid_sht.c.

Referenced by humid_sht_init(), and humid_sht_periodic().

uint8_t humid_sht_status

Definition at line 25 of file humid_sht.c.

Referenced by humid_sht_init(), and humid_sht_periodic().

uint16_t humidsht

Definition at line 22 of file humid_sht.c.

Referenced by humid_sht_periodic().

uint16_t tempsht

Definition at line 22 of file humid_sht.c.

Referenced by humid_sht_periodic().