add factory firmware support t-beam-1w-lr1121 and lr2021
This commit is contained in:
parent
0658572eee
commit
a2be16de05
4 changed files with 421 additions and 97 deletions
|
|
@ -4,11 +4,19 @@
|
|||
* @license MIT
|
||||
* @copyright Copyright (c) 2024 Shenzhen Xin Yuan Electronic Technology Co., Ltd
|
||||
* @date 2024-12-18
|
||||
* @note This example is for T-beam V1.2, T-Beam-BPF, T-Beam SUPREME factory examples
|
||||
* @note This example is for T-beam V1.2, T-Beam-BPF, T-Beam SUPREME factory examples
|
||||
* @note This example is for T-beam V1.2, T-Beam-BPF, T-Beam SUPREME factory examples
|
||||
* @note This example is for T-beam V1.2, T-Beam-BPF, T-Beam SUPREME factory examples
|
||||
*/
|
||||
* @note This example is for T-beam V1.2, T-Beam-BPF,T-Beam-1W-xxxx, T-Beam SUPREME factory examples
|
||||
* @note This example is for T-beam V1.2, T-Beam-BPF,T-Beam-1W-xxxx, T-Beam SUPREME factory examples
|
||||
* @note This example is for T-beam V1.2, T-Beam-BPF,T-Beam-1W-xxxx, T-Beam SUPREME factory examples
|
||||
* @note This example is for T-beam V1.2, T-Beam-BPF,T-Beam-1W-xxxx, T-Beam SUPREME factory examples
|
||||
*
|
||||
* | Board | B1 | B2 |
|
||||
* | ---------------- | ----------- | ------------ |
|
||||
* | T-Bema Supreme | Boot button | Power button |
|
||||
* | T-Bema 1W SX1262 | Boot button | IO17 |
|
||||
* | T-Bema 1W LR1121 | Boot button | IO17 |
|
||||
* | T-Bema 1W LR2021 | Boot button | IO17 |
|
||||
* | | | |
|
||||
**/
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <Wire.h>
|
||||
|
|
@ -78,64 +86,44 @@ static void beginSensor();
|
|||
|
||||
#if defined(USING_SX1276)
|
||||
|
||||
#ifdef T_BEAM_S3_BPF
|
||||
// BPF Freq range : 144Mhz ~ 148MHz
|
||||
#define CONFIG_RADIO_FREQ 144.0
|
||||
#else /*T_BEAM_S3_BPF*/
|
||||
#define CONFIG_RADIO_FREQ 868.0
|
||||
#endif /*T_BEAM_S3_BPF*/
|
||||
|
||||
#define CONFIG_RADIO_OUTPUT_POWER 17
|
||||
#define CONFIG_RADIO_BW 125.0
|
||||
|
||||
int txPowerLevel = CONFIG_RADIO_SUB1G_OUTPUT_POWER;
|
||||
SX1276 radio = new Module(RADIO_CS_PIN, RADIO_DIO0_PIN, RADIO_RST_PIN, RADIO_DIO1_PIN);
|
||||
|
||||
#elif defined(USING_SX1278)
|
||||
#ifdef T_BEAM_S3_BPF
|
||||
// BPF Freq range : 144Mhz ~ 148MHz
|
||||
#define CONFIG_RADIO_FREQ 144.0
|
||||
#else
|
||||
#define CONFIG_RADIO_FREQ 433.0
|
||||
#endif /*T_BEAM_S3_BPF*/
|
||||
|
||||
#define CONFIG_RADIO_OUTPUT_POWER 17
|
||||
#define CONFIG_RADIO_BW 125.0
|
||||
int txPowerLevel = CONFIG_RADIO_SUB1G_OUTPUT_POWER;
|
||||
SX1278 radio = new Module(RADIO_CS_PIN, RADIO_DIO0_PIN, RADIO_RST_PIN, RADIO_DIO1_PIN);
|
||||
|
||||
#elif defined(USING_SX1262)
|
||||
#ifndef CONFIG_RADIO_FREQ
|
||||
#define CONFIG_RADIO_FREQ 868.0
|
||||
#endif
|
||||
#define CONFIG_RADIO_OUTPUT_POWER 22
|
||||
#define CONFIG_RADIO_BW 125.0
|
||||
|
||||
int txPowerLevel = CONFIG_RADIO_SUB1G_OUTPUT_POWER;
|
||||
SX1262 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN);
|
||||
|
||||
#elif defined(USING_SX1280)
|
||||
#define CONFIG_RADIO_FREQ 2400.0
|
||||
#define CONFIG_RADIO_OUTPUT_POWER 13
|
||||
#define CONFIG_RADIO_BW 203.125
|
||||
|
||||
int txPowerLevel = CONFIG_RADIO_2G4_OUTPUT_POWER;
|
||||
SX1280 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN);
|
||||
|
||||
#elif defined(USING_SX1280PA)
|
||||
#define CONFIG_RADIO_FREQ 2400.0
|
||||
#define CONFIG_RADIO_OUTPUT_POWER 3 // PA Version power range : -18 ~ 3dBm
|
||||
#define CONFIG_RADIO_BW 203.125
|
||||
|
||||
int txPowerLevel = CONFIG_RADIO_2G4_OUTPUT_POWER; // PA Version power range : -18 ~ 3dBm
|
||||
SX1280 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN);
|
||||
|
||||
#elif defined(USING_LR1121)
|
||||
|
||||
// The maximum power of LR1121 2.4G band can only be set to 13 dBm
|
||||
#define CONFIG_RADIO_FREQ 2450.0
|
||||
#define CONFIG_RADIO_OUTPUT_POWER 13
|
||||
#define CONFIG_RADIO_BW 125.0
|
||||
// int txPowerLevel = CONFIG_RADIO_2G4_OUTPUT_POWER;
|
||||
|
||||
// The maximum power of LR1121 Sub 1G band can only be set to 22 dBm
|
||||
// #define CONFIG_RADIO_FREQ 868.0
|
||||
// #define CONFIG_RADIO_OUTPUT_POWER 22
|
||||
// #define CONFIG_RADIO_BW 125.0
|
||||
int txPowerLevel = CONFIG_RADIO_SUB1G_OUTPUT_POWER;
|
||||
|
||||
LR1121 radio = new Module(RADIO_CS_PIN, RADIO_DIO_IRQ_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN);
|
||||
|
||||
#elif defined(USING_LR2021)
|
||||
|
||||
int txPowerLevel = CONFIG_RADIO_SUB1G_OUTPUT_POWER;
|
||||
LR2021 radio = new Module(RADIO_CS_PIN, RADIO_IRQ_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN);
|
||||
|
||||
LR1121 radio = new Module(RADIO_CS_PIN, RADIO_DIO9_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN);
|
||||
#endif /*Radio option*/
|
||||
|
||||
|
||||
|
|
@ -145,6 +133,65 @@ LR1121 radio = new Module(RADIO_CS_PIN, RADIO_DIO9_PIN, RADIO_RST_PIN, RADIO_BUS
|
|||
#endif
|
||||
|
||||
|
||||
#if defined(T_BEAM_1W_LR1121)
|
||||
// LR1121 Version PA RF switch table
|
||||
static const uint32_t pa_version_rf_switch_dio_pins[] = {
|
||||
RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6, RADIOLIB_LR11X0_DIO7, RADIOLIB_LR11X0_DIO8, RADIOLIB_NC
|
||||
};
|
||||
|
||||
static const Module::RfSwitchMode_t low_sub1g_switch_table[] = {
|
||||
// mode DIO5 DIO6 DIO7 DIO8
|
||||
{ LR11x0::MODE_STBY, { LOW, LOW, LOW, LOW} },
|
||||
{ LR11x0::MODE_TX, { LOW, LOW, LOW, LOW} },
|
||||
{ LR11x0::MODE_RX, { LOW, LOW, LOW, LOW} },
|
||||
{ LR11x0::MODE_TX_HP, { LOW, LOW, LOW, HIGH} }, //Sub1G DIO8 SET HIGH
|
||||
{ LR11x0::MODE_TX_HF, { LOW, LOW, LOW, LOW} },
|
||||
{ LR11x0::MODE_GNSS, { LOW, LOW, LOW, HIGH} },
|
||||
{ LR11x0::MODE_WIFI, { LOW, LOW, LOW, HIGH} },
|
||||
END_OF_MODE_TABLE,
|
||||
};
|
||||
|
||||
static const Module::RfSwitchMode_t high_2g4_switch_table[] = {
|
||||
// mode DIO5 DIO6 DIO7 DIO8
|
||||
{ LR11x0::MODE_STBY, { LOW, LOW, LOW, LOW} },
|
||||
{ LR11x0::MODE_TX, { LOW, LOW, LOW, LOW} },
|
||||
{ LR11x0::MODE_RX, { LOW, LOW, LOW, LOW} },
|
||||
{ LR11x0::MODE_TX_HP, { LOW, LOW, LOW, LOW} },
|
||||
{ LR11x0::MODE_TX_HF, { LOW, LOW, HIGH, LOW} }, //2.4G TX DIO7 SET HIGH
|
||||
{ LR11x0::MODE_GNSS, { LOW, LOW, LOW, LOW} },
|
||||
{ LR11x0::MODE_WIFI, { LOW, HIGH, LOW, LOW} }, //2.4G RX DIO6 SET HIGH
|
||||
END_OF_MODE_TABLE,
|
||||
};
|
||||
#elif defined(T_BEAM_1W_LR2021)
|
||||
// LR1121 Version PA RF switch table
|
||||
static const uint32_t pa_version_rf_switch_dio_pins[] = {
|
||||
RADIOLIB_LR2021_DIO5, RADIOLIB_LR2021_DIO6, RADIOLIB_LR2021_DIO7, RADIOLIB_LR2021_DIO8, RADIOLIB_NC
|
||||
};
|
||||
|
||||
static const Module::RfSwitchMode_t low_sub1g_switch_table[] = {
|
||||
// mode DIO5 DIO6 DIO7 DIO8
|
||||
{ LR2021::MODE_STBY, { LOW, LOW, LOW, LOW} },
|
||||
{ LR2021::MODE_TX, { LOW, LOW, LOW, HIGH} }, // Sub1G DIO8 SET HIGH
|
||||
{ LR2021::MODE_RX, { LOW, LOW, LOW, LOW} },
|
||||
{ LR2021::MODE_RX_HF, { LOW, LOW, LOW, LOW} },
|
||||
{ LR2021::MODE_TX_HF, { LOW, LOW, LOW, LOW} },
|
||||
END_OF_MODE_TABLE,
|
||||
};
|
||||
|
||||
static const Module::RfSwitchMode_t high_2g4_switch_table[] = {
|
||||
//2.4G RX DIO6 SET HIGH
|
||||
// mode DIO5 DIO6 DIO7 DIO8
|
||||
{ LR2021::MODE_STBY, { LOW, LOW, LOW, LOW} },
|
||||
{ LR2021::MODE_TX, { LOW, LOW, LOW, LOW} },
|
||||
{ LR2021::MODE_RX, { LOW, LOW, LOW, LOW} },
|
||||
{ LR2021::MODE_RX_HF, { HIGH, LOW, LOW, LOW} },
|
||||
{ LR2021::MODE_TX_HF, { LOW, LOW, HIGH, LOW} }, //2.4G TX DIO7 SET HIGH
|
||||
END_OF_MODE_TABLE,
|
||||
};
|
||||
#endif /*T_BEAM_1W_LR1121 | T_BEAM_1W_LR2021*/
|
||||
|
||||
|
||||
|
||||
enum TransmissionDirection {
|
||||
TRANSMISSION,
|
||||
RECEIVE,
|
||||
|
|
@ -165,6 +212,33 @@ uint32_t gps_use_second = 0;
|
|||
uint32_t gps_start_ms = 0;
|
||||
extern uint8_t display_address;
|
||||
|
||||
static uint8_t freq_index = 0;
|
||||
static const float factory_freq[] = {
|
||||
#ifdef T_BEAM_S3_BPF
|
||||
144.0, 148.0
|
||||
#else
|
||||
433.0, 470.0,
|
||||
850.0, 868.0,
|
||||
915.0, 920.0, 923.0,
|
||||
#if defined(USING_LR1121) || defined(USING_LR2021)
|
||||
2400, 2450
|
||||
#endif
|
||||
#endif
|
||||
|
||||
};
|
||||
static const char *freq_table[] = {
|
||||
#ifdef T_BEAM_S3_BPF
|
||||
"144.0MHz", "148.0MHz"
|
||||
#endif
|
||||
"433MHz", "470MHz",
|
||||
"850MHz", "868MHz",
|
||||
"915MHz", "920MHz", "923MHz",
|
||||
#if defined(USING_LR1121) || defined(USING_LR2021)
|
||||
"2400MHz", "2450MHz"
|
||||
#endif
|
||||
};
|
||||
static float current_freq = CONFIG_RADIO_FREQ;
|
||||
|
||||
FrameCallback frames[] = {
|
||||
hwProbe,
|
||||
radioTx,
|
||||
|
|
@ -198,6 +272,8 @@ AceButton button2;
|
|||
#endif /*BUTTON2_PIN*/
|
||||
|
||||
String macStr;
|
||||
volatile bool freqSelectDone = false;
|
||||
volatile bool freqSelectMode = false;
|
||||
|
||||
void setFlag(void)
|
||||
{
|
||||
|
|
@ -218,7 +294,10 @@ void sleepDevice()
|
|||
radio.sleep();
|
||||
|
||||
display->clear();
|
||||
display->drawString(60, 28, "Sleep");
|
||||
|
||||
display->setFont(Roboto_Mono_Medium_12);
|
||||
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
||||
display->drawString(64, 28, "DEVICE ENTER SLEEP");
|
||||
display->display();
|
||||
delay(2000);
|
||||
display->displayOff();
|
||||
|
|
@ -386,7 +465,9 @@ void sleepDevice()
|
|||
* | T-BeamV 1.2 OLED | ~ 450 uA |
|
||||
* | T-BeamV 1.2 | ~ 440 uA |
|
||||
* | T-Beam BPF V1.2 | ~ 350 uA |
|
||||
* | T-Beam 2W v1.0 | ~ 442 uA |
|
||||
* | T-Beam 1W SX1262 | ~ 442 uA |
|
||||
* | T-Beam 1W LR1121 | ~ 450 uA |
|
||||
* | T-Beam 1W LR2021 | ~ 450 uA |
|
||||
* | T-BeamS3 Supreme | ~ 1.45mA |
|
||||
*
|
||||
*/
|
||||
|
|
@ -437,20 +518,22 @@ void handleMenu()
|
|||
#ifdef RADIO_CTRL
|
||||
Serial.println("Turn off LAN,Trun on PA, Enter Tx mode.");
|
||||
/*
|
||||
* 2W and BPF LoRa LAN Control ,set Low turn off LAN , TX Mode
|
||||
* T-Beam 1W SX1262 Version and T-Beam BPF LoRa LAN Control ,set Low turn off LAN , TX Mode
|
||||
* */
|
||||
digitalWrite(RADIO_CTRL, LOW);
|
||||
#endif /*RADIO_CTRL*/
|
||||
|
||||
#ifdef RADIO_TX_CW
|
||||
radio.transmitDirect();
|
||||
{
|
||||
int16_t state = radio.transmitDirect();
|
||||
Serial.printf("transmitDirect:%d\n", state);
|
||||
}
|
||||
#else /*RADIO_TX_CW*/
|
||||
Serial.println("Start transmit");
|
||||
transmissionDirection = TRANSMISSION;
|
||||
transmissionState = radio.transmit((uint8_t *)&transmissionCounter, 4);
|
||||
if (transmissionState != RADIOLIB_ERR_NONE) {
|
||||
Serial.print(F("[Radio] transmit packet failed! err:"));
|
||||
Serial.println(transmissionState);
|
||||
Serial.printf("[Radio] transmit packet failed! err: %d\n", transmissionState);
|
||||
}
|
||||
#endif /*RADIO_TX_CW*/
|
||||
break;
|
||||
|
|
@ -459,7 +542,7 @@ void handleMenu()
|
|||
#ifdef RADIO_CTRL
|
||||
Serial.println("Turn on LAN, Enter Rx mode.");
|
||||
/*
|
||||
* 2W and BPF LoRa LAN Control ,set HIGH turn on LAN ,RX Mode
|
||||
* T-Beam 1W SX1262 Version and T-Beam BPF LoRa LAN Control ,set HIGH turn on LAN ,RX Mode
|
||||
* */
|
||||
digitalWrite(RADIO_CTRL, HIGH);
|
||||
#endif /*RADIO_CTRL*/
|
||||
|
|
@ -467,7 +550,7 @@ void handleMenu()
|
|||
transmissionDirection = RECEIVE;
|
||||
transmissionState = radio.startReceive();
|
||||
if (transmissionState != RADIOLIB_ERR_NONE) {
|
||||
Serial.println(F("[Radio] Received packet failed!"));
|
||||
Serial.printf("[Radio] Received packet failed! err: %d\n", transmissionState);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -475,7 +558,7 @@ void handleMenu()
|
|||
#ifdef RADIO_CTRL
|
||||
Serial.println("Turn on LAN, Enter Rx mode.");
|
||||
/*
|
||||
* 2W and BPF LoRa LAN Control ,set HIGH turn on LAN ,RX Mode
|
||||
* T-Beam 1W SX1262 Version and T-Beam BPF LoRa LAN Control ,set HIGH turn on LAN ,RX Mode
|
||||
* */
|
||||
digitalWrite(RADIO_CTRL, HIGH);
|
||||
#endif /*RADIO_CTRL*/
|
||||
|
|
@ -489,30 +572,42 @@ void prevButtonHandleEvent(AceButton *button, uint8_t eventType, uint8_t butto
|
|||
{
|
||||
switch (eventType) {
|
||||
case AceButton::kEventClicked:
|
||||
Serial.printf("prevButtonHandleEvent currentFrames:%d frames_count:%d\n", currentFrames, max_frames);
|
||||
if (freqSelectMode) {
|
||||
freq_index = (freq_index + 1) % (sizeof(freq_table) / sizeof(freq_table[0]));
|
||||
} else {
|
||||
Serial.printf("prevButtonHandleEvent currentFrames:%d frames_count:%d\n", currentFrames, max_frames);
|
||||
#ifdef BUTTON2_PIN
|
||||
currentFrames = ((currentFrames + 1) >= max_frames) ? currentFrames : currentFrames + 1;
|
||||
currentFrames = ((currentFrames + 1) >= max_frames) ? currentFrames : currentFrames + 1;
|
||||
#else /*BUTTON2_PIN*/
|
||||
currentFrames++;
|
||||
currentFrames %= max_frames;
|
||||
currentFrames++;
|
||||
currentFrames %= max_frames;
|
||||
#endif /*BUTTON2_PIN*/
|
||||
handleMenu();
|
||||
handleMenu();
|
||||
}
|
||||
break;
|
||||
case AceButton::kEventLongPressed:
|
||||
sleepDevice();
|
||||
if (!freqSelectMode) {
|
||||
sleepDevice();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef BUTTON2_PIN
|
||||
void nextButtonHandleEvent(AceButton *button, uint8_t eventType, uint8_t buttonState)
|
||||
{
|
||||
switch (eventType) {
|
||||
case AceButton::kEventClicked:
|
||||
Serial.printf("nextButtonHandleEvent currentFrames:%d frames_count:%d\n", currentFrames, max_frames);
|
||||
currentFrames = ((currentFrames - 1) < 0) ? currentFrames : currentFrames - 1;
|
||||
handleMenu();
|
||||
if (freqSelectMode) {
|
||||
int tableSize = sizeof(freq_table) / sizeof(freq_table[0]);
|
||||
freq_index = (freq_index - 1 < 0) ? (tableSize - 1) : freq_index - 1;
|
||||
} else {
|
||||
Serial.printf("nextButtonHandleEvent currentFrames:%d frames_count:%d\n", currentFrames, max_frames);
|
||||
currentFrames = ((currentFrames - 1) < 0) ? currentFrames : currentFrames - 1;
|
||||
handleMenu();
|
||||
}
|
||||
break;
|
||||
case AceButton::kEventLongPressed:
|
||||
Serial.println("Long pressed!");
|
||||
|
|
@ -520,9 +615,14 @@ void nextButtonHandleEvent(AceButton *button, uint8_t eventType, uint8_t butto
|
|||
Serial.println("Long pressed! ,on/off FAN");
|
||||
digitalWrite(FAN_CTRL, 1 - digitalRead(FAN_CTRL));
|
||||
#endif /*FAN_CTRL*/
|
||||
if (freqSelectMode) {
|
||||
freqSelectDone = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif /*BUTTON2_PIN*/
|
||||
|
||||
|
||||
void timeavailable(struct timeval *t)
|
||||
{
|
||||
|
|
@ -660,7 +760,43 @@ void setup()
|
|||
Serial.printf("[%s]:", RADIO_TYPE_STR);
|
||||
Serial.println(F(" Selected"));
|
||||
|
||||
#if defined(RADIO_TX_CW) && !defined(USING_LR1121)
|
||||
|
||||
/***********************
|
||||
* Frequency Selection
|
||||
***********************/
|
||||
freqSelectMode = true;
|
||||
freqSelectDone = false;
|
||||
freq_index = 0;
|
||||
display->clear();
|
||||
display->setFont(Roboto_Mono_Medium_12);
|
||||
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
||||
while (!freqSelectDone) {
|
||||
display->clear();
|
||||
display->drawString(64, 10, "Select Frequency");
|
||||
display->drawLine(0, 28, 128, 28);
|
||||
display->drawString(64, 32, freq_table[freq_index]);
|
||||
display->drawString(64, 48, "B1:Up B2:Down L:OK");
|
||||
display->display();
|
||||
button.check();
|
||||
#ifdef BUTTON2_PIN
|
||||
button2.check();
|
||||
#endif
|
||||
#ifdef HAS_PMU
|
||||
loopPMU(power_key_pressed, power_key_long_pressed);
|
||||
#endif
|
||||
delay(50);
|
||||
}
|
||||
freqSelectMode = false;
|
||||
current_freq = factory_freq[freq_index];
|
||||
Serial.printf("Selected frequency: %s\n", freq_table[freq_index]);
|
||||
|
||||
|
||||
|
||||
#if defined(USING_LR2021)
|
||||
radio.irqDioNum = RADIO_DIO_NUM;
|
||||
#endif
|
||||
|
||||
#if defined(RADIO_TX_CW) && !defined(USING_LR1121) && !defined(USING_LR2021)
|
||||
Serial.print("Begin Radio FSK ");
|
||||
int state = radio.beginFSK();
|
||||
#else
|
||||
|
|
@ -674,7 +810,11 @@ void setup()
|
|||
Serial.println(F("Failed!"));
|
||||
}
|
||||
|
||||
Serial.printf("Freq:%.2f TxPower:%d Bandwidth:%.2f\n", CONFIG_RADIO_FREQ, CONFIG_RADIO_OUTPUT_POWER, CONFIG_RADIO_BW);
|
||||
Serial.printf("\nRadioParams:\n\t->Freq:%.2fMhz\n\tSub1G TxPower:%d\n\t2.4G TxPower:%d\n\tBandwidth:%.2f\n",
|
||||
factory_freq[freq_index],
|
||||
CONFIG_RADIO_SUB1G_OUTPUT_POWER,
|
||||
CONFIG_RADIO_2G4_OUTPUT_POWER,
|
||||
CONFIG_RADIO_BW);
|
||||
|
||||
#if defined(RADIO_RX_PIN) && defined(RADIO_TX_PIN)
|
||||
//The SX1280 version needs to set RX, TX antenna switching pins
|
||||
|
|
@ -690,7 +830,7 @@ void setup()
|
|||
* LR1121 : Allowed values are in range from 150.0 to 960.0 MHz, 1900 - 2200 MHz and 2400 - 2500 MHz. Will also perform calibrations.
|
||||
* * * */
|
||||
|
||||
if (radio.setFrequency(CONFIG_RADIO_FREQ) == RADIOLIB_ERR_INVALID_FREQUENCY) {
|
||||
if (radio.setFrequency(factory_freq[freq_index]) == RADIOLIB_ERR_INVALID_FREQUENCY) {
|
||||
Serial.println(F("Selected frequency is invalid for this module!"));
|
||||
while (true);
|
||||
}
|
||||
|
|
@ -742,6 +882,13 @@ void setup()
|
|||
}
|
||||
#endif /*RADIO_TX_CW*/
|
||||
|
||||
#if defined(USING_LR1121) || defined(USING_LR2021)
|
||||
if (current_freq < 2400) {
|
||||
txPowerLevel = CONFIG_RADIO_SUB1G_OUTPUT_POWER;
|
||||
} else {
|
||||
txPowerLevel = CONFIG_RADIO_2G4_OUTPUT_POWER;
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Sets transmission output power.
|
||||
* SX1278/SX1276 : Allowed values range from -3 to 15 dBm (RFO pin) or +2 to +17 dBm (PA_BOOST pin). High power +20 dBm operation is also supported, on the PA_BOOST pin. Defaults to PA_BOOST.
|
||||
|
|
@ -749,13 +896,15 @@ void setup()
|
|||
* SX1268 : Allowed values are in range from -9 to 22 dBm.
|
||||
* SX1280 : Allowed values are in range from -18 to 13 dBm. PA Version range : -18 ~ 3dBm
|
||||
* LR1121 : Allowed values are in range from -17 to 22 dBm (high-power PA) or -18 to 13 dBm (High-frequency PA)
|
||||
* LR2021 : Allowed values are in range from -9 to 22 dBm (sub-GHz PA) or -19 to 12 dBm (high-frequency PA).
|
||||
|
||||
* * * */
|
||||
if (radio.setOutputPower(CONFIG_RADIO_OUTPUT_POWER) == RADIOLIB_ERR_INVALID_OUTPUT_POWER) {
|
||||
if (radio.setOutputPower(txPowerLevel) == RADIOLIB_ERR_INVALID_OUTPUT_POWER) {
|
||||
Serial.println(F("Selected output power is invalid for this module!"));
|
||||
while (true);
|
||||
}
|
||||
|
||||
#if !defined(USING_SX1280) && !defined(USING_LR1121) && !defined(USING_SX1280PA)
|
||||
#if !defined(USING_SX1280) && !defined(USING_LR1121) && !defined(USING_SX1280PA) && !defined(USING_LR2021)
|
||||
/*
|
||||
* Sets current limit for over current protection at transmitter amplifier.
|
||||
* SX1278/SX1276 : Allowed values range from 45 to 120 mA in 5 mA steps and 120 to 240 mA in 10 mA steps.
|
||||
|
|
@ -787,7 +936,7 @@ void setup()
|
|||
}
|
||||
|
||||
|
||||
#if defined(USING_LR1121)
|
||||
#if defined(USING_LR1121) && !defined(T_BEAM_1W_LR1121)
|
||||
// LR1121
|
||||
// set RF switch configuration for Wio WM1110
|
||||
// Wio WM1110 uses DIO5 and DIO6 for RF switching
|
||||
|
|
@ -812,6 +961,19 @@ void setup()
|
|||
// LR1121 TCXO Voltage 2.85~3.15V
|
||||
radio.setTCXO(3.0);
|
||||
|
||||
#elif defined(USING_LR1121) || defined(USING_LR2021)
|
||||
|
||||
// radio.setDioIrqParams(RADIOLIB_LR11X0_DIO10);
|
||||
|
||||
if (current_freq < 2400) {
|
||||
Serial.printf("Using low frequency switch table for PA version\n");
|
||||
radio.setRfSwitchTable(pa_version_rf_switch_dio_pins, low_sub1g_switch_table);
|
||||
} else {
|
||||
Serial.printf("Using high frequency switch table for PA version\n");
|
||||
radio.setRfSwitchTable(pa_version_rf_switch_dio_pins, high_2g4_switch_table);
|
||||
}
|
||||
// LR1121 TCXO Voltage 2.85~3.15V
|
||||
radio.setTCXO(3.0);
|
||||
#endif
|
||||
|
||||
#if defined(USING_SX1262)
|
||||
|
|
@ -822,6 +984,7 @@ void setup()
|
|||
// when new packet is received
|
||||
radio.setPacketReceivedAction(setFlag);
|
||||
|
||||
// radio.standby();
|
||||
// start listening for LoRa packets
|
||||
Serial.println(F("[Radio] Starting to listen ... "));
|
||||
state = radio.startReceive();
|
||||
|
|
@ -840,25 +1003,10 @@ void setup()
|
|||
}
|
||||
|
||||
// PMU Power key callback
|
||||
static uint8_t freq_index = 0;
|
||||
const float factory_freq[] = {433.0, 470.0, 850.0, 868.0, 915.0, 923.0
|
||||
#if defined(USING_LR1121)
|
||||
, 2400, 2450
|
||||
#endif
|
||||
|
||||
};
|
||||
float current_freq = CONFIG_RADIO_FREQ;
|
||||
|
||||
void power_key_pressed()
|
||||
void changeFreq()
|
||||
{
|
||||
#if defined(JAPAN_MIC_CERTIFICATION) || defined(T_BEAM_S3_BPF)
|
||||
// Turn on/off display
|
||||
static bool isOn = true;
|
||||
isOn ? display->displayOff() : display->displayOn();
|
||||
isOn ^= 1;
|
||||
return;
|
||||
#else /*defined(JAPAN_MIC_CERTIFICATION) || defined(T_BEAM_S3_BPF)*/
|
||||
|
||||
// Set freq function
|
||||
radio.standby();
|
||||
#if defined(USING_LR1121)
|
||||
|
|
@ -884,6 +1032,15 @@ void power_key_pressed()
|
|||
if (current_freq < 2400) {
|
||||
max_tx_power = 22;
|
||||
forceHighPower = true;
|
||||
// #ifdef T_BEAM_1W_LR1121
|
||||
// Serial.printf("Using low frequency switch table for PA version\n");
|
||||
// radio.setRfSwitchTable(pa_version_rf_switch_dio_pins, high_2g4_switch_table);
|
||||
// #endif
|
||||
} else {
|
||||
// #ifdef T_BEAM_1W_LR1121
|
||||
// Serial.printf("Using high frequency switch table for PA version\n");
|
||||
// radio.setRfSwitchTable(pa_version_rf_switch_dio_pins, low_sub1g_switch_table);
|
||||
// #endif
|
||||
}
|
||||
if (radio.setOutputPower(max_tx_power, forceHighPower) == RADIOLIB_ERR_INVALID_OUTPUT_POWER) {
|
||||
Serial.printf("Selected output power %d is invalid for this module!\n", max_tx_power);
|
||||
|
|
@ -908,6 +1065,33 @@ void power_key_pressed()
|
|||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void power_key_long_pressed()
|
||||
{
|
||||
if (freqSelectMode) {
|
||||
freqSelectDone = true;
|
||||
}
|
||||
}
|
||||
|
||||
void power_key_pressed()
|
||||
{
|
||||
#if defined(JAPAN_MIC_CERTIFICATION) || defined(T_BEAM_S3_BPF)
|
||||
// Turn on/off display
|
||||
static bool isOn = true;
|
||||
isOn ? display->displayOff() : display->displayOn();
|
||||
isOn ^= 1;
|
||||
return;
|
||||
#else /*defined(JAPAN_MIC_CERTIFICATION) || defined(T_BEAM_S3_BPF)*/
|
||||
// changeFreq();
|
||||
if (freqSelectMode) {
|
||||
int tableSize = sizeof(freq_table) / sizeof(freq_table[0]);
|
||||
freq_index = (freq_index - 1 < 0) ? (tableSize - 1) : freq_index - 1;
|
||||
} else {
|
||||
Serial.printf("nextButtonHandleEvent currentFrames:%d frames_count:%d\n", currentFrames, max_frames);
|
||||
currentFrames = ((currentFrames - 1) < 0) ? currentFrames : currentFrames - 1;
|
||||
handleMenu();
|
||||
}
|
||||
#endif /*defined(JAPAN_MIC_CERTIFICATION) || defined(T_BEAM_S3_BPF)*/
|
||||
}
|
||||
|
||||
|
|
@ -1007,7 +1191,7 @@ void radioTx(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t
|
|||
display->drawString(64 + x, 32 + y, buffer);
|
||||
} else {
|
||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||
display->drawString(0 + x, 16 + y, "Freq:" + String(current_freq) + "MHz");
|
||||
display->drawString(0 + x, 16 + y, "Freq:" + String(freq_table[freq_index]));
|
||||
display->drawString(0 + x, 32 + y, "TX :" + String(transmissionCounter));
|
||||
}
|
||||
|
||||
|
|
@ -1073,8 +1257,8 @@ void radioRx(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t
|
|||
} else {
|
||||
// The coordinates define the left starting point of the text
|
||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||
display->drawString(0 + x, 16 + y, "Freq:" + String(current_freq) + "MHz");
|
||||
display->drawString(0 + x, 32 + y, "RX :" + String(recvCounter));
|
||||
display->drawString(0 + x, 16 + y, "Freq:" + String(freq_table[freq_index]));
|
||||
display->drawString(0 + x, 32 + y, "RX :" + String(recvCounter));
|
||||
display->drawString(0 + x, 48 + y, "RSSI:" + String(radioRSSI));
|
||||
}
|
||||
}
|
||||
|
|
@ -1083,6 +1267,7 @@ void hwProbe(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t
|
|||
{
|
||||
display->setFont(Roboto_Mono_Medium_12);
|
||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||
|
||||
#if defined(T_BEAM_S3_SUPREME)
|
||||
display->drawString(x, 3 + y, "6DOF");
|
||||
display->drawString(x, 15 + y, "Power");
|
||||
|
|
@ -1117,6 +1302,7 @@ void hwProbe(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t
|
|||
display->drawString(x, 48 + y, "OLED");
|
||||
|
||||
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
||||
display->drawString(52 + x, 0 + y, BOARD_VARIANT_NAME " " RADIO_TYPE_STR);
|
||||
display->drawString(52 + x, 16 + y, (deviceOnline & RADIO_ONLINE ) ? "+" : "-");
|
||||
|
||||
display->drawString(52 + x, 32 + y, (deviceOnline & GPS_ONLINE ) ? "+" : "-");
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ bool beginPower()
|
|||
|
||||
|
||||
// Set the time of pressing the button to turn off
|
||||
PMU->setPowerKeyPressOffTime(XPOWERS_POWEROFF_4S);
|
||||
PMU->setPowerKeyPressOffTime(XPOWERS_POWEROFF_8S);
|
||||
uint8_t opt = PMU->getPowerKeyPressOffTime();
|
||||
Serial.print("PowerKeyPressOffTime:");
|
||||
switch (opt) {
|
||||
|
|
@ -407,7 +407,7 @@ void disablePeripherals()
|
|||
#endif
|
||||
}
|
||||
|
||||
void loopPMU(void (*pressed_cb)(void))
|
||||
void loopPMU(void (*pressed_cb)(void), void (*long_press_cb)(void))
|
||||
{
|
||||
if (!PMU) {
|
||||
return;
|
||||
|
|
@ -444,6 +444,9 @@ void loopPMU(void (*pressed_cb)(void))
|
|||
}
|
||||
if (PMU->isPekeyLongPressIrq()) {
|
||||
Serial.println("isPekeyLongPress");
|
||||
if (long_press_cb) {
|
||||
long_press_cb();
|
||||
}
|
||||
}
|
||||
if (PMU->isBatChargeDoneIrq()) {
|
||||
Serial.println("isBatChargeDone");
|
||||
|
|
@ -834,7 +837,7 @@ void setupBoards(bool disable_u8g2 )
|
|||
|
||||
#ifdef HAS_GPS
|
||||
|
||||
#if defined(T_BEAM_S3_SUPREME) || defined(T_BEAM_1W) || defined(T_BEAM_S3_BPF)
|
||||
#if defined(T_BEAM_S3_SUPREME) || defined(T_BEAM_1W_SX1262) || defined(T_BEAM_1W_LR1121) || defined(T_BEAM_1W_LR2021) || defined(T_BEAM_S3_BPF)
|
||||
// T-Beam v1.2 skips L76K
|
||||
find_gps = beginGPS();
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ void scanWiFi();
|
|||
#ifdef HAS_PMU
|
||||
extern XPowersLibInterface *PMU;
|
||||
extern bool pmuInterrupt;
|
||||
void loopPMU(void (*pressed_cb)(void));
|
||||
void loopPMU(void (*pressed_cb)(void), void (*long_press_cb)(void) = NULL);
|
||||
bool beginPower();
|
||||
void disablePeripherals();
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
// 3. --------------T3 V3.0 TCXO-------------------------------
|
||||
// Product: https://lilygo.cc/products/t3-tcxo
|
||||
|
||||
// #define T3_V3_0_SX1276_TCXO
|
||||
// #define T3_V3_0_SX1276_TCXO
|
||||
|
||||
// 4. --------------T-BEAM ESP32-------------------------------
|
||||
// Product: https://lilygo.cc/products/t-beam
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
// 6. --------------T3 S3 V1.0 or T3 S3 V1.3 -------------------
|
||||
// Product: https://lilygo.cc/products/t3s3-v1-0 , same v1.3
|
||||
// Product: https://lilygo.cc/products/t3-s3-v1-3
|
||||
// Product: https://lilygo.cc/products/t3-s3-v1-3
|
||||
|
||||
// #define T3_S3_V1_2_SX1262
|
||||
// #define T3_S3_V1_2_SX1276
|
||||
|
|
@ -72,9 +72,10 @@
|
|||
// #define T_BEAM_S3_BPF
|
||||
|
||||
// --------------LoRa 2W -------------------------------------
|
||||
// Product: ...
|
||||
// #define T_BEAM_1W
|
||||
|
||||
// Product: https://lilygo.cc/products/t-beam-1w
|
||||
// #define T_BEAM_1W_SX1262
|
||||
// #define T_BEAM_1W_LR1121
|
||||
// #define T_BEAM_1W_LR2021
|
||||
|
||||
|
||||
// #define T3_V1_6_SX1276_TCXO // Production has stopped
|
||||
|
|
@ -86,7 +87,6 @@
|
|||
|
||||
#if defined(T_BEAM_SX1262) || defined(T_BEAM_SX1276) || defined(T_BEAM_SX1278) || defined(T_BEAM_LR1121)
|
||||
|
||||
|
||||
#if defined(T_BEAM_SX1262)
|
||||
#ifndef USING_SX1262
|
||||
#define USING_SX1262
|
||||
|
|
@ -128,6 +128,7 @@
|
|||
|
||||
// LR1121 Only
|
||||
#define RADIO_DIO9_PIN 33
|
||||
#define RADIO_DIO_IRQ_PIN (RADIO_DIO9_PIN)
|
||||
|
||||
|
||||
#define BOARD_LED 4
|
||||
|
|
@ -330,6 +331,7 @@
|
|||
|
||||
#define RADIO_DIO9_PIN 26 //LR1121 DIO9
|
||||
#define RADIO_BUSY_PIN 32 //LR1121 BUSY
|
||||
#define RADIO_DIO_IRQ_PIN (RADIO_DIO9_PIN)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -384,6 +386,10 @@
|
|||
#ifndef USING_SX1280PA
|
||||
#define USING_SX1280PA
|
||||
#endif
|
||||
#pragma message "Using SX1280PA,The transmit power must not exceed 3dBm, otherwise it will cause permanent damage to LoRa."
|
||||
#define CONFIG_RADIO_2G4_OUTPUT_POWER 3
|
||||
#define CONFIG_RADIO_OUTPUT_POWER CONFIG_RADIO_2G4_OUTPUT_POWER
|
||||
|
||||
#elif defined(T3_S3_V1_2_LR1121) || defined(ARDUINO_LILYGO_T3S3_LR1121)
|
||||
#ifndef USING_LR1121
|
||||
#define USING_LR1121
|
||||
|
|
@ -392,6 +398,10 @@
|
|||
#ifndef USING_LR1121PA
|
||||
#define USING_LR1121PA
|
||||
#endif
|
||||
#pragma message "Using LR1121PA,The transmit power must not exceed 0dBm, otherwise it will cause permanent damage to LoRa."
|
||||
#define CONFIG_RADIO_2G4_OUTPUT_POWER 0
|
||||
#define CONFIG_RADIO_OUTPUT_POWER CONFIG_RADIO_2G4_OUTPUT_POWER
|
||||
|
||||
#endif // T3_S3_V1_2_SX1262
|
||||
|
||||
|
||||
|
|
@ -455,6 +465,7 @@
|
|||
|
||||
#define RADIO_DIO9_PIN 36 //LR1121 DIO9 = IO36
|
||||
#define RADIO_BUSY_PIN 34 //LR1121 BUSY = IO34
|
||||
#define RADIO_DIO_IRQ_PIN (RADIO_DIO9_PIN)
|
||||
|
||||
#define LILYGO_RADIO_2G4_TX_POWER_LIMIT 13 //LR1121 2.4G TX Power Limit
|
||||
|
||||
|
|
@ -462,6 +473,7 @@
|
|||
|
||||
#define RADIO_DIO9_PIN 36 //LR1121 DIO9 = IO36
|
||||
#define RADIO_BUSY_PIN 34 //LR1121 BUSY = IO34
|
||||
#define RADIO_DIO_IRQ_PIN (RADIO_DIO9_PIN)
|
||||
|
||||
#define LILYGO_RADIO_2G4_TX_POWER_LIMIT 0 //LR1121 2.4G TX Power Limit
|
||||
#define USING_LR1121
|
||||
|
|
@ -521,6 +533,7 @@
|
|||
|
||||
// LR1121 Version
|
||||
#define RADIO_DIO9_PIN (1)
|
||||
#define RADIO_DIO_IRQ_PIN (RADIO_DIO9_PIN)
|
||||
|
||||
#define SPI_MOSI (35)
|
||||
#define SPI_SCK (36)
|
||||
|
|
@ -686,10 +699,28 @@
|
|||
#define BOARD_VARIANT_NAME "T-Beam BPF"
|
||||
|
||||
|
||||
#elif defined(T_BEAM_1W)
|
||||
#elif defined(T_BEAM_1W_SX1262) || defined(T_BEAM_1W_LR1121) || defined(T_BEAM_1W_LR2021)
|
||||
|
||||
#ifdef T_BEAM_1W_SX1262
|
||||
#ifndef USING_SX1262
|
||||
#define USING_SX1262
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef T_BEAM_1W_LR1121
|
||||
#ifndef USING_LR1121
|
||||
#define USING_LR1121
|
||||
#endif
|
||||
#pragma message "Using LR1121 PA Version,The transmit power must not exceed 0dBm, otherwise it will cause permanent damage to LoRa."
|
||||
#define CONFIG_RADIO_2G4_OUTPUT_POWER 0
|
||||
#endif
|
||||
|
||||
#ifdef T_BEAM_1W_LR2021
|
||||
#ifndef USING_LR2021
|
||||
#define USING_LR2021
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#define I2C_SDA (8)
|
||||
|
|
@ -720,10 +751,31 @@
|
|||
|
||||
#define RADIO_CS_PIN (15)
|
||||
#define RADIO_RST_PIN (3)
|
||||
#define RADIO_BUSY_PIN (38)
|
||||
#define RADIO_LDO_EN (40)
|
||||
|
||||
#if defined(T_BEAM_1W_SX1262)
|
||||
#define RADIO_CTRL (21)
|
||||
#define RADIO_DIO1_PIN (1)
|
||||
#define RADIO_BUSY_PIN (38)
|
||||
#endif
|
||||
|
||||
#if defined(T_BEAM_1W_LR1121)
|
||||
#define RADIO_DIO10_PIN (1) // Connect to DIO10
|
||||
#define RADIO_DIO11_PIN (21) // Connect to DIO11
|
||||
#define RADIO_DIO_IRQ_PIN (RADIO_DIO11_PIN)
|
||||
#pragma message "Using LR2021 PA Version,The transmit power must not exceed 0dBm, otherwise it will cause permanent damage to LoRa."
|
||||
#define CONFIG_RADIO_2G4_OUTPUT_POWER 1
|
||||
#define CONFIG_RADIO_SUB1G_OUTPUT_POWER 22
|
||||
#endif
|
||||
|
||||
#if defined(T_BEAM_1W_LR2021)
|
||||
#define RADIO_IRQ_PIN (1) // Connect to DIO10
|
||||
#define RADIO_DIO11_PIN (21) // Connect to DIO11
|
||||
#define RADIO_DIO_NUM (10) // LR2021 DIO NUM NOT ESP32S3 GPIO NUM
|
||||
#define CONFIG_RADIO_2G4_OUTPUT_POWER 8
|
||||
#define CONFIG_RADIO_SUB1G_OUTPUT_POWER 22
|
||||
#pragma message "Using LR2021 PA Version,The transmit power must not exceed 8dBm, otherwise it will cause permanent damage to LoRa."
|
||||
#endif
|
||||
|
||||
#define BOARD_LED 18
|
||||
#define LED_ON HIGH
|
||||
|
|
@ -750,7 +802,7 @@
|
|||
|
||||
#define DISPLAY_MODEL U8G2_SH1106_128X64_NONAME_F_HW_I2C
|
||||
#define DISPLAY_MODEL_SSD_LIB SH1106Wire
|
||||
#define BOARD_VARIANT_NAME "LoRa 2W"
|
||||
#define BOARD_VARIANT_NAME "LoRa 1W"
|
||||
|
||||
#else
|
||||
#error "When using it for the first time, please define the board model in <utilities.h> 首次使用时,请在<utilities.h> 文件最上方定义板卡模型"
|
||||
|
|
@ -761,20 +813,103 @@
|
|||
|
||||
|
||||
#if defined(USING_SX1262)
|
||||
|
||||
#define RADIO_TYPE_STR "SX1262"
|
||||
|
||||
#ifndef CONFIG_RADIO_SUB1G_OUTPUT_POWER
|
||||
#define CONFIG_RADIO_SUB1G_OUTPUT_POWER 22
|
||||
#endif
|
||||
|
||||
#elif defined(USING_SX1276)
|
||||
|
||||
#define RADIO_TYPE_STR "SX1276"
|
||||
|
||||
#ifndef CONFIG_RADIO_SUB1G_OUTPUT_POWER
|
||||
#define CONFIG_RADIO_SUB1G_OUTPUT_POWER 17
|
||||
#endif
|
||||
|
||||
#elif defined(USING_SX1278)
|
||||
|
||||
#define RADIO_TYPE_STR "SX1278"
|
||||
|
||||
#ifndef CONFIG_RADIO_SUB1G_OUTPUT_POWER
|
||||
#define CONFIG_RADIO_SUB1G_OUTPUT_POWER 17
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_RADIO_FREQ
|
||||
#define CONFIG_RADIO_FREQ 433.0
|
||||
#endif
|
||||
|
||||
#elif defined(USING_LR1121)
|
||||
|
||||
#define RADIO_TYPE_STR "LR1121"
|
||||
|
||||
#ifndef CONFIG_RADIO_SUB1G_OUTPUT_POWER
|
||||
#define CONFIG_RADIO_SUB1G_OUTPUT_POWER 22
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_RADIO_2G4_OUTPUT_POWER
|
||||
#define CONFIG_RADIO_2G4_OUTPUT_POWER 13
|
||||
#endif
|
||||
|
||||
#elif defined(USING_SX1280)
|
||||
|
||||
#define RADIO_TYPE_STR "SX1280"
|
||||
|
||||
#ifndef CONFIG_RADIO_2G4_OUTPUT_POWER
|
||||
#define CONFIG_RADIO_2G4_OUTPUT_POWER 13
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_RADIO_FREQ
|
||||
#define CONFIG_RADIO_FREQ 2400.0
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_RADIO_BW
|
||||
#define CONFIG_RADIO_BW 203.125
|
||||
#endif
|
||||
|
||||
#elif defined(USING_SX1280PA)
|
||||
|
||||
#define RADIO_TYPE_STR "SX1280PA"
|
||||
|
||||
#ifndef CONFIG_RADIO_2G4_OUTPUT_POWER
|
||||
#define CONFIG_RADIO_2G4_OUTPUT_POWER 13
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_RADIO_FREQ
|
||||
#define CONFIG_RADIO_FREQ 2400.0
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_RADIO_BW
|
||||
#define CONFIG_RADIO_BW 203.125
|
||||
#endif
|
||||
|
||||
|
||||
#elif defined(USING_LR2021)
|
||||
|
||||
#define RADIO_TYPE_STR "LR2021"
|
||||
|
||||
#ifndef CONFIG_RADIO_2G4_OUTPUT_POWER
|
||||
#define CONFIG_RADIO_2G4_OUTPUT_POWER 12
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_RADIO_SUB1G_OUTPUT_POWER
|
||||
#define CONFIG_RADIO_SUB1G_OUTPUT_POWER 22
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef CONFIG_RADIO_2G4_OUTPUT_POWER
|
||||
#define CONFIG_RADIO_2G4_OUTPUT_POWER -1
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef CONFIG_RADIO_FREQ
|
||||
#define CONFIG_RADIO_FREQ 868.0
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef CONFIG_RADIO_BW
|
||||
#define CONFIG_RADIO_BW 125.0
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue