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.

MyHwSTM32F1.h 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 MyHwSTM32F1_h
  20. #define MyHwSTM32F1_h
  21. #include <libmaple/iwdg.h>
  22. #include <itoa.h>
  23. #include <EEPROM.h>
  24. #ifdef __cplusplus
  25. #include <Arduino.h>
  26. #endif
  27. #define CRYPTO_LITTLE_ENDIAN
  28. #ifndef MY_SERIALDEVICE
  29. #define MY_SERIALDEVICE Serial
  30. #endif
  31. #ifndef MY_DEBUGDEVICE
  32. #define MY_DEBUGDEVICE MY_SERIALDEVICE
  33. #endif
  34. #ifndef MY_STM32F1_TEMPERATURE_OFFSET
  35. #define MY_STM32F1_TEMPERATURE_OFFSET (0.0f)
  36. #endif
  37. #ifndef MY_STM32F1_TEMPERATURE_GAIN
  38. #define MY_STM32F1_TEMPERATURE_GAIN (1.0f)
  39. #endif
  40. // SS default
  41. #ifndef SS
  42. #define SS PA4
  43. #endif
  44. // mapping
  45. #define snprintf_P snprintf
  46. #define vsnprintf_P vsnprintf
  47. #define strncpy_P strncpy
  48. #define printf_P printf
  49. #define yield() // not defined
  50. #ifndef digitalPinToInterrupt
  51. #define digitalPinToInterrupt(__pin) (__pin)
  52. #endif
  53. #define hwDigitalWrite(__pin, __value) digitalWrite(__pin, __value)
  54. #define hwDigitalRead(__pin) digitalRead(__pin)
  55. #define hwPinMode(__pin, __value) pinMode(__pin, __value)
  56. #define hwWatchdogReset() iwdg_feed()
  57. #define hwReboot() nvic_sys_reset()
  58. #define hwMillis() millis()
  59. extern void serialEventRun(void) __attribute__((weak));
  60. bool hwInit(void);
  61. void hwRandomNumberInit(void);
  62. void hwReadConfigBlock(void *buf, void *addr, size_t length);
  63. void hwWriteConfigBlock(void *buf, void *addr, size_t length);
  64. void hwWriteConfig(const int addr, uint8_t value);
  65. uint8_t hwReadConfig(const int addr);
  66. #ifndef DOXYGEN
  67. #define MY_CRITICAL_SECTION
  68. #endif /* DOXYGEN */
  69. #endif