mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 10:12:50 +00:00
Use common power amp definition for Heltec v4 and Heltec Tracker v2
This commit is contained in:
@@ -117,7 +117,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define SX126X_MAX_POWER 22
|
#define SX126X_MAX_POWER 22
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HELTEC_V4
|
#ifdef USE_GC1109_PA
|
||||||
// Power Amps are often non-linear, so we can use an array of values for the power curve
|
// Power Amps are often non-linear, so we can use an array of values for the power curve
|
||||||
#define NUM_PA_POINTS 22
|
#define NUM_PA_POINTS 22
|
||||||
#define TX_GAIN_LORA 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 9, 8, 7
|
#define TX_GAIN_LORA 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 9, 8, 7
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ template <typename T> bool SX126xInterface<T>::init()
|
|||||||
pinMode(SX126X_POWER_EN, OUTPUT);
|
pinMode(SX126X_POWER_EN, OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HELTEC_V4)||defined(HELTEC_WIRELESS_TRACKER_V2)
|
#if defined(USE_GC1109_PA)
|
||||||
pinMode(LORA_PA_POWER, OUTPUT);
|
pinMode(LORA_PA_POWER, OUTPUT);
|
||||||
digitalWrite(LORA_PA_POWER, HIGH);
|
digitalWrite(LORA_PA_POWER, HIGH);
|
||||||
|
|
||||||
@@ -352,7 +352,7 @@ template <typename T> bool SX126xInterface<T>::sleep()
|
|||||||
digitalWrite(SX126X_POWER_EN, LOW);
|
digitalWrite(SX126X_POWER_EN, LOW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HELTEC_V4)||defined(HELTEC_WIRELESS_TRACKER_V2)
|
#if defined(USE_GC1109_PA)
|
||||||
/*
|
/*
|
||||||
* Do not switch the power on and off frequently.
|
* Do not switch the power on and off frequently.
|
||||||
* After turning off LORA_PA_EN, the power consumption has dropped to the uA level.
|
* After turning off LORA_PA_EN, the power consumption has dropped to the uA level.
|
||||||
@@ -367,7 +367,7 @@ template <typename T> bool SX126xInterface<T>::sleep()
|
|||||||
/** Some boards require GPIO control of tx vs rx paths */
|
/** Some boards require GPIO control of tx vs rx paths */
|
||||||
template <typename T> void SX126xInterface<T>::setTransmitEnable(bool txon)
|
template <typename T> void SX126xInterface<T>::setTransmitEnable(bool txon)
|
||||||
{
|
{
|
||||||
#if defined(HELTEC_V4)||defined(HELTEC_WIRELESS_TRACKER_V2)
|
#if defined(USE_GC1109_PA)
|
||||||
digitalWrite(LORA_PA_POWER, HIGH);
|
digitalWrite(LORA_PA_POWER, HIGH);
|
||||||
digitalWrite(LORA_PA_EN, HIGH);
|
digitalWrite(LORA_PA_EN, HIGH);
|
||||||
digitalWrite(LORA_PA_TX_EN, txon ? 1 : 0);
|
digitalWrite(LORA_PA_TX_EN, txon ? 1 : 0);
|
||||||
|
|||||||
@@ -554,7 +554,7 @@ void enableLoraInterrupt()
|
|||||||
gpio_pullup_en((gpio_num_t)LORA_CS);
|
gpio_pullup_en((gpio_num_t)LORA_CS);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HELTEC_V4)||defined(HELTEC_WIRELESS_TRACKER_V2)
|
#if defined(USE_GC1109_PA)
|
||||||
gpio_pullup_en((gpio_num_t)LORA_PA_POWER);
|
gpio_pullup_en((gpio_num_t)LORA_PA_POWER);
|
||||||
gpio_pullup_en((gpio_num_t)LORA_PA_EN);
|
gpio_pullup_en((gpio_num_t)LORA_PA_EN);
|
||||||
gpio_pulldown_en((gpio_num_t)LORA_PA_TX_EN);
|
gpio_pulldown_en((gpio_num_t)LORA_PA_TX_EN);
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#define SX126X_DIO2_AS_RF_SWITCH
|
#define SX126X_DIO2_AS_RF_SWITCH
|
||||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||||
|
|
||||||
|
#define USE_GC1109_PA // We have a GC1109 power amplifier+attenuator
|
||||||
#define LORA_PA_POWER 7 // power en
|
#define LORA_PA_POWER 7 // power en
|
||||||
#define LORA_PA_EN 2
|
#define LORA_PA_EN 2
|
||||||
#define LORA_PA_TX_EN 46 // enable tx
|
#define LORA_PA_TX_EN 46 // enable tx
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
#define SCREEN_TRANSITION_FRAMERATE 3 // fps
|
#define SCREEN_TRANSITION_FRAMERATE 3 // fps
|
||||||
#define DISPLAY_FORCE_SMALL_FONTS
|
#define DISPLAY_FORCE_SMALL_FONTS
|
||||||
|
|
||||||
|
|
||||||
#define VEXT_ENABLE 3 // active HIGH - powers the GPS, GPS LNA and OLED
|
#define VEXT_ENABLE 3 // active HIGH - powers the GPS, GPS LNA and OLED
|
||||||
#define VEXT_ON_VALUE HIGH
|
#define VEXT_ON_VALUE HIGH
|
||||||
#define BUTTON_PIN 0
|
#define BUTTON_PIN 0
|
||||||
@@ -73,6 +72,7 @@
|
|||||||
#define SX126X_DIO2_AS_RF_SWITCH
|
#define SX126X_DIO2_AS_RF_SWITCH
|
||||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||||
|
|
||||||
|
#define USE_GC1109_PA // We have a GC1109 power amplifier+attenuator
|
||||||
#define LORA_PA_POWER 7 // power en
|
#define LORA_PA_POWER 7 // power en
|
||||||
#define LORA_PA_EN 4
|
#define LORA_PA_EN 4
|
||||||
#define LORA_PA_TX_EN 46 // enable tx
|
#define LORA_PA_TX_EN 46 // enable tx
|
||||||
Reference in New Issue
Block a user