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.

MyHwESP32.h 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. * Arduino core for ESP32: https://github.com/espressif/arduino-esp32
  20. *
  21. * MySensors ESP32 implementation, Copyright (C) 2017-2018 Olivier Mauti <olivier@mysensors.org>
  22. *
  23. * Radio wiring ESP32(Node32s): RF24, RFM69, RFM95:
  24. *
  25. * | IO | RF24 | RFM69 | RFM95 |
  26. * |------|------|-------|-------|
  27. * | MOSI | 23 | 23 | 23 |
  28. * | MISO | 19 | 19 | 19 |
  29. * | SCK | 18 | 18 | 18 |
  30. * | CSN | 5 | 5 | 5 |
  31. * | CE | 17 | - | - |
  32. * | RST | - | 17 | 17 |
  33. * | IRQ | 16* | 16 | 16 |
  34. * * = optional
  35. *
  36. */
  37. #ifndef MyHwESP32_h
  38. #define MyHwESP32_h
  39. #include <WiFi.h>
  40. #include "EEPROM.h"
  41. #ifdef __cplusplus
  42. #include <Arduino.h>
  43. #endif
  44. #define CRYPTO_LITTLE_ENDIAN
  45. #ifndef MY_SERIALDEVICE
  46. #define MY_SERIALDEVICE Serial
  47. #endif
  48. #ifndef MY_DEBUGDEVICE
  49. #define MY_DEBUGDEVICE MY_SERIALDEVICE
  50. #endif
  51. #ifndef MY_ESP32_TEMPERATURE_OFFSET
  52. #define MY_ESP32_TEMPERATURE_OFFSET (0.0f)
  53. #endif
  54. #ifndef MY_ESP32_TEMPERATURE_GAIN
  55. #define MY_ESP32_TEMPERATURE_GAIN (1.0f)
  56. #endif
  57. #define MY_EEPROM_SIZE 1024
  58. #define hwDigitalWrite(__pin, __value) digitalWrite(__pin, __value)
  59. #define hwDigitalRead(__pin) digitalRead(__pin)
  60. #define hwPinMode(__pin, __value) pinMode(__pin, __value)
  61. #define hwWatchdogReset()
  62. #define hwReboot() ESP.restart()
  63. #define hwMillis() millis()
  64. #define hwMicros() micros()
  65. #define hwRandomNumberInit() randomSeed(esp_random())
  66. bool hwInit(void);
  67. void hwReadConfigBlock(void *buf, void *addr, size_t length);
  68. void hwWriteConfigBlock(void *buf, void *addr, size_t length);
  69. void hwWriteConfig(const int addr, uint8_t value);
  70. uint8_t hwReadConfig(const int addr);
  71. ssize_t hwGetentropy(void *__buffer, size_t __length);
  72. #define MY_HW_HAS_GETENTROPY
  73. /**
  74. * Restore interrupt state.
  75. * Helper function for MY_CRITICAL_SECTION.
  76. */
  77. static __inline__ void __psRestore(const uint32_t *__s)
  78. {
  79. XTOS_RESTORE_INTLEVEL(*__s);
  80. }
  81. #ifndef DOXYGEN
  82. #define MY_CRITICAL_SECTION for ( uint32_t __psSaved __attribute__((__cleanup__(__psRestore))) = XTOS_DISABLE_ALL_INTERRUPTS, __ToDo = 1; __ToDo ; __ToDo = 0 )
  83. #endif /* DOXYGEN */
  84. #endif