config.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #pragma once
  2. // Board- and application-wide configuration.
  3. //
  4. // Wi-Fi credentials and the outdoor sensor URL live in secrets.h, which is not
  5. // committed. Copy secrets.h.example to secrets.h before the first build.
  6. // ---------------------------------------------------------------- display ---
  7. // The panel is a 300 x 400 ST7305 reflective LCD. The application runs it
  8. // rotated (U8G2_R1), so the drawing surface is 400 wide by 300 high.
  9. #define LCD_NATIVE_WIDTH 300
  10. #define LCD_NATIVE_HEIGHT 400
  11. #define DISPLAY_WIDTH 400
  12. #define DISPLAY_HEIGHT 300
  13. #define RLCD_SCK_PIN 11
  14. #define RLCD_MOSI_PIN 12
  15. #define RLCD_DC_PIN 5
  16. #define RLCD_CS_PIN 40
  17. #define RLCD_RST_PIN 41
  18. #define RLCD_TE_PIN 6 // tearing effect output, unused
  19. // Layout: top 60% is time + date, bottom 40% is indoor | outdoor.
  20. #define LAYOUT_SPLIT_Y 180
  21. #define LAYOUT_MID_X 200
  22. // ------------------------------------------------------------------- i2c ---
  23. #define I2C_SDA_PIN 13
  24. #define I2C_SCL_PIN 14
  25. #define I2C_FREQ_HZ 400000
  26. #define PCF85063_ADDR 0x51
  27. #define SHTC3_ADDR 0x70
  28. // ------------------------------------------------------------------ time ---
  29. #define NTP_SERVER_1 "pool.ntp.org"
  30. #define NTP_SERVER_2 "time.google.com"
  31. // POSIX TZ string for Australia/Hobart (AEST-10, AEDT from Oct to Apr).
  32. #define TIMEZONE_POSIX "AEST-10AEDT,M10.1.0,M4.1.0/3"
  33. // Date line format, strftime(3). "MONDAY 24 AUGUST".
  34. #define DATE_FORMAT "%A %e %B"
  35. // -------------------------------------------------------------- intervals ---
  36. #define WIFI_CONNECT_TIMEOUT_MS 20000UL // give up on a connect attempt
  37. #define WIFI_RETRY_MS 60000UL // then retry this often
  38. #define NTP_RESYNC_MS (6UL * 60UL * 60UL * 1000UL)
  39. #define INDOOR_READ_MS 30000UL
  40. #define OUTDOOR_POLL_MS 30000UL
  41. #define OUTDOOR_STALE_MS (10UL * 60UL * 1000UL) // mark reading stale
  42. #define DISPLAY_TICK_MS 1000UL // check-for-change rate
  43. // ---------------------------------------------------------------- outdoor ---
  44. // HTTP timeout for one outdoor poll.
  45. #define OUTDOOR_HTTP_TIMEOUT_MS 5000
  46. // Plausible temperature range; readings outside it are rejected.
  47. #define TEMP_MIN_VALID -50.0f
  48. #define TEMP_MAX_VALID 80.0f
  49. #include "secrets.h"