configuration.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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_DIN 14
  20. #define PIN_CLK 13
  21. #define PIN_LOAD 12
  22. #define MAX7219_DIGITS 8
  23. #define CLOCK_CONFIG_FILE ".clock.conf" // leading point for security reasons :)
  24. struct ClockConfig
  25. {
  26. ClockConfig()
  27. {
  28. AddTZ = 2;
  29. LightTrhLow = 341;
  30. LightTrhHigh = 683;
  31. BrightnessLow = 1;
  32. BrightnessMiddle = 7;
  33. BrightnessHigh = 15;
  34. }
  35. String NetworkSSID;
  36. String NetworkPassword;
  37. float AddTZ; // TimeZone - local time offset
  38. uint16_t LightTrhLow; // Low Light level
  39. uint16_t LightTrhHigh; // High Light level
  40. int8_t BrightnessLow; // Low LED brightness level
  41. int8_t BrightnessMiddle; // Middle LED brightness level
  42. int8_t BrightnessHigh; // High LED brightness level
  43. };
  44. ClockConfig loadConfig();
  45. void saveConfig(ClockConfig& cfg);
  46. extern ClockConfig ActiveConfig;
  47. #endif /* INCLUDE_CONFIGURATION_H_ */