Skip to content

Commit 64fcece

Browse files
tekka007eiten
andauthored
Fix Jenkins warnings (#1548)
* Added support for ASR650x and SX126x * Added support for ASR650x and SX126x * Fix jenkins warnings --------- Co-authored-by: Eduard Iten <eduard@iten.pro>
1 parent b9c4a4c commit 64fcece

File tree

10 files changed

+2418
-8
lines changed

10 files changed

+2418
-8
lines changed

MyConfig.h

+242-2
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,232 @@
10181018
//#define MY_RFM95_TCXO
10191019
/** @}*/ // End of RFM95SettingGrpPub group
10201020

1021+
/**
1022+
* @defgroup SX126xSettingGrpPub SX126x
1023+
* @ingroup TransportSettingGrpPub
1024+
* @brief These options are specific to the %SX126x family of wireless transport modules.
1025+
*
1026+
* The following chips are supported by this driver:
1027+
* - Semtech sx1261
1028+
* - Semtech sx1262
1029+
* @{
1030+
*/
1031+
1032+
/**
1033+
* @def MY_RADIO_SX126x
1034+
* @brief Define this to use SX126x based radios for sensor network communication.
1035+
*/
1036+
//#define MY_RADIO_SX126x
1037+
1038+
/**
1039+
* @def MY_SX126x_CS_PIN
1040+
* @brief sx126x SPI chip select pin.
1041+
*/
1042+
#ifndef MY_SX126x_CS_PIN
1043+
#define MY_SX126x_CS_PIN DEFAULT_SX126x_CS_PIN
1044+
#endif
1045+
1046+
/**
1047+
* @def MY_SX126x_IRQ_PIN
1048+
* @brief xs126x IRQ pin (DIO1)
1049+
*/
1050+
#ifndef MY_SX126x_IRQ_PIN
1051+
#define MY_SX126x_IRQ_PIN DEFAULT_SX126x_IRQ_PIN
1052+
#endif
1053+
1054+
/**
1055+
* @def MY_SX126x_FREQUENCY
1056+
* @brief The frequency to use.
1057+
*
1058+
* - SX126x_169MHZ
1059+
* - SX126x_315MHZ
1060+
* - SX126x_434MHZ
1061+
* - SX126x_868MHZ
1062+
* - SX126x_915MHZ
1063+
* - Custom frequency in Hz
1064+
*
1065+
* This must match the hardware version of the SX126x radio.
1066+
* Additional information: https://en.wikipedia.org/wiki/Short_Range_Devices
1067+
*/
1068+
#ifndef MY_SX126x_FREQUENCY
1069+
#define MY_SX126x_FREQUENCY (SX126x_868MHZ)
1070+
#endif
1071+
1072+
/**
1073+
* @def MY_SX126x_LORA_SF
1074+
* @brief The LoRa spreading factor to use
1075+
*
1076+
* can be LORA_SF5, LORA_SF6, LORA_SF7, LORA_SF8, LORA_SF9, LORA_SF10,
1077+
* LORA_SF11 or LORA_SF12
1078+
*
1079+
* default is LORA_SF7
1080+
*/
1081+
#ifndef MY_SX126x_LORA_SF
1082+
#define MY_SX126x_LORA_SF LORA_SF7
1083+
#endif
1084+
1085+
/**
1086+
* @def MY_SX126x_LORA_BW
1087+
* @brief The LoRa bandwidth to use
1088+
*
1089+
* possible values
1090+
* | value | Bandwith |
1091+
* |-------------|-----------|
1092+
* | LORA_BW_500 | 500 kHz |
1093+
* | LORA_BW_250 | 250 kHz |
1094+
* | LORA_BW_125 | 125 kHz |
1095+
* | LORA_BW_062 | 62.5 kHz |
1096+
* | LORA_BW_041 | 41.67 kHz |
1097+
* | LORA_BW_031 | 31.25 kHz |
1098+
* | LORA_BW_020 | 20.83 kHz |
1099+
* | LORA_BW_015 | 15.63 kHz |
1100+
* | LORA_BW_010 | 10.45 kHz |
1101+
* | LORA_BW_007 | 7.81 kHz |
1102+
*
1103+
* default is LORA_BW_125
1104+
*/
1105+
#ifndef MY_SX126x_LORA_BW
1106+
#define MY_SX126x_LORA_BW LORA_BW_125
1107+
#endif
1108+
1109+
/**
1110+
* @def MY_SX126x_LORA_CR
1111+
* @brief The LoRa coding rate to use
1112+
*
1113+
* Possible values are
1114+
* | value | Coding rate |
1115+
* |-------------|-------------|
1116+
* | LORA_CR_4_5 | 4/5 |
1117+
* | LORA_CR_4_6 | 4/6 |
1118+
* | LORA_CR_4_7 | 4/7 |
1119+
* | LORA_CR_4_8 | 4/8 |
1120+
*
1121+
* Default is LORA_CR_4_5
1122+
*/
1123+
#ifndef MY_SX126x_LORA_CR
1124+
#define MY_SX126x_LORA_CR LORA_CR_4_5
1125+
#endif
1126+
1127+
/**
1128+
* @def MY_SX126x_TCXO_VOLTAGE
1129+
* @brief TCXO output voltage for internal TCXO control
1130+
*
1131+
* If set, DIO3 will be used to provide power to the TCXO when needed
1132+
*
1133+
* SX126x_TCXO_1V6 1.6V TCXO voltage
1134+
* SX126x_TCXO_1V7 1.7V TCXO voltage
1135+
* SX126x_TCXO_1V8 1.8V TCXO voltage
1136+
* SX126x_TCXO_2V2 2.2V TCXO voltage
1137+
* SX126x_TCXO_2V4 2.4V TCXO voltage
1138+
* SX126x_TCXO_2V7 2.7V TCXO voltage
1139+
* SX126x_TCXO_3V0 3.0V TCXO voltage
1140+
* SX126x_TCXO_3V3 3.3V TCXO voltage
1141+
*
1142+
* However, the TCXO output voltage is at most 200mV below the supply voltage.
1143+
**/
1144+
//#define MY_SX126x_TCXO_VOLTAGE (SX126x_TCXO_3V3)
1145+
1146+
1147+
/**
1148+
* @def MY_SX126c_TCXO_STARTUP_DELAY
1149+
* @brief Time in ms it takes the TXCO to start up and stabilize
1150+
*
1151+
* Will be set to 10ms if @ref MY_SX126x_TCXO_VOLTAGE is set but @ref MY_SX126c_TCXO_STARTUP_DELAY
1152+
* is not set.
1153+
**/
1154+
#if !defined(MY_SX126c_TCXO_STARTUP_DELAY) && defined(MY_SX126x_TCXO_VOLTAGE)
1155+
#define MY_SX126c_TCXO_STARTUP_DELAY (10)
1156+
#endif
1157+
1158+
/**
1159+
* @def MY_SX126x_USE_TCXO
1160+
* @brief The board has a TCXO for SX126x frequency generation
1161+
*
1162+
* This will be forced if @ref MY_SX126x_TCXO_VOLTAGE or @ref MY_SX126c_TCXO_STARTUP_DELAY are set
1163+
**/
1164+
#if !defined(MY_SX126x_USE_TCXO) && defined(MY_SX126x_TCXO_VOLTAGE)
1165+
#define MY_SX126x_USE_TCXO
1166+
#endif
1167+
1168+
/**
1169+
* @def MY_SX126x_USE_DIO2_ANT_SWITCH
1170+
* @brief Use DIO2 as antenna switch output.
1171+
*/
1172+
//#define MY_SX126x_USE_DIO2_ANT_SWITCH
1173+
1174+
/**
1175+
* @def MY_SX126x_ANT_SWITCH_PIN
1176+
* @brief Pin to switch antenna circuit between RX and TX mode
1177+
*
1178+
* Not needed if DIO2 is connected to the antenna switch circuit. Then you have to set
1179+
* @ref MY_SX126x_USE_DIO2_ANT_SWITCH
1180+
*/
1181+
//#define MY_SX126x_ANT_SWITCH_PIN (GPIO3)
1182+
1183+
/**
1184+
* @def MY_SX126x_VARIANT
1185+
* @brief details if it's a sx1261 or sx1262
1186+
*
1187+
* - 1: sx1261
1188+
* - 2: sx1262
1189+
* If not set, sx1262 is selected
1190+
*/
1191+
#if !defined(MY_SX126x_VARIANT)
1192+
#define MY_SX126x_VARIANT (1)
1193+
#endif
1194+
1195+
/**
1196+
* @def MY_SX126x_POWER_PIN
1197+
* @brief Define this to use the SX126x power pin (optional).
1198+
*/
1199+
//#define MY_SX126x_POWER_PIN (3)
1200+
1201+
/**
1202+
* @def MY_SX126x_RESET_PIN
1203+
* @brief Define this to use the SX126x reset pin (optional).
1204+
*/
1205+
//#define MY_SX126x_RESET_PIN (47)
1206+
1207+
/**
1208+
* @def MY_SX126x_BUSY_PIN
1209+
* @brief Defines this to use the SX126x busy pin (optional).
1210+
*/
1211+
//#define MY_SX126x_BUSY_PIN (39)
1212+
1213+
/**
1214+
* @def MY_SX126x_DISABLE_ATC
1215+
* @brief If defined, ATC will be disabled
1216+
*/
1217+
//#define MY_SX126x_DISABLE_ATC
1218+
1219+
/**
1220+
* @def MY_SX126x_ATC_TARGET_DBM
1221+
* @brief Sets the target RSSI level for the ATC. Defaults to -70dBm
1222+
*/
1223+
#ifndef MY_SX126x_ATC_TARGET_DBM
1224+
#define MY_SX126x_ATC_TARGET_DBM (-70)
1225+
#endif
1226+
1227+
/**
1228+
* @def MY_SX126x_MAX_POWER_LEVEL_DBM
1229+
* @brief Sets the maximum allowable output power level. Default: 13dBm (20mW)
1230+
*
1231+
* Please check local regulations!
1232+
*/
1233+
#ifndef MY_SX126x_MAX_POWER_LEVEL_DBM
1234+
#define MY_SX126x_MAX_POWER_LEVEL_DBM (20)
1235+
#endif
1236+
1237+
/**
1238+
* @def MY_SX126x_MIN_POWER_LEVEL_DBM
1239+
* @brief Sets the minimum output power level. Used in ATC. Default: 0dBm (0.5mW)
1240+
*/
1241+
#ifndef MY_SX126x_MIN_POWER_LEVEL_DBM
1242+
#define MY_SX126x_MIN_POWER_LEVEL_DBM (-3)
1243+
#endif
1244+
1245+
/** @}*/ // End of SX126xSettingGrpPub group
1246+
10211247
/**
10221248
* @defgroup SoftSpiSettingGrpPub Soft SPI
10231249
* @ingroup TransportSettingGrpPub
@@ -2297,7 +2523,7 @@
22972523
#define MY_DEBUG_VERBOSE_OTA_UPDATE //!< MY_DEBUG_VERBOSE_OTA_UPDATE
22982524
#endif
22992525

2300-
#if defined(MY_DEBUG) || defined(MY_DEBUG_VERBOSE_CORE) || defined(MY_DEBUG_VERBOSE_TRANSPORT) || defined(MY_DEBUG_VERBOSE_GATEWAY) || defined(MY_DEBUG_VERBOSE_SIGNING) || defined(MY_DEBUG_VERBOSE_OTA_UPDATE) || defined(MY_DEBUG_VERBOSE_RF24) || defined(MY_DEBUG_VERBOSE_NRF5_ESB) || defined(MY_DEBUG_VERBOSE_RFM69) || defined(MY_DEBUG_VERBOSE_RFM95) || defined(MY_DEBUG_VERBOSE_TRANSPORT_HAL)
2526+
#if defined(MY_DEBUG) || defined(MY_DEBUG_VERBOSE_CORE) || defined(MY_DEBUG_VERBOSE_TRANSPORT) || defined(MY_DEBUG_VERBOSE_GATEWAY) || defined(MY_DEBUG_VERBOSE_SIGNING) || defined(MY_DEBUG_VERBOSE_OTA_UPDATE) || defined(MY_DEBUG_VERBOSE_RF24) || defined(MY_DEBUG_VERBOSE_NRF5_ESB) || defined(MY_DEBUG_VERBOSE_RFM69) || defined(MY_DEBUG_VERBOSE_RFM95) || defined(MY_DEBUG_VERBOSE_SX126x) || defined(MY_DEBUG_VERBOSE_TRANSPORT_HAL)
23012527
#define DEBUG_OUTPUT_ENABLED //!< DEBUG_OUTPUT_ENABLED
23022528
#ifndef MY_DEBUG_OTA
23032529
#define DEBUG_OUTPUT(x,...) hwDebugPrint(x, ##__VA_ARGS__) //!< debug
@@ -2316,6 +2542,7 @@
23162542
#undef MY_DEBUG_VERBOSE_RFM69
23172543
#undef MY_DEBUG_VERBOSE_RFM69_REGISTERS
23182544
#undef MY_DEBUG_VERBOSE_RFM95
2545+
#undef MY_DEBUG_VERBOSE_SX126x
23192546
#endif
23202547
#else
23212548
#define DEBUG_OUTPUT(x,...) //!< debug NULL
@@ -2328,7 +2555,7 @@
23282555
#endif
23292556

23302557
// Enable sensor network "feature" if one of the transport types was enabled
2331-
#if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485) || defined(MY_PJON)
2558+
#if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RADIO_SX126x) || defined(MY_RS485) || defined(MY_PJON)
23322559
#define MY_SENSOR_NETWORK
23332560
#endif
23342561

@@ -2536,6 +2763,19 @@
25362763
#define MY_RFM95_POWER_PIN
25372764
#define MY_RFM95_TCXO
25382765
#define MY_RFM95_MAX_POWER_LEVEL_DBM
2766+
// SX126x
2767+
#define MY_RADIO_SX126x
2768+
#define MY_SX126x_TCXO_VOLTAGE
2769+
#define MY_SX126c_TCXO_STARTUP_DELAY
2770+
#define MY_SX126x_USE_TCXO
2771+
#define MY_SX126x_USE_DIO2_ANT_SWITCH
2772+
#define MY_SX126x_ANT_SWITCH_PIN
2773+
#define MY_SX126x_POWER_PIN
2774+
#define MY_SX126x_RESET_PIN
2775+
#define MY_SX126x_BUSY_PIN
2776+
#define MY_SX126x_DISABLE_ATC
2777+
#define MY_SX126x_MIN_POWER_LEVEL_DBM
2778+
#define MY_SX126x_MAX_POWER_LEVEL_DBM
25392779
// SOFT-SPI
25402780
#define MY_SOFTSPI
25412781
#endif

MySensors.h

+20-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* network topology allowing messages to be routed to nodes.
77
*
88
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
9-
* Copyright (C) 2013-2022 Sensnology AB
9+
* Copyright (C) 2013-2023 Sensnology AB
1010
* Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
1111
*
1212
* Documentation: http://www.mysensors.org
@@ -76,6 +76,9 @@
7676
#elif defined(__arm__) && defined(TEENSYDUINO)
7777
#include "hal/architecture/Teensy3/MyHwTeensy3.cpp"
7878
#include "hal/crypto/generic/MyCryptoGeneric.cpp"
79+
#elif defined(__ASR6501__) || defined (__ASR6502__)
80+
#include "hal/architecture/ASR650x/MyHwASR650x.cpp"
81+
#include "hal/crypto/generic/MyCryptoGeneric.cpp"
7982
#elif defined(__linux__)
8083
#include "hal/architecture/Linux/MyHwLinuxGeneric.cpp"
8184
#include "hal/crypto/generic/MyCryptoGeneric.cpp"
@@ -290,8 +293,12 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
290293
#else
291294
#define _PJONCNT 0 //!< _PJONCNT
292295
#endif
293-
294-
#if (__RF24CNT + __NRF5ESBCNT + __RFM69CNT + __RFM95CNT + __RS485CNT + _PJONCNT > 1)
296+
#if defined(MY_RADIO_SX126x)
297+
#define __SX126xCNT 1 //!< __SX126xCNT
298+
#else
299+
#define __SX126xCNT 0 //!< __SX126xCNT
300+
#endif
301+
#if (__RF24CNT + __NRF5ESBCNT + __RFM69CNT + __RFM95CNT + __RS485CNT + _PJONCNT + __SX126xCNT > 1)
295302
#error Only one forward link driver can be activated
296303
#endif
297304
#endif //DOXYGEN
@@ -302,7 +309,7 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
302309
#endif
303310

304311
// TRANSPORT INCLUDES
305-
#if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485) || defined (MY_PJON)
312+
#if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485) || defined (MY_PJON) || defined(MY_RADIO_SX126x)
306313
#include "hal/transport/MyTransportHAL.h"
307314
#include "core/MyTransport.h"
308315

@@ -326,7 +333,7 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
326333
#define MY_RAM_ROUTING_TABLE_ENABLED
327334
#elif defined(MY_RAM_ROUTING_TABLE_FEATURE) && defined(MY_REPEATER_FEATURE)
328335
// activate feature based on architecture
329-
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_NRF5) || defined(ARDUINO_ARCH_STM32F1) || defined(TEENSYDUINO) || defined(__linux__)
336+
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_NRF5) || defined(ARDUINO_ARCH_STM32F1) || defined(TEENSYDUINO) || defined(__linux__) || defined(__ASR6501__) || defined (__ASR6502__)
330337
#define MY_RAM_ROUTING_TABLE_ENABLED
331338
#elif defined(ARDUINO_ARCH_AVR)
332339
#if defined(__avr_atmega1280__) || defined(__avr_atmega1284__) || defined(__avr_atmega2560__)
@@ -350,7 +357,7 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
350357

351358
// POWER PIN
352359
#ifndef DOXYGEN
353-
#if defined(MY_RF24_POWER_PIN) || defined(MY_RFM69_POWER_PIN) || defined(MY_RFM95_POWER_PIN) || defined(MY_RADIO_NRF5_ESB)
360+
#if defined(MY_RF24_POWER_PIN) || defined(MY_RFM69_POWER_PIN) || defined(MY_RFM95_POWER_PIN) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_SX126x_POWER_PIN)
354361
#define RADIO_CAN_POWER_OFF (true)
355362
#else
356363
#define RADIO_CAN_POWER_OFF (false)
@@ -393,6 +400,9 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
393400
#error "You must change PJON_BROADCAST to BROADCAST_ADDRESS (255u) and PJON_NOT_ASSIGNED to other one."
394401
#endif
395402
#include "hal/transport/PJON/MyTransportPJON.cpp"
403+
#elif defined(MY_RADIO_SX126x)
404+
#include "hal/transport/SX126x/driver/SX126x.cpp"
405+
#include "hal/transport/SX126x/MyTransportSX126x.cpp"
396406
#endif
397407

398408
#if (defined(MY_RF24_ENABLE_ENCRYPTION) && defined(MY_RADIO_RF24)) || (defined(MY_NRF5_ESB_ENABLE_ENCRYPTION) && defined(MY_RADIO_NRF5_ESB)) || (defined(MY_RFM69_ENABLE_ENCRYPTION) && defined(MY_RADIO_RFM69)) || (defined(MY_RFM95_ENABLE_ENCRYPTION) && defined(MY_RADIO_RFM95))
@@ -459,8 +469,12 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
459469
#include "hal/architecture/Linux/MyMainLinuxGeneric.cpp"
460470
#elif defined(ARDUINO_ARCH_STM32F1)
461471
#include "hal/architecture/STM32F1/MyMainSTM32F1.cpp"
472+
#elif defined(__ASR6501__) || defined(__ASR6502__)
473+
#include "hal/architecture/ASR650x/MyMainASR650x.cpp"
462474
#elif defined(__arm__) && defined(TEENSYDUINO)
463475
#include "hal/architecture/Teensy3/MyMainTeensy3.cpp"
476+
#elif defined(ARDUINO_ARCH_CUBECELL)
477+
#include "hal/architecture/ASR650x/MyMainASR650x.cpp"
464478
#endif
465479

466480
#endif

0 commit comments

Comments
 (0)