forked from lmarzen/esp32-weather-epd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.h
More file actions
239 lines (220 loc) · 9.5 KB
/
config.h
File metadata and controls
239 lines (220 loc) · 9.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
/* Configuration option declarations for esp32-weather-epd.
* Copyright (C) 2022-2023 Luke Marzen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __CONFIG_H__
#define __CONFIG_H__
#include <cstdint>
#include <Arduino.h>
// E-PAPER PANEL
// This project supports the following E-Paper panels:
// DISP_BW_V2 - Waveshare 7.5in e-paper (v2) 800x480px Black/White
// DISP_3C_B - Waveshare 7.5in e-Paper (B) 800x480px Red/Black/White
// DISP_7C_F - Waveshare 7.3in ACeP e-Paper (F) 800x480px 7-Color
// DISP_BW_V1 - Waveshare 7.5in e-paper (v1) 640x384px Black/White
// Uncomment the macro that identifies your physical panel.
#define DISP_BW_V2
// #define DISP_3C_B
// #define DISP_7C_F
// #define DISP_BW_V1
// 3 COLOR E-INK ACCENT COLOR
// Defines the 3rd color to be used when a 3+ color display is selected.
#if defined(DISP_3C_B) || defined(DISP_7C_F)
// #define ACCENT_COLOR GxEPD_BLACK
#define ACCENT_COLOR GxEPD_RED
// #define ACCENT_COLOR GxEPD_GREEN
// #define ACCENT_COLOR GxEPD_BLUE
// #define ACCENT_COLOR GxEPD_YELLOW
// #define ACCENT_COLOR GxEPD_ORANGE
#endif
// LOCALE
// If your locale is not here, you can add it by copying and modifying one of
// the files in src/locales. Please feel free to create a pull request to add
// official support for your locale.
// Language (Territory) code
// German (Germany) de_DE
// English (United Kingdom) en_GB
// English (United States) en_US
// French (France) fr_FR
// Dutch (Belgium) nl_BE
#define LOCALE en_US
// UNITS
// Define exactly one macro for each unit below.
// UNITS - TEMPERATURE
// Metric : Celsius
// Imperial : Fahrenheit
// #define UNITS_TEMP_KELVIN
// #define UNITS_TEMP_CELSIUS
#define UNITS_TEMP_FAHRENHEIT
// UNITS - WIND SPEED
// Metric : Kilometers per Hour
// Imperial : Miles per Hour
// #define UNITS_SPEED_METERSPERSECOND
// #define UNITS_SPEED_FEETPERSECOND
// #define UNITS_SPEED_KILOMETERSPERHOUR
#define UNITS_SPEED_MILESPERHOUR
// #define UNITS_SPEED_KNOTS
// #define UNITS_SPEED_BEAUFORT
// UNITS - PRESSURE
// Metric : Millibars
// Imperial : Inches of Mercury
// #define UNITS_PRES_HECTOPASCALS
// #define UNITS_PRES_PASCALS
// #define UNITS_PRES_MILLIMETERSOFMERCURY
#define UNITS_PRES_INCHESOFMERCURY
// #define UNITS_PRES_MILLIBARS
// #define UNITS_PRES_ATMOSPHERES
// #define UNITS_PRES_GRAMSPERSQUARECENTIMETER
// #define UNITS_PRES_POUNDSPERSQUAREINCH
// UNITS - VISIBILITY DISTANCE
// Metric : Kilometers
// Imperial : Miles
// #define UNITS_DIST_KILOMETERS
#define UNITS_DIST_MILES
// AIR QUALITY INDEX
// Seemingly every country uses a different scale for Air Quality Index (AQI).
// I have written a library to calculate many of the most popular AQI scales.
// Feel free to request the addition of a new AQI scale by opening an Issue.
// https://github.com/lmarzen/pollutant-concentration-to-aqi
// Define your preferred AQI scale.
// AUSTRALIA_AQI CANADA_AQHI EUROPE_CAQI
// HONG_KONG_AQHI INDIA_AQI MAINLAND_CHINA_AQI
// SINGAPORE_PSI SOUTH_KOREA_CAI UNITED_KINGDOM_DAQI
// UNITED_STATES_AQI
#define UNITED_STATES_AQI
// Hypertext Transfer Protocol (HTTP)
// HTTP
// HTTP does not provide encryption or any security measures, making it highly
// vulnerable to eavesdropping and data tampering. Has the advantage of using
// less power.
// HTTPS_NO_CERT_VERIF
// HTTPS without X.509 certificate verification provides encryption but lacks
// authentication and is susceptible to man-in-the-middle attacks.
// HTTPS_WITH_CERT_VERIF
// HTTPS with X.509 certificate verification offers the highest level of
// security by providing encryption and verifying the identity of the server.
//
// HTTPS with X.509 certificate verification comes with the draw back that
// eventually the certificates on the esp32 will expire, requiring you to
// update the certificates in cert.h and reflash this software.
// Running cert.py will generate an updated cert.h file.
// The current certificate for api.openweathermap.org is valid until
// 2030-12-31 23:59:59.
// (uncomment exactly one)
// #define USE_HTTP
#define USE_HTTPS_NO_CERT_VERIF
// #define USE_HTTPS_WITH_CERT_VERIF
// WIND ICON PRECISION
// The wind direction icon shown to the left of the wind speed can indicate wind
// direction with a minimum error of ±0.5°. This uses more flash storage because
// 360 24x24 wind direction icons must be stored, totaling ~25kB. For either
// preference or in case flash space becomes a concern there are a handful of
// selectable options listed below. 360 points seems excessive, but the option
// is there.
//
// DIRECTIONS # ERROR STORAGE
// Cardinal 4 ±45.000° 288B E
// Ordinal 8 ±22.500° 576B NE
// Secondary Intercardinal 16 ±11.250° 1,152B NNE
// Tertiary Intercardinal 32 ±5.625° 2,304B NbE
// (360) 360 ±0.500° 25,920B 1°
// Uncomment your preferred wind level direction precision.
// #define WIND_DIRECTIONS_CARDINAL
// #define WIND_DIRECTIONS_ORDINAL
#define WIND_DIRECTIONS_SECONDARY_INTERCARDINAL
// #define WIND_DIRECTIONS_TERTIARY_INTERCARDINAL
// #define WIND_DIRECTIONS_360
// FONTS
// A handful of popular Open Source typefaces have been included with this
// project for your convenience. Change the font by selecting its corresponding
// header file.
//
// FONT HEADER FILE FAMILY LICENSE
// FreeMono FreeMono.h GNU FreeFont GNU GPL v3.0
// FreeSans FreeSans.h GNU FreeFont GNU GPL v3.0
// FreeSerif FreeSerif.h GNU FreeFont GNU GPL v3.0
// Lato Lato_Regular.h Lato SIL OFL v1.1
// Montserrat Montserrat_Regular.h Montserrat SIL OFL v1.1
// Open Sans OpenSans_Regular.h Open Sans SIL OFL v1.1
// Poppins Poppins_Regular.h Poppins SIL OFL v1.1
// Quicksand Quicksand_Regular.h Quicksand SIL OFL v1.1
// Raleway Raleway_Regular.h Raleway SIL OFL v1.1
// Roboto Roboto_Regular.h Roboto Apache v2.0
// Roboto Mono RobotoMono_Regular.h Roboto Mono Apache v2.0
// Roboto Slab RobotoSlab_Regular.h Roboto Slab Apache v2.0
// Ubuntu Ubuntu_R.h Ubuntu font UFL v1.0
// Ubuntu Mono UbuntuMono_R.h Ubuntu font UFL v1.0
//
// Adding new fonts is relatively straightforward, see fonts/README.
//
// Note:
// The layout of the display was designed around spacing and size of the GNU
// FreeSans font, but this project supports the ability to modularly swap
// fonts. Using a font other than FreeSans may result in undesired spacing or
// other artifacts.
#define FONT_HEADER "fonts/FreeSans.h"
// DISABLE ALERTS
// The handling of alerts is complex. Each country has a unique national alert
// system that receives alerts from many different government agencies. This
// results is huge variance in the formatting of alerts. OpenWeatherMap
// provides alerts in English only. Any combination of these factors may make
// it undesirable to display alerts in some regions.
// Disable alerts by defining the DISABLE_ALERTS macro.
// #define DISABLE_ALERTS
// DEBUG
// If defined, enables increase verbosity over the serial port.
// level 0: basic status information, assists troubleshooting (default)
// level 1: increased verbosity for debugging
#define DEBUG_LEVEL 0
// Set the below constants in "config.cpp"
extern const uint8_t PIN_BAT_ADC;
extern const uint8_t PIN_EPD_BUSY;
extern const uint8_t PIN_EPD_CS;
extern const uint8_t PIN_EPD_RST;
extern const uint8_t PIN_EPD_DC;
extern const uint8_t PIN_EPD_SCK;
extern const uint8_t PIN_EPD_MISO;
extern const uint8_t PIN_EPD_MOSI;
extern const uint8_t PIN_BME_SDA;
extern const uint8_t PIN_BME_SCL;
extern const uint8_t BME_ADDRESS;
extern const char *WIFI_SSID;
extern const char *WIFI_PASSWORD;
extern const unsigned long WIFI_TIMEOUT;
extern const String OWM_APIKEY;
extern const String OWM_ENDPOINT;
extern const String OWM_ONECALL_VERSION;
extern const String LAT;
extern const String LON;
extern const String CITY_STRING;
extern const char *TIMEZONE;
extern const char *TIME_FORMAT;
extern const char *HOUR_FORMAT;
extern const char *DATE_FORMAT;
extern const char *REFRESH_TIME_FORMAT;
extern const char *NTP_SERVER_1;
extern const char *NTP_SERVER_2;
extern const unsigned long NTP_TIMEOUT;
extern const long SLEEP_DURATION;
extern const int BED_TIME;
extern const int WAKE_TIME;
extern const int HOURLY_GRAPH_MAX;
extern const float BATTERY_WARN_VOLTAGE;
extern const float LOW_BATTERY_VOLTAGE;
extern const float VERY_LOW_BATTERY_VOLTAGE;
extern const float CRIT_LOW_BATTERY_VOLTAGE;
extern const unsigned long LOW_BATTERY_SLEEP_INTERVAL;
extern const unsigned long VERY_LOW_BATTERY_SLEEP_INTERVAL;
#endif