diff --git a/src/mesh/LR11x0Interface.cpp b/src/mesh/LR11x0Interface.cpp index bc1f242d4..32faab194 100644 --- a/src/mesh/LR11x0Interface.cpp +++ b/src/mesh/LR11x0Interface.cpp @@ -293,19 +293,6 @@ template bool LR11x0Interface::isActivelyReceiving() RADIOLIB_LR11X0_IRQ_PREAMBLE_DETECTED); } -template void LR11x0Interface::regulateFan() -{ - float pa_temp = 0; - lora.getTemp(&pa_temp); - if (pa_temp > 40) { - pa_fan_percentage = max(pa_fan_percentage + 1, 100); - enableFan(); - } else { - pa_fan_percentage = max(pa_fan_percentage - 1, 100); - enableFan(); - } -} - template bool LR11x0Interface::sleep() { // \todo Display actual typename of the adapter, not just `LR11x0` diff --git a/src/mesh/LR11x0Interface.h b/src/mesh/LR11x0Interface.h index 355acf7f6..4829ddc1d 100644 --- a/src/mesh/LR11x0Interface.h +++ b/src/mesh/LR11x0Interface.h @@ -65,7 +65,5 @@ template class LR11x0Interface : public RadioLibInterface virtual void addReceiveMetadata(meshtastic_MeshPacket *mp) override; virtual void setStandby() override; - - void regulateFan(); }; #endif \ No newline at end of file diff --git a/src/mesh/RadioLibInterface.h b/src/mesh/RadioLibInterface.h index 39fbd5ec7..d78031469 100644 --- a/src/mesh/RadioLibInterface.h +++ b/src/mesh/RadioLibInterface.h @@ -137,7 +137,7 @@ class RadioLibInterface : public RadioInterface, protected concurrency::Notified /** Attempt to find a packet in the TxQueue. Returns true if the packet was found. */ virtual bool findInTxQueue(NodeNum from, PacketId id) override; - + void enableFan(); void disableFan(); diff --git a/variants/radiomaster_nomad_gemini/rfswitch.h b/variants/radiomaster_nomad_gemini/rfswitch.h index a84f62fde..8c2a56a87 100644 --- a/variants/radiomaster_nomad_gemini/rfswitch.h +++ b/variants/radiomaster_nomad_gemini/rfswitch.h @@ -8,7 +8,7 @@ static const Module::RfSwitchMode_t rfswitch_table[] = { {LR11x0::MODE_STBY, {LOW, LOW, LOW, LOW}}, {LR11x0::MODE_RX, {LOW, LOW, HIGH, LOW}}, {LR11x0::MODE_TX, {LOW, LOW, LOW, HIGH}}, {LR11x0::MODE_TX_HP, {LOW, LOW, LOW, HIGH}}, {LR11x0::MODE_TX_HF, {LOW, HIGH, LOW, LOW}}, {LR11x0::MODE_GNSS, {LOW, LOW, LOW, LOW}}, - {LR11x0::MODE_WIFI, {LOW, LOW, LOW, LOW}}, END_OF_MODE_TABLE, + {LR11x0::MODE_WIFI, {HIGH, LOW, LOW, LOW}}, END_OF_MODE_TABLE, }; /* @@ -18,4 +18,39 @@ DIO6: TXEN 2.4GHz DIO7: RXEN 900MHz DIO8: TXEN 900MHz + + "radio_dcdc": true, + "radio_rfo_hf": true, + + "power_apc2": 26, + "power_min": 0, + "power_high": 6, + "power_max": 6, + "power_default": 3, + "power_control": 3, POWER_OUTPUT_DACWRITE // use internal dacWrite function to set value on GPIO_PIN_RFamp_APC2 + [0, 1, 2, 3, 4, 5, 6 ] // 0-6 + "power_values": [120, 120, 120, 120, 120, 120, 95] // DAC Value + "power_values2": [-17, -16, -14, -11, -7, -3, 5 ] // 900M + "power_values_dual": [-18, -14, -8, -6, -2, 3, 5 ] // 2.4G + + // default value 0 means direct! +#define POWER_OUTPUT_DACWRITE (hardware_int(HARDWARE_power_control)==3) +#define POWER_OUTPUT_VALUES hardware_i16_array(HARDWARE_power_values) +#define POWER_OUTPUT_VALUES_COUNT hardware_int(HARDWARE_power_values_count) +#define POWER_OUTPUT_VALUES2 hardware_i16_array(HARDWARE_power_values2) +#define POWER_OUTPUT_VALUES_DUAL hardware_i16_array(HARDWARE_power_values_dual) +#define POWER_OUTPUT_VALUES_DUAL_COUNT hardware_int(HARDWARE_power_values_dual_count) + +#define GPIO_PIN_FAN_EN hardware_pin(HARDWARE_misc_fan_en) + + case PWR_10mW: return 10; + case PWR_25mW: return 14; + case PWR_50mW: return 17; + case PWR_100mW: return 20; + case PWR_250mW: return 24; + case PWR_500mW: return 27; + case PWR_1000mW: return 30; + + 95 -> +25dBm + 120 -> +24dBm */ \ No newline at end of file diff --git a/variants/radiomaster_nomad_gemini/variant.h b/variants/radiomaster_nomad_gemini/variant.h index 25e757918..643b89759 100644 --- a/variants/radiomaster_nomad_gemini/variant.h +++ b/variants/radiomaster_nomad_gemini/variant.h @@ -28,6 +28,13 @@ #define LR1121_SPI_MOSI_PIN LORA_MOSI #define LR1121_SPI_MISO_PIN LORA_MISO +// this is correct and sets the cap for the Sub-GHz part +#define LR1110_MAX_POWER 5 +// 2.4G Part +#define LR1120_MAX_POWER 5 + +#define POWER_SHIFT -20 + // not yet implemented #define JANUS_RADIO #define LR1121_IRQ2_PIN 34 @@ -35,6 +42,7 @@ #define LR1121_BUSY2_PIN 39 #define LR1121_SPI_NSS2_PIN 13 +// TODO: check if this is correct // #define LR11X0_DIO3_TCXO_VOLTAGE 1.6 #define LR11X0_DIO_AS_RF_SWITCH @@ -49,11 +57,4 @@ #undef EXT_NOTIFY_OUT -// #define BAT_MEASURE_ADC_UNIT -// #define BATTERY_PIN 26 -// #define ADC_CHANNEL ADC2_GPIO26_CHANNEL -// #define BATTERY_SENSE_SAMPLES 30 - #define RADIO_FAN_EN 2 -// this board does need PWM on the FAN PIN -#define RADIO_FAN_PWM