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

Revision:
2:daf96c5f0d0e
Parent:
0:3b6c2ce051a6
Child:
8:20149c0f4e26
--- a/PinMap.h	Sun Jan 20 15:05:59 2019 +0100
+++ b/PinMap.h	Sun Jan 20 16:10:59 2019 +0100
@@ -1,104 +1,65 @@
 /*
- * Copyright (c) 2018 Helmut Tschemernjak
+ * Copyright (c) 2019 Helmut Tschemernjak
  * 30826 Garbsen (Hannover) Germany
  * Licensed under the Apache License, Version 2.0);
  */
 
-
+#define RS_MAJOR    3
+#define RS_MINOR    1
 
-#ifdef TARGET_NUCLEO_L476RG
- #define FEATURE_LORA
- 
-#elif TARGET_DISCO_L072CZ_LRWAN1
- #define FEATURE_LORA
-
-#elif TARGET_STM32L432KC
- #define HELTEC_STM32L4
- #define FEATURE_LORA
- #define FEATURE_USBSERIAL
+#ifdef TARGET_STM32L432KC
+#define HELTECL432_REV1
+#define FEATURE_LORA
+#define FEATURE_USBSERIAL
+// #define FEATURE_LORA_PING_PONG
 #endif
 
-
-
-#if defined(TARGET_DISCO_L072CZ_LRWAN1)
-#define LED             LED2
+#ifdef HELTECL432_REV1
+#define USER_BUTTON     (PinName) 0x73 // PH_3 boot pin
+#define USER_BUTTON_RISE
+#define STATUS_LED      PB_1	// green LED
+#define LED2            PB_0	// red LED
+#define LED				STATUS_LED
+#define BATPOWER_EN		PA_8	// high indicates power source is battery, removable bridge
+#define BATPOWER_EXT	1
 
-#define LORA_SPI_MOSI   PA_7
-#define LORA_SPI_MISO   PA_6
-#define LORA_SPI_SCLK   PB_3
-#define LORA_CS         PA_15
-#define LORA_RESET      PC_0
-#define LORA_DIO0       PB_4
-#define LORA_DIO1       PB_1
-#define LORA_DIO2       PB_0
-#define LORA_DIO3       PC_13
-#define LORA_DIO4       PA_5
-#define LORA_DIO5       PA_4
-#define LORA_ANT_RX     PA_1
-#define LORA_ANT_TX     PC_2
-#define LORA_ANT_BOOST  PC_1
-#define LORA_TCXO       PA_12   // 32 MHz
-
+#define SPI_LSM_MOSI    PA_7
+#define SPI_LSM_MISO    PA_6
+#define SPI_LSM_SCLK    PA_5
+#define CS_FLASH        NC
 
-
-#elif defined(TARGET_NUCLEO_L476RG) // using the RFM95 board
-
-#define LORA_SPI_MOSI   PC_12
-#define LORA_SPI_MISO   PC_11
-#define LORA_SPI_SCLK   PC_10
-#define LORA_CS         PA_0
-#define LORA_RESET      PA_1
-#define LORA_DIO0       PD_2    // DIO0=TxDone/RXDone
-#define LORA_DIO1       PB_7    //
-#define LORA_DIO2       PC_14   // DIO2=FhssChangeChannel
-#define LORA_DIO3       PC_15   // DIO3=CADDone
-#define LORA_DIO4       PH_0    // ????
-#define LORA_DIO5       NC      // unused?
-
-#elif defined (HELTEC_STM32L4)
+#define EXT_POWER_SW	PA_3	// VEXT on/off
+#define EXT_POWER_ON    0
+#define EXT_POWER_OFF   1
 
-#define USER_BUTTON     PH_3    // boot pin
-#define LED             PB_0    // red
-#define LED2            PB_1    // green
-#define LED1            LED
-
-#define POWER_VEXT      PA_3
-#define POWER_VEXT_ON   0
-#define POWER_VEXT_OFF  1
-
-
-#define LORA_SPI_MOSI   PA_7
-#define LORA_SPI_MISO   PA_6
-#define LORA_SPI_SCLK   PA_5
-#define LORA_CS         PA_4
+#define LORA_SPI_MOSI   SPI_LSM_MOSI
+#define LORA_SPI_MISO   SPI_LSM_MISO
+#define LORA_SPI_SCLK   SPI_LSM_SCLK
+#define LORA_CS			PA_4
 #define LORA_RESET      PA_1
-#define LORA_DIO0       PA_0    // DIO0=TxDone/RXDone/CADDone
-#define LORA_DIO1       NC      //
-#define LORA_DIO2       NC      // 
-#define LORA_DIO3       NC      // 
-#define LORA_DIO4       NC      // 
-#define LORA_DIO5       NC      // 
+#define LORA_DIO0       PA_0	// used for Rx, Tx Interrupt
+#define LORA_DIO1       NC 		// PB_6Fifo Level/Full, RxTimeout/Cad Detection Interrupt, unused in RadioShuttle
+#define LORA_DIO2      	NC		// FhssChangeChannel when FreqHop is on, unused in RadioShuttle
+#define LORA_DIO3       NC		// optionally Cad Detection in RS_Node_Offline/Checking mode
+#define LORA_DIO4       NC		// FSK mode preamble detected, unused in RadioShuttle
+#define LORA_DIO5       NC		// FSK mode ready / ClockOut, unused in RadioShuttle
+#define LORA_ANT_PWR	EXT_POWER_SW // the analog switch is getting turned off go save energy
 
-#elif defined(TARGET_NUCLEO_L432KC) // using the RFM95 board
-
-// #define LED             PB_3    // green
-#define LED             PB_5    // green
+/* this following are available pins for custom use */
+#define P_SWLCK		PA_14	// available only when no debugger is being used.
+#define P_SWDIO		PA_13	// available only when no debugger is being used
+#define P_SWO		PB_3	// available only when no SWO debugging output is being used
+#define P_PA_2_TX	PA_2	// available only when no debug serial console is being used
+#define P_PA_15_RX	PA_15	// available only when no debug serial console is being used
+#define	P_PA_9_SCL	PA_9	// SCL includes 10k removable hardware pullup
+#define P_PA_10_SCA	PA_10	// SCL includes 10k removable hardware pullup
+#define	P_PB_4		PB_4
+#define P_PB_5		PB_5
+#define P_PB_6		PB_6
+#define	P_PB_7		PB_7
 
-#define LORA_SPI_MOSI   PA_7
-#define LORA_SPI_MISO   PA_6
-#define LORA_SPI_SCLK   PB_5
-#define LORA_CS         PA_4
-#define LORA_RESET      PA_1
-#define LORA_DIO0       PA_0    // DIO0=TxDone/RXDone/CADDone
-#define LORA_DIO1       NC      //
-#define LORA_DIO2       NC      // 
-#define LORA_DIO3       NC      // 
-#define LORA_DIO4       NC      // 
-#define LORA_DIO5       NC      //
+#define WatchDogUpdate() void()
 
-
-#else 
-
-#error "unknown board"
-
-#endif
\ No newline at end of file
+#else
+ #error "unknown board"
+#endif