Smart-Home am Beispiel der Präsenzerkennung im Raum Projektarbeit Lennart Heimbs, Johannes Krug, Sebastian Dohle und Kevin Holzschuh bei Prof. Oliver Hofmann SS2019
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MyHwESP8266.h 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * The MySensors Arduino library handles the wireless radio link and protocol
  3. * between your home built sensors/actuators and HA controller of choice.
  4. * The sensors forms a self healing radio network with optional repeaters. Each
  5. * repeater and gateway builds a routing tables in EEPROM which keeps track of the
  6. * network topology allowing messages to be routed to nodes.
  7. *
  8. * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
  9. * Copyright (C) 2013-2018 Sensnology AB
  10. * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
  11. *
  12. * Documentation: http://www.mysensors.org
  13. * Support Forum: http://forum.mysensors.org
  14. *
  15. * This program is free software; you can redistribute it and/or
  16. * modify it under the terms of the GNU General Public License
  17. * version 2 as published by the Free Software Foundation.
  18. */
  19. #ifndef MyHwESP8266_h
  20. #define MyHwESP8266_h
  21. #ifdef __cplusplus
  22. #include <Arduino.h>
  23. #endif
  24. #define CRYPTO_LITTLE_ENDIAN
  25. #ifndef MY_SERIALDEVICE
  26. #define MY_SERIALDEVICE Serial
  27. #endif
  28. #ifndef MY_DEBUGDEVICE
  29. #define MY_DEBUGDEVICE MY_SERIALDEVICE
  30. #endif
  31. #define EEPROM_size (1024)
  32. // Define these as macros to save valuable space
  33. #define hwDigitalWrite(__pin, __value) digitalWrite(__pin, __value)
  34. #define hwDigitalRead(__pin) digitalRead(__pin)
  35. #define hwPinMode(__pin, __value) pinMode(__pin, __value)
  36. #define hwWatchdogReset() wdt_reset()
  37. #define hwReboot() ESP.restart()
  38. #define hwMillis() millis()
  39. // The use of randomSeed switch to pseudo random number. Keep hwRandomNumberInit empty
  40. #define hwRandomNumberInit()
  41. bool hwInit(void);
  42. void hwReadConfigBlock(void *buf, void *addr, size_t length);
  43. void hwWriteConfigBlock(void *buf, void *addr, size_t length);
  44. void hwWriteConfig(const int addr, uint8_t value);
  45. uint8_t hwReadConfig(const int addr);
  46. ssize_t hwGetentropy(void *__buffer, size_t __length);
  47. //#define MY_HW_HAS_GETENTROPY
  48. /**
  49. * Restore interrupt state.
  50. * Helper function for MY_CRITICAL_SECTION.
  51. */
  52. static __inline__ void __psRestore(const uint32_t *__s)
  53. {
  54. xt_wsr_ps( *__s );
  55. }
  56. #ifndef DOXYGEN
  57. #define MY_CRITICAL_SECTION for ( uint32_t __psSaved __attribute__((__cleanup__(__psRestore))) = xt_rsil(15), __ToDo = 1; __ToDo ; __ToDo = 0 )
  58. #endif /* DOXYGEN */
  59. #endif // #ifdef ARDUINO_ARCH_ESP8266