2018-02-11 20:39:04 +00:00
|
|
|
// 1-channel LoRa Gateway for ESP8266
|
2018-05-20 11:23:50 +00:00
|
|
|
// Copyright (c) 2016, 2017, 2018 Maarten Westenberg version for ESP8266
|
2018-08-26 09:03:07 +00:00
|
|
|
// Version 5.3.3
|
|
|
|
// Date: 2018-08-25
|
2018-02-11 20:39:04 +00:00
|
|
|
//
|
2018-07-09 19:50:17 +00:00
|
|
|
// based on work done by Thomas Telkamp for Raspberry PI 1ch gateway
|
|
|
|
// and many others.
|
2018-02-11 20:39:04 +00:00
|
|
|
//
|
|
|
|
// All rights reserved. This program and the accompanying materials
|
|
|
|
// are made available under the terms of the MIT License
|
|
|
|
// which accompanies this distribution, and is available at
|
|
|
|
// https://opensource.org/licenses/mit-license.php
|
|
|
|
//
|
2018-07-09 19:50:17 +00:00
|
|
|
// NO WARRANTY OF ANY KIND IS PROVIDED
|
|
|
|
//
|
2018-02-11 20:39:04 +00:00
|
|
|
// Author: Maarten Westenberg (mw12554@hotmail.com)
|
|
|
|
//
|
|
|
|
// This file contains a number of compile-time settings and definitions for OLED support.
|
|
|
|
//
|
|
|
|
// ----------------------------------------------------------------------------------------
|
|
|
|
|
2018-04-16 19:23:13 +00:00
|
|
|
// OLEDs dupported by this program must be I2C.
|
|
|
|
// This is because we do not want any diisturbance in the SPI area
|
|
|
|
// which is also interfacing the LORA tranceiver.
|
|
|
|
//
|
|
|
|
// The following OLDs are supported:
|
|
|
|
// 0. No OLED connected
|
|
|
|
// 1. 0.9" OLED (cheap)
|
2018-08-26 09:03:07 +00:00
|
|
|
// 2. 1.3" OLED with much better and larger display
|
2018-04-16 19:23:13 +00:00
|
|
|
|
2018-06-12 14:42:31 +00:00
|
|
|
#if OLED>=1 // If OLED is used
|
2018-02-11 20:39:04 +00:00
|
|
|
|
2018-06-12 14:42:31 +00:00
|
|
|
// --------------------------------------------------------
|
2018-06-28 21:05:43 +00:00
|
|
|
// Define the different PIN's used for SCL/SDA for each arch.
|
2018-06-12 14:42:31 +00:00
|
|
|
//
|
|
|
|
#if _PIN_OUT==1 // HALLARD
|
|
|
|
#define OLED_SCL 5 // GPIO5 / D1
|
|
|
|
#define OLED_SDA 4 // GPIO4 / D2
|
|
|
|
|
|
|
|
#elif _PIN_OUT==2 // COMRESULT
|
|
|
|
#define OLED_SCL 0 // GPIO0 / D3
|
|
|
|
#define OLED_SDA 2 // GPIO2 / D4
|
|
|
|
|
|
|
|
#elif _PIN_OUT==4 // TTGO (onboard version used, also for DIY)
|
2018-06-28 21:05:43 +00:00
|
|
|
#define OLED_SCL 15 // GPIO15 /
|
|
|
|
#define OLED_SDA 4 // GPIO4 /
|
2018-08-26 09:03:07 +00:00
|
|
|
#define OLED_RST 16 // Reset pin (Some OLED displays do not have it)
|
2018-02-11 20:39:04 +00:00
|
|
|
|
2018-06-12 14:42:31 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------
|
|
|
|
// Define the different OLED versions
|
|
|
|
//
|
2018-02-11 20:39:04 +00:00
|
|
|
#if OLED==1
|
|
|
|
#include "SSD1306.h"
|
|
|
|
#define OLED_ADDR 0x3C // Default 0x3C for 0.9", for 1.3" it is 0x78
|
|
|
|
SSD1306 display(OLED_ADDR, OLED_SDA, OLED_SCL);// i2c ADDR & SDA, SCL on wemos
|
|
|
|
#endif
|
|
|
|
|
2018-06-12 14:42:31 +00:00
|
|
|
// This is an 1.3" OLED display which is running on I2C
|
2018-02-11 20:39:04 +00:00
|
|
|
#if OLED==2
|
|
|
|
#include "SH1106.h"
|
2018-03-26 20:25:11 +00:00
|
|
|
#define OLED_ADDR 0x3C // Default 0x3C for 1.3" SH1106
|
2018-02-11 20:39:04 +00:00
|
|
|
SH1106 display(OLED_ADDR, OLED_SDA, OLED_SCL); // i2c ADDR & SDA, SCL on wemos
|
|
|
|
#endif
|
|
|
|
|
2018-03-26 20:25:11 +00:00
|
|
|
#endif//OLED>=1
|