Subversion Repositories HomeAutomation

Rev

Rev 1895 | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. #ifndef _DHT11wire_h_
  2. #define _DHT11wire_h_
  3.  
  4. #include <inttypes.h>
  5. #include <drivers/mcu/gpio.h>
  6. #include <drivers/can/canprintf.h>
  7. #include "config.h"
  8. /*******************************************/
  9. /* Hardware connection                     */
  10. /*******************************************/
  11.  
  12. #if DHT11_NUM_SENSORS==1
  13. /* Define DHT11_ONE_BUS if only one 1-Wire-Bus is used
  14.    in the application -> shorter code.
  15.    If not defined make sure to call dht11_set_bus() before using
  16.    a bus. */
  17. #define DHT11_ONE_BUS
  18. #endif
  19.  
  20. #ifndef DHT11_PIN_ch0
  21.   #warning DHT11_PIN_ch0 shall be defined in config.inc, using DHT11_PIN_ch0=EXP_F...
  22.   #define DHT11_PIN_ch0  EXP_F
  23. #endif
  24.  
  25. //#define DHT11_CONF_DELAYOFFSET 0
  26.  
  27. //#if F_CPU<1843200
  28. // #warning | experimental multi-bus-mode is not tested for
  29. // #warning | frequencies below 1,84MHz - use DHT11_ONE_WIRE or
  30. // #warning | faster clock-source (i.e. internal 2MHz R/C-Osc.)
  31. //#endif
  32. //#define DHT11_CONF_CYCLESPERACCESS 13
  33. //#define DHT11_CONF_DELAYOFFSET ( (uint16_t)( ((DHT11_CONF_CYCLESPERACCESS)*1000000L) / F_CPU  ) )
  34.  
  35.  
  36. /*******************************************/
  37.  
  38. extern uint8_t dht11_start(void);
  39. extern uint8_t dht11_readData(uint8_t* data);
  40.  
  41.  
  42. #ifndef DHT11_ONE_BUS
  43. extern void dht11_set_bus(volatile uint8_t* out,
  44.     volatile uint8_t* in,
  45.     volatile uint8_t* ddr,
  46.     uint8_t pin,
  47.     uint8_t pcint);
  48. #endif
  49.  
  50. #endif
  51.  
  52.