Преглед на файлове

Merge branch 'master' of https://www.github.com/things4u/ESP-1ch-Gateway

platenspeler преди 5 години
родител
ревизия
514f56d123
променени са 4 файла, в които са добавени 37 реда и са изтрити 11 реда
  1. 8 6
      README.md
  2. 3 1
      src/ESP-sc-gway.ino
  3. 22 0
      src/loraModem.h
  4. 4 4
      src/oLED.h

+ 8 - 6
README.md

@@ -164,7 +164,7 @@ If the heap drops below 18 KBytes some functions may not behave as expected (in
 
 ## Editing the configNode.h file
 
-The configNode.h file is used to set teh WiFi access point and the structure of known 
+The configNode.h file is used to set the WiFi access point and the structure of known 
 sensors to the 1-channel gateway.
 Setting the known WiFi access points (SSID and password) must be done at compile time.
 
@@ -203,13 +203,15 @@ Also the gateway may or may not support Class B, which is a superset of class A.
  
 ### Selecting you standard pin-out
 
-We support two pin-out configurations out-of-the-box: HALLARD and COMPRESULT.
-If you use one of these two, just set the parameter to the right value.
-If your pin definitions are different, update the loraModem.h file to reflect these settings.
+We support five pin-out configurations out-of-the-box, see below.
+If you use one of these, just set the parameter to the right value.
+If your pin definitions are different, update the loraModem.h and oLED.h file to reflect these settings.
 	1: HALLARD
 	2: COMRESULT pin out
-	3: ESP32 pin out
-	4: Other, define your own in loraModem.h
+	3: ESP32/Wemos based board
+	4: ESP32/TTGO based board
+	5: ESP32/Heltec Wifi LoRA 32(V2)
+
 
  \#define _PIN_OUT 1
 

+ 3 - 1
src/ESP-sc-gway.ino

@@ -26,7 +26,9 @@
 
 #if defined (ARDUINO_ARCH_ESP32) || defined(ESP32)
 #	define ESP32_ARCH 1
-#	define _PIN_OUT 4										// For ESP32 this pin-out is standard
+#	ifndef _PIN_OUT
+#		define _PIN_OUT 4										// For ESP32 this pin-out is standard
+#	endif
 #elif defined(ARDUINO_ARCH_ESP8266)
 	//
 #else

+ 22 - 0
src/loraModem.h

@@ -256,6 +256,28 @@ struct pins {
 #define GPS_TX 12
 #endif // _GPS
 
+#elif _PIN_OUT==5
+
+// ----------------------------------------------------------------------------
+// For ESP32/Heltec Wifi LoRA 32(V2) board with 0.9" OLED
+//
+// SCK  == GPIO5/ PIN5
+// SS   == GPIO18/PIN18 CS
+// MISO == GPIO19/ PIN19
+// MOSI == GPIO27/ PIN27
+// RST  == GPIO14/ PIN14
+struct pins {
+	uint8_t dio0=26;		// GPIO26 / Dio0 used for one frequency and one SF
+	uint8_t dio1=35;		// GPIO35 / Used for CAD, may or not be shared with DIO0
+	uint8_t dio2=34;		// GPIO34 / Used for frequency hopping, don't care
+	uint8_t ss=18;			// GPIO18 / Dx. Select pin connected to GPIO18
+	uint8_t rst=14;			// GPIO0 / D3. Reset pin not used	
+} pins;
+#define SCK 5				// Check
+#define MISO 19				// Check
+#define MOSI 27				// Check
+#define RST 14				// Check
+#define SS 18
 
 #else
 // ----------------------------------------------------------------------------

+ 4 - 4
src/oLED.h

@@ -45,10 +45,10 @@
 #define OLED_SDA 4								// GPIO4 / 
 #define OLED_RST 16								// Reset pin (Some OLED displays do not have it)
 
-#elif _PIN_OUT==5								// TTGO with external OLED
-#define OLED_SCL 22								// GPIO22 / SCL
-#define OLED_SDA 21								// GPIO21 / SDA
-#define OLED_RST 16								// Reset pin (Some OLED displays do not have it)
+#elif _PIN_OUT==5								// Heltec Wifi LoRA 32(V2) onboard OLED
+#define OLED_SCL 15								// GPIO22 / SCL
+#define OLED_SDA 4								// GPIO21 / SDA
+#define OLED_RST 16								// Reset pin
 
 #endif