An example project for the Heltec Turtle LoRa board (STM32L4 and SX1276 chips). The projects is only supported for the Nucleo-L432KC board platform in the mbed online and offline compiler environment. Visit www.radioshuttle.de (choose Turtle board) for instructions. Note that most source files and libraries are open source, however some files especially the RadioShuttle core protocol is copyrighted work. Check header for details.

Dependencies:   mbed BufferedSerial SX1276GenericLib OLED_SSD1306 HELIOS_Si7021 NVProperty RadioShuttle-STM32L4 USBDeviceHT

Files at this revision

API Documentation at this revision

Comitter:
Helmut Tschemernjak
Date:
Fri Mar 29 14:22:04 2019 +0100
Parent:
49:6c7d42d48672
Child:
51:cb4247877bf4
Commit message:
Added SI7021 sensor

Changed in this revision

PinMap.h Show annotated file Show diff for this revision Revisions of this file
Utils/utils.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
main.h Show annotated file Show diff for this revision Revisions of this file
--- a/PinMap.h	Mon Mar 04 09:42:47 2019 +0100
+++ b/PinMap.h	Fri Mar 29 14:22:04 2019 +0100
@@ -17,6 +17,7 @@
  #define FEATURE_USBSERIAL
  #define FEATURE_NVPROPERTY
  #define FEATURE_NVPROPERTYEDITOR
+// #define FEATURE_SI7021
 #endif
 
 #ifdef HELTECL432_REV1
@@ -63,6 +64,9 @@
 #define P_PB_6		PB_6
 #define	P_PB_7		PB_7
 
+#define SI7021_SCA	P_PA_10_SCA
+#define SI7021_SCL	P_PA_9_SCL
+
 #define WatchDogUpdate() void()
 
 #else
--- a/Utils/utils.cpp	Mon Mar 04 09:42:47 2019 +0100
+++ b/Utils/utils.cpp	Fri Mar 29 14:22:04 2019 +0100
@@ -8,13 +8,14 @@
 #ifdef TOOLCHAIN_GCC
 #include <malloc.h>
 #endif
-
 volatile uint32_t PendingInterrupts;	// global interrupt mask of received interrupts
 
 time_t cvt_date(char const *date, char const *time);
 
 static float GetBrownOutVolt(void);
-
+#ifdef FEATURE_SI7021
+HELIOS_Si7021 *sensorSI7021;
+#endif
 BufferedSerial *ser;
 #ifdef FEATURE_USBSERIAL
 USBSerialBuffered *usb;
@@ -87,11 +88,16 @@
 	
     dprintf("Brown Out Reset %s (%1.1f V)", errstr, GetBrownOutVolt());
     dprintf("Voltage: %.2f (%s powered)", BatteryVoltage(), BatterySource());
-
 	dprintf("InitDefaults Done");
 	MemoryAvailable(true);
-	
     __HAL_RCC_CLEAR_RESET_FLAGS();
+#ifdef FEATURE_SI7021
+	sensorSI7021 = new HELIOS_Si7021(SI7021_SCA, SI7021_SCL);
+	if (sensorSI7021->hasSensor()) {
+		dprintf("%s: Rev(%d)  %.2f°C  Humidity: %.2f%%", sensorSI7021->getModelName(), sensorSI7021->getRevision(), sensorSI7021->readTemperature(), sensorSI7021->readHumidity());
+	}
+#endif
+
 }
 void printTimeStamp()
 {
--- a/main.cpp	Mon Mar 04 09:42:47 2019 +0100
+++ b/main.cpp	Fri Mar 29 14:22:04 2019 +0100
@@ -12,7 +12,6 @@
 #include "main.h"
 #include "RadioTest.h"
 
-
 DigitalOut statusLED(LED);
 DigitalOut redLED(LED2);
 InterruptIn buttonIntr(USER_BUTTON);
--- a/main.h	Mon Mar 04 09:42:47 2019 +0100
+++ b/main.h	Fri Mar 29 14:22:04 2019 +0100
@@ -12,6 +12,9 @@
 #endif
 #include "arch.h"
 #include "mbed-util.h"
+#ifdef FEATURE_SI7021
+#include "HELIOS_Si7021.h"
+#endif
 
 
 enum InterruptDevice {
@@ -47,3 +50,6 @@
 extern void MCUReset(void);
 extern void RunCommands(int timeout_ms);
 
+#ifdef FEATURE_SI7021
+extern HELIOS_Si7021 *sensorSI7021;
+#endif