dht22  2.0.0.0
Data Structures | Macros | Enumerations | Functions
dht22.h File Reference

This file contains API for DHT22 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"

Go to the source code of this file.

Data Structures

struct  dht22_t
 Click ctx object definition. More...
 
struct  dht22_cfg_t
 Click configuration structure definition. More...
 

Macros

#define DHT22_MAP_MIKROBUS(cfg, mikrobus)
 
#define DHT22_OK   0
 
#define DHT22_ERROR   (-1)
 
#define DHT22_RESP_NOT_READY   0
 
#define DHT22_RESP_READY   1
 

Enumerations

enum  dht22_sda_sel_t { DHT22_SDA_SEL_SDA1, DHT22_SDA_SEL_SDA2 }
 Click data pin selector. More...
 

Functions

void dht22_cfg_setup (dht22_cfg_t *cfg)
 Config Object Initialization function. More...
 
err_t dht22_init (dht22_t *ctx, dht22_cfg_t *cfg)
 Initialization function. More...
 
err_t dht22_start_signal (dht22_t *ctx)
 Sends start signal to the sensor function. More...
 
err_t dht22_check_sensor_response (dht22_t *ctx, uint8_t *check_out)
 Release the bus to wait the sensor response signal function. More...
 
err_t dht22_get_sensor_data (dht22_t *ctx, uint32_t *data_out)
 Reading data from the sensor function. More...
 
uint16_t dht22_get_temperature (dht22_t *ctx, uint32_t sensor_data)
 Get the temperature data function. More...
 
float dht22_calculate_temperature (dht22_t *ctx, uint32_t sensor_data)
 Calculate the temperature in degrees Celsius function. More...
 
uint16_t dht22_get_humidity (dht22_t *ctx, uint32_t sensor_data)
 Get the humidity data function. More...
 
float dht22_calculate_humidity (dht22_t *ctx, uint32_t sensor_data)
 Calculate the humidity in percentage function. More...
 
err_t dht22_init_sda_input (dht22_t *ctx)
 Init SDA data pin as input. More...
 
err_t dht22_init_sda_output (dht22_t *ctx)
 Init SDA data pin as output. More...
 

Detailed Description

This file contains API for DHT22 Click driver.