mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2024-10-01 03:15:39 -04:00
SX1262 calibration in RC mode
This commit is contained in:
parent
06de901623
commit
bbc267ac80
Binary file not shown.
29
sx126x.cpp
29
sx126x.cpp
@ -365,17 +365,27 @@ int sx126x::begin(long frequency)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loraMode();
|
if (_rxen != -1) {
|
||||||
// cannot access registers in sleep mode on sx1262, set to idle instead
|
pinMode(_rxen, OUTPUT);
|
||||||
idle();
|
}
|
||||||
|
|
||||||
|
// Put in STDBY_RC mode before calibration
|
||||||
|
uint8_t mode_byte = 0x00;
|
||||||
|
executeOpcode(OP_STANDBY_6X, &mode_byte, 1);
|
||||||
|
|
||||||
|
// calibrate RC64k, RC13M, PLL, ADC and image
|
||||||
|
uint8_t calibrate = 0x7F;
|
||||||
|
executeOpcode(OP_CALIBRATE_6X, &calibrate, 1);
|
||||||
|
|
||||||
#if HAS_TCXO
|
#if HAS_TCXO
|
||||||
enableTCXO();
|
enableTCXO();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (_rxen != -1) {
|
loraMode();
|
||||||
pinMode(_rxen, OUTPUT);
|
idle();
|
||||||
}
|
|
||||||
|
// Set sync word
|
||||||
|
setSyncWord(SYNC_WORD_6X);
|
||||||
|
|
||||||
#if DIO2_AS_RF_SWITCH
|
#if DIO2_AS_RF_SWITCH
|
||||||
// enable dio2 rf switch
|
// enable dio2 rf switch
|
||||||
@ -385,13 +395,6 @@ int sx126x::begin(long frequency)
|
|||||||
|
|
||||||
rxAntEnable();
|
rxAntEnable();
|
||||||
|
|
||||||
// Set sync word
|
|
||||||
setSyncWord(SYNC_WORD_6X);
|
|
||||||
|
|
||||||
// calibrate RC64k, RC13M, PLL, ADC and image
|
|
||||||
uint8_t calibrate = 0x7F;
|
|
||||||
executeOpcode(OP_CALIBRATE_6X, &calibrate, 1);
|
|
||||||
|
|
||||||
setFrequency(frequency);
|
setFrequency(frequency);
|
||||||
|
|
||||||
// set output power to 2 dBm
|
// set output power to 2 dBm
|
||||||
|
Loading…
Reference in New Issue
Block a user