|
40 | 40 | #define MODE_RX_SINGLE 0x06 |
41 | 41 |
|
42 | 42 | // PA config |
43 | | -#define PA_BOOST 0x80 |
44 | | -#define RFO 0x70 |
| 43 | +//#define PA_BOOST 0x80 |
| 44 | +//#define RFO 0x70 |
45 | 45 | // IRQ masks |
46 | 46 | #define IRQ_TX_DONE_MASK 0x08 |
47 | 47 | #define IRQ_PAYLOAD_CRC_ERROR_MASK 0x20 |
@@ -93,10 +93,11 @@ int LoRaClass::begin(long frequency,bool PABOOST) |
93 | 93 | writeRegister(REG_LNA, readRegister(REG_LNA) | 0x03); |
94 | 94 | // set auto AGC |
95 | 95 | writeRegister(REG_MODEM_CONFIG_3, 0x04); |
96 | | - // set output power to 20 dBm |
97 | | - setTxPower(14, PA_OUTPUT_PA_BOOST_PIN); |
98 | | - //setTxPowerMax(14); //PA_BOOST |
99 | | - // set Spreading Factor to 7 (6~12) |
| 96 | + // set output power to 14 dBm |
| 97 | + if(PABOOST == true) |
| 98 | + setTxPower(14, RF_PACONFIG_PASELECT_PABOOST); |
| 99 | + else |
| 100 | + setTxPower(14, RF_PACONFIG_PASELECT_RFO); |
100 | 101 | setSpreadingFactor(11); |
101 | 102 | // put in standby mode |
102 | 103 | setSignalBandwidth(125E3); |
@@ -350,7 +351,7 @@ void LoRaClass::setTxPowerMax(int level) |
350 | 351 | } |
351 | 352 | writeRegister(REG_LR_OCP,0x3f); |
352 | 353 | writeRegister(REG_PaDac,0x87);//Open PA_BOOST |
353 | | - writeRegister(REG_PA_CONFIG, PA_BOOST | (level - 5)); |
| 354 | + writeRegister(REG_PA_CONFIG, RF_PACONFIG_PASELECT_PABOOST | (level - 5)); |
354 | 355 | } |
355 | 356 |
|
356 | 357 | void LoRaClass::setFrequency(long frequency) |
|
0 commit comments