dht22 2.0.0.0
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_RESP_NOT_READY   0
 
#define DHT22_RESP_READY   1
 
#define DHT22_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  dht22_sda_sel_t { DHT22_SDA_SEL_SDA1 , DHT22_SDA_SEL_SDA2 }
 DHT22 Click data pin selector. More...
 
enum  dht22_return_value_t { DHT22_OK = 0 , DHT22_ERROR = -1 }
 DHT22 Click return value data. More...
 

Functions

void dht22_cfg_setup (dht22_cfg_t *cfg)
 DHT22 configuration object setup function.
 
err_t dht22_init (dht22_t *ctx, dht22_cfg_t *cfg)
 DHT22 initialization function.
 
err_t dht22_start_signal (dht22_t *ctx)
 DHT22 sends start signal to the sensor function.
 
err_t dht22_check_sensor_response (dht22_t *ctx)
 DHT22 release the bus to wait the sensor response signal function.
 
err_t dht22_get_sensor_data (dht22_t *ctx, uint16_t *hum_data, uint16_t *temp_data)
 DHT22 reading data from the sensor function.
 
err_t dht22_get_measurement_data (dht22_t *ctx, float *humidity, float *temperature)
 DHT22 get measurement data from the sensor function.
 
err_t dht22_init_sda_input (dht22_t *ctx)
 DHT22 init SDA data pin as input function.
 
err_t dht22_init_sda_output (dht22_t *ctx)
 DHT22 init SDA data pin as output function.
 

Detailed Description

This file contains API for DHT22 Click Driver.

Enumeration Type Documentation

◆ dht22_return_value_t

DHT22 Click return value data.

Predefined enum values for driver return values.

Enumerator
DHT22_OK 
DHT22_ERROR 

◆ dht22_sda_sel_t

DHT22 Click data pin selector.

Predefined enum values for data pin selector.

Enumerator
DHT22_SDA_SEL_SDA1 
DHT22_SDA_SEL_SDA2