|
1018 | 1018 | //#define MY_RFM95_TCXO
|
1019 | 1019 | /** @}*/ // End of RFM95SettingGrpPub group
|
1020 | 1020 |
|
| 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 | + |
1021 | 1247 | /**
|
1022 | 1248 | * @defgroup SoftSpiSettingGrpPub Soft SPI
|
1023 | 1249 | * @ingroup TransportSettingGrpPub
|
|
2297 | 2523 | #define MY_DEBUG_VERBOSE_OTA_UPDATE //!< MY_DEBUG_VERBOSE_OTA_UPDATE
|
2298 | 2524 | #endif
|
2299 | 2525 |
|
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) |
2301 | 2527 | #define DEBUG_OUTPUT_ENABLED //!< DEBUG_OUTPUT_ENABLED
|
2302 | 2528 | #ifndef MY_DEBUG_OTA
|
2303 | 2529 | #define DEBUG_OUTPUT(x,...) hwDebugPrint(x, ##__VA_ARGS__) //!< debug
|
|
2316 | 2542 | #undef MY_DEBUG_VERBOSE_RFM69
|
2317 | 2543 | #undef MY_DEBUG_VERBOSE_RFM69_REGISTERS
|
2318 | 2544 | #undef MY_DEBUG_VERBOSE_RFM95
|
| 2545 | +#undef MY_DEBUG_VERBOSE_SX126x |
2319 | 2546 | #endif
|
2320 | 2547 | #else
|
2321 | 2548 | #define DEBUG_OUTPUT(x,...) //!< debug NULL
|
|
2328 | 2555 | #endif
|
2329 | 2556 |
|
2330 | 2557 | // 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) |
2332 | 2559 | #define MY_SENSOR_NETWORK
|
2333 | 2560 | #endif
|
2334 | 2561 |
|
|
2536 | 2763 | #define MY_RFM95_POWER_PIN
|
2537 | 2764 | #define MY_RFM95_TCXO
|
2538 | 2765 | #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 |
2539 | 2779 | // SOFT-SPI
|
2540 | 2780 | #define MY_SOFTSPI
|
2541 | 2781 | #endif
|
|
0 commit comments