-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdht11.h
More file actions
29 lines (26 loc) · 720 Bytes
/
Copy pathdht11.h
File metadata and controls
29 lines (26 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef __DHT11_H__
#define __DHT11_H__
#include "stdbool.h"
//#include "stdio.h"
#include "stm32f10x_gpio.h"
#include "stm32f10x_rcc.h"
#include "stm32f10x_tim.h"
#include "stm32f10x_exti.h"
#include "stm32f10x_misc.h"
typedef enum {
DHT11_NONE = 0,
DHT11_INIT_PULL_DOWN =1,
DHT11_INIT_RELEASE = 2,
DHT11_PULL_DOWN = 3,
DHT11_RELEASE_1 = 4,
DHT11_RELEASE_0 = 5,
DHT11_EOT,
} dht11_state;
void dht11_init(GPIO_TypeDef *gpio_, u16 pin_, u8 source_pin_, TIM_TypeDef *timer_);
void dht11_trigger_state_machine(u32 timer, u8 bit);
bool dht11_reset_pulse();
//bool dht11_check_tolerance(u32 timer);
void dht11_decode_data();
u8 dht11_get_temperature();
u8 dht11_get_rh();
#endif //__DHT11_H__