1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #ifndef INCLUDE_CONFIGURATION_H_
- #define INCLUDE_CONFIGURATION_H_
- #include <user_config.h>
- #include <SmingCore/SmingCore.h>
- // If you want, you can define WiFi settings globally in Eclipse Environment Variables
- #ifndef WIFI_SSID
- #define WIFI_SSID "Heaven-WiFi" // Put you SSID and Password here
- #define WIFI_PWD "Heaven-32847"
- #endif
- #define PinSet(pin) GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, pin)
- #define PinRes(pin) GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, pin)
- #define Pin16Set WRITE_PERI_REG(RTC_GPIO_OUT, (READ_PERI_REG(RTC_GPIO_OUT) & (uint32)0xffffffff))
- #define Pin16Res WRITE_PERI_REG(RTC_GPIO_OUT, (READ_PERI_REG(RTC_GPIO_OUT) & (uint32)0xfffffffe))
- // Pin for communication with DHT sensor
- #define DHT_PIN 2
- // Pin for trigger control output
- #define CONTROL_PIN 16
- // MAX7219
- #define PIN_SCK 14
- #define PIN_MOSI 13
- #define PIN_SS 12
- #define METEO_CONFIG_FILE ".meteo.conf" // leading point for security reasons :)
- enum TriggerType
- {
- eTT_None = 0,
- eTT_Temperature,
- eTT_Humidity
- };
- struct MeteoConfig
- {
- MeteoConfig()
- {
- AddT = 0;
- AddRH = 0;
- AddTZ = 2;
- Trigger = eTT_Humidity;
- RangeMin = 30;
- RangeMax = 50;
- }
- String NetworkSSID;
- String NetworkPassword;
- float AddT; // Temperature adjustment
- float AddRH; // Humidity adjustment
- float AddTZ; // TimeZone - local time offset
- TriggerType Trigger; // Sensor trigger type
- float RangeMin;
- float RangeMax;
- };
- MeteoConfig loadConfig();
- void saveConfig(MeteoConfig& cfg);
- extern MeteoConfig ActiveConfig;
- #endif /* INCLUDE_CONFIGURATION_H_ */
|