oLED.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // 1-channel LoRa Gateway for ESP8266
  2. // Copyright (c) 2016, 2017, 2018, 2019 Maarten Westenberg version for ESP8266
  3. // Version 6.1.0
  4. // Date: 2019-10-20
  5. //
  6. // based on work done by Thomas Telkamp for Raspberry PI 1ch gateway
  7. // and many others.
  8. //
  9. // All rights reserved. This program and the accompanying materials
  10. // are made available under the terms of the MIT License
  11. // which accompanies this distribution, and is available at
  12. // https://opensource.org/licenses/mit-license.php
  13. //
  14. // NO WARRANTY OF ANY KIND IS PROVIDED
  15. //
  16. // Author: Maarten Westenberg (mw12554@hotmail.com)
  17. //
  18. // This file contains a number of compile-time settings and definitions for OLED support.
  19. //
  20. // ----------------------------------------------------------------------------------------
  21. // OLEDs supported by this program must be I2C.
  22. // This is because we do not want any disturbance in the SPI area
  23. // which is also interfacing the LORA tranceiver.
  24. //
  25. // The following OLEDs are supported:
  26. // 0. No OLED connected
  27. // 1. 0.9" OLED (cheap)
  28. // 2. 1.3" OLED with much better and larger display
  29. // 4. TTGO board
  30. #if OLED>=1 // If OLED is used
  31. // --------------------------------------------------------
  32. // Define the different PIN's used for SCL/SDA for each arch.
  33. //
  34. #if _PIN_OUT==1 // HALLARD
  35. #define OLED_SCL 5 // GPIO5 / D1
  36. #define OLED_SDA 4 // GPIO4 / D2
  37. #elif _PIN_OUT==2 // COMRESULT
  38. #define OLED_SCL 0 // GPIO0 / D3
  39. #define OLED_SDA 2 // GPIO2 / D4
  40. #elif _PIN_OUT==4 // TTGO (onboard version used, also for DIY)
  41. #define OLED_SCL 15 // GPIO15 /
  42. #define OLED_SDA 4 // GPIO4 /
  43. #define OLED_RST 16 // Reset pin (Some OLED displays do not have it)
  44. #endif
  45. // --------------------------------------------------------
  46. // Define the different OLED versions
  47. //
  48. #if OLED==1
  49. #include "SSD1306.h"
  50. #define OLED_ADDR 0x3C // Default 0x3C for 0.9", for 1.3" it is 0x78
  51. SSD1306 display(OLED_ADDR, OLED_SDA, OLED_SCL);// i2c ADDR & SDA, SCL on wemos
  52. #endif
  53. // This is an 1.3" OLED display which is running on I2C
  54. #if OLED==2
  55. #include "SH1106.h"
  56. #define OLED_ADDR 0x3C // Default 0x3C for 1.3" SH1106
  57. SH1106 display(OLED_ADDR, OLED_SDA, OLED_SCL); // i2c ADDR & SDA, SCL on wemos
  58. #endif
  59. #endif//OLED>=1