DHT11.h 684 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef __DHT11_H
  2. #define __DHT11_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include "iot_gpio.h"
  7. #include "iot_gpio_ex.h"
  8. #include <stdint.h>
  9. #define DHT11_DQ_GPIO 13
  10. #define DHT11_DQ_OUT_OFF IoTGpioSetOutputVal(DHT11_DQ_GPIO, 0);
  11. #define DHT11_DQ_OUT_ON IoTGpioSetOutputVal(DHT11_DQ_GPIO, 1);
  12. uint8_t DHT11_Read_Data(uint8_t *temperature,uint8_t *humidity); //Read DHT11 Value
  13. uint8_t DHT11_Read_Byte(void);//Read One Byte
  14. uint8_t DHT11_Read_Bit(void);//Read One Bit
  15. uint8_t DHT11_Check(void);//Chack DHT11
  16. void DHT11_Rst(void);//Reset DHT11
  17. #ifdef __cplusplus
  18. }
  19. #endif
  20. #endif /*__ GPIO_H__ */