configuration.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef INCLUDE_CONFIGURATION_H_
  2. #define INCLUDE_CONFIGURATION_H_
  3. #include <user_config.h>
  4. #include <SmingCore/SmingCore.h>
  5. // If you want, you can define WiFi settings globally in Eclipse Environment Variables
  6. #ifndef WIFI_SSID
  7. #define WIFI_SSID "Heaven-WiFi" // Put you SSID and Password here
  8. #define WIFI_PWD "Heaven-32847"
  9. #endif
  10. #define PinSet(pin) GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, pin)
  11. #define PinRes(pin) GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, pin)
  12. #define Pin16Set WRITE_PERI_REG(RTC_GPIO_OUT, (READ_PERI_REG(RTC_GPIO_OUT) & (uint32)0xffffffff))
  13. #define Pin16Res WRITE_PERI_REG(RTC_GPIO_OUT, (READ_PERI_REG(RTC_GPIO_OUT) & (uint32)0xfffffffe))
  14. // Pin for communication with DHT sensor
  15. #define DHT_PIN 2
  16. // Pin for trigger control output
  17. #define CONTROL_PIN 16
  18. // MAX7219
  19. #define PIN_SCK 14
  20. #define PIN_MOSI 12
  21. #define PIN_SS 13
  22. #define CLOCK_CONFIG_FILE ".clock.conf" // leading point for security reasons :)
  23. struct ClockConfig
  24. {
  25. ClockConfig()
  26. {
  27. AddTZ = 2;
  28. LightTrhLow = 341;
  29. LightTrhHigh = 683;
  30. BrightnessLow = 1;
  31. BrightnessMiddle = 7;
  32. BrightnessHigh = 15;
  33. }
  34. String NetworkSSID;
  35. String NetworkPassword;
  36. float AddTZ; // TimeZone - local time offset
  37. uint16_t LightTrhLow; // Low Light level
  38. uint16_t LightTrhHigh; // High Light level
  39. int8_t BrightnessLow; // Low LED brightness level
  40. int8_t BrightnessMiddle; // Middle LED brightness level
  41. int8_t BrightnessHigh; // High LED brightness level
  42. };
  43. ClockConfig loadConfig();
  44. void saveConfig(ClockConfig& cfg);
  45. extern ClockConfig ActiveConfig;
  46. #endif /* INCLUDE_CONFIGURATION_H_ */