Contiki-NG
Files

Driver for the DHT22 temperature and humidity sensor. More...

Files

file  dht22.c
 Driver for the DHT22 temperature and humidity sensor.
 
file  dht22.h
 Header file for the DHT22 temperature and humidity sensor.
 

DHT22 default pin and port

#define DHT22_PIN   5
 
#define DHT22_PORT   GPIO_A_NUM
 

DHT22 available commands

#define DHT22_READ_TEMP   0x01
 
#define DHT22_READ_HUM   0x02
 
#define DHT22_READ_ALL   0x03
 

DHT22 return types

#define DHT22_ERROR   (-1)
 
#define DHT22_SUCCESS   0x00
 
#define DHT22_BUSY   0xFF
 

DHT22 constants

#define DHT22_BUFFER   5
 Buffer to store the samples.
 
#define DHT22_COUNT   8
 Minimum ticks to detect a "1" bit.
 
#define DHT22_MAX_TIMMING   85
 Maximum ticks in a single operation.
 
#define DHT22_READING_DELAY   1
 1 us
 
#define DHT22_READY_TIME   40
 40 us
 
#define DHT22_START_TIME   (RTIMER_SECOND / 50)
 20 ms
 
#define DHT22_AWAKE_TIME   (RTIMER_SECOND / 4)
 250 ms
 

DHT22 auxiliary functions

int16_t dht22_read_all (int16_t *temperature, int16_t *humidity)
 

Detailed Description

Driver for the DHT22 temperature and humidity sensor.