From 7667859a27a5b202ff2b7a79a11dbd2578b4096f Mon Sep 17 00:00:00 2001 From: Th3maz1ng Date: Fri, 26 Dec 2025 12:25:36 +0100 Subject: [PATCH] Added the required pin definition and settings for the LoRa transceiver (RFM95W 868 MHz) replacing the NRF24L01 --- src/app/definition.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/app/definition.h b/src/app/definition.h index 6de84e8..deebce9 100644 --- a/src/app/definition.h +++ b/src/app/definition.h @@ -18,14 +18,13 @@ #define ADC_QUANTUM 0.0033017578125 //ADC_VREF / ADC_RESOLUTION -> 3.314 and 10 bits (1024) in my case #define VOLTAGE_DIV_COEFF 1.321127673363577 //(R1 + R2)/R2 -//NRF Radio config part -#define RADIO_CHANNEL 108 //0-125 -#define RADIO_NODE_ADDRESS "WEST1" //Weather Station 1 network because the mail box is connected on it -#define RADIO_PA_LEVEL RF24_PA_MAX //RF24_PA_MIN,RF24_PA_LOW,RF24_PA_HIGH,RF24_PA_MAX -#define ENABLE_LNA true //true or false -#define RADIO_DATARATE RF24_250KBPS //Slow datarate to maximize range -#define MAX_SEND_ROUND_RETRIES 5 //If no ACK is received, tries to resend a MAX_SEND_ROUND_RETRIES-1 more times - //Increase this parameter if the RF link is bad. +//RFM95 LoRa Radio config part +#define LORA_BAND (868E6) // LoRa used frequency is 868 MHz in the EU +#define LORA_SPREADING_FACTOR (10) // LoRa modulation spreading factor 6 to 12 +#define RFM95W_ENABLE_CRC (true) // Set CRC check for the frame +#define RFM95W_TX_POWER (17) //2 to 20 dB +#define MAX_SEND_ROUND_RETRIES (3) //Sends the packet 3 times + //Increase this parameter if the RF link is bad. //Pin config part typedef enum @@ -33,9 +32,10 @@ typedef enum D2_EXTERNAL_INT = 2, D4_LDO_EN = 4, D5_BAT_V_SENS_EN = 5, - D6_NRF_CE = 6, + D6_RFM_RST = 6, D7_SWITCH_V_SENS_EN = 7, - D10_NRF_CS = 10, + D8_RFM_DI0 = 8, + D10_RFM_CS = 10, D11_MOSI = 11, D12_MISO = 12, D13_SCK = 13,