]> git.tnoah.ca Git - lora-radio.git/commitdiff
Board defines for T3S3-SX1280
authorMark Qvist <mark@unsigned.io>
Fri, 3 Jan 2025 10:54:48 +0000 (11:54 +0100)
committerMark Qvist <mark@unsigned.io>
Fri, 3 Jan 2025 10:54:48 +0000 (11:54 +0100)
Boards.h
Makefile
sx128x.cpp

index d2b4a6fb6df5ad3bf5812782304a4c5def0396a0..95856a7145539ec34086f53d813deda48f2b6c8e 100644 (file)
--- a/Boards.h
+++ b/Boards.h
@@ -46,6 +46,7 @@
   #define MODEL_A5            0xA5 // RNode v2.2, 433 MHz with SX1278
   #define MODEL_A6            0xA6 // RNode v2.2, 868 MHz with SX1262
   #define MODEL_AA            0xAA // RNode v2.2, 868 MHz with SX1276
+  #define MODEL_AB            0xAB // RNode v2.2, 2.4 GHz with SX1280
 
   #define PRODUCT_TBEAM       0xE0 // T-Beam devices
   #define BOARD_TBEAM         0x33
         const int pin_busy = 34;
         const int pin_dio = 33;
         const int pin_tcxo_enable = -1;
+      #elif MODEM == SX1280
+        #define DIO2_AS_RF_SWITCH true
+        #define HAS_BUSY true
+        #define HAS_TCXO true
+        #define HAS_PA true
+        const int pa_max_input = 3;
+        const int pin_busy = 36;
+        const int pin_dio = 9;
+        const int pin_tcxo_enable = -1;
+        const int pin_rxen = -1;
+        const int pin_txen = -1;
       #else
         const int pin_dio = 9;
       #endif
index 0d0fb51dd829745928b384acfd57463e2c5a8ae3..f562f8cefa70b36a25126d2b6d71eb12a7f1fc69 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -81,6 +81,9 @@ firmware-t3s3:
 firmware-t3s3_sx127x:
        arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DMODEM=0x01\""
 
+firmware-t3s3_sx1280:
+       arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DMODEM=0x04\""
+
 firmware-tdeck:
        arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3B\""
 
index ecd87a0c73b8c1e9ccbf5ff182b9602e63db6801..402953da440474a1521dc16d8a0b579dd842433f 100644 (file)
@@ -683,11 +683,15 @@ void sx128x::disableTCXO() {
 }
 
 void sx128x::setTxPower(int level, int outputPin) {
+  #if HAS_PA == true
+    if (level > pa_max_input) { level = pa_max_input; }
+  #else
     if (level > 13) {
         level = 13;
     } else if (level < -18) {
         level = -18;
     }
+  #endif
 
     _txp = level;