basic LoRa transmitter example

Dependencies:   sx12xx_hal

radio chip selection

Radio chip driver is not included, allowing choice of radio device.
If you're using SX1272 or SX1276, then import sx127x driver into your program.
if you're using SX1261 or SX1262, then import sx126x driver into your program.
if you're using SX1280, then import sx1280 driver into your program.
if you're using LR1110, then import LR1110 driver into your program.
If you're using NAmote72 or Murata discovery, then you must import only sx127x driver.
If you're using Type1SJ select target DISCO_L072CZ_LRWAN1 and import sx126x driver into your program.

Use project simple_rx on receiving end.

Revision:
4:938655f1726c
Parent:
2:3f4dfcc3bab6
--- a/main.cpp	Mon Apr 06 10:25:15 2020 -0700
+++ b/main.cpp	Fri Feb 05 16:35:59 2021 -0800
@@ -1,20 +1,19 @@
 #include "radio.h"
 
-#if defined(SX127x_H)
-    #define BW_KHZ              125
-    #define SPREADING_FACTOR    7
-    #define CF_HZ               915000000
-    #define TX_DBM              20
-#elif defined(SX126x_H)
-    #define BW_KHZ              125
-    #define SPREADING_FACTOR    7
-    #define CF_HZ               915000000
-    #define TX_DBM              (Radio::chipType == CHIP_TYPE_SX1262 ? 20 : 14) 
-#elif defined(SX128x_H)
+#if defined(SX128x_H)
     #define BW_KHZ              200
     #define SPREADING_FACTOR    7
     #define CF_HZ               2487000000
     #define TX_DBM              6
+#else
+    #if defined(SX126x_H)
+        #define TX_DBM              (Radio::chipType == CHIP_TYPE_SX1262 ? 20 : 14)
+    #else
+        #define TX_DBM              20
+    #endif
+    #define BW_KHZ              125
+    #define SPREADING_FACTOR    7
+    #define CF_HZ               915000000
 #endif
 
 /**********************************************************************/
@@ -22,7 +21,7 @@
 
 void tx_test()
 {
-    uint8_t seq = 0;
+    static uint8_t seq = 0;
 
     Radio::radio.tx_buf[0] = seq++;  /* set payload */
     Radio::Send(1, 0, 0, 0);   /* begin transmission */
@@ -56,7 +55,7 @@
 
 
 const RadioEvents_t rev = {
-    /* DioPin_top_half */     radio_irq_callback,
+    /* DioPin_top_half */   radio_irq_callback,
     /* TxDone_topHalf */    NULL,
     /* TxDone_botHalf */    txDoneCB,
     /* TxTimeout  */        NULL,
@@ -69,8 +68,6 @@
 
 int main()
 {
-    //uint8_t seq = 0;
-
     printf("\r\nreset-tx ");
 
     Radio::Init(&rev);