[LR11x0] Disable DIO11 for GNSS only (#1275)

pull/1335/head^2
jgromes 2024-11-21 20:09:05 +01:00
rodzic 8d119fc242
commit ef16e431af
2 zmienionych plików z 8 dodań i 4 usunięć

Wyświetl plik

@ -129,6 +129,8 @@ int16_t LR11x0::beginGNSS(uint8_t constellations, float tcxoVoltage) {
state = this->clearErrors();
RADIOLIB_ASSERT(state);
// set GNSS flag to reserve DIO11 for LF clock
this->gnss = true;
state = this->configLfClock(RADIOLIB_LR11X0_LF_BUSY_RELEASE_DISABLED | RADIOLIB_LR11X0_LF_CLK_XOSC);
RADIOLIB_ASSERT(state);
@ -2066,6 +2068,7 @@ int16_t LR11x0::modSetup(float tcxoVoltage, uint8_t modem) {
this->mod->spiConfig.stream = true;
this->mod->spiConfig.parseStatusCb = SPIparseStatus;
this->mod->spiConfig.checkStatusCb = SPIcheckStatus;
this->gnss = false;
// try to find the LR11x0 chip - this will also reset the module at least once
if(!LR11x0::findChip(this->chipType)) {
@ -2452,7 +2455,7 @@ int16_t LR11x0::setDioIrqParams(uint32_t irq1, uint32_t irq2) {
}
int16_t LR11x0::setDioIrqParams(uint32_t irq) {
return(setDioIrqParams(irq, 0));
return(setDioIrqParams(irq, this->gnss ? 0 : irq));
}
int16_t LR11x0::clearIrq(uint32_t irq) {
@ -2463,7 +2466,7 @@ int16_t LR11x0::clearIrq(uint32_t irq) {
}
int16_t LR11x0::configLfClock(uint8_t setup) {
return(this->SPIcommand(RADIOLIB_LR11X0_CMD_CONFIG_LF_LOCK, true, &setup, 1));
return(this->SPIcommand(RADIOLIB_LR11X0_CMD_CONFIG_LF_CLOCK, true, &setup, 1));
}
int16_t LR11x0::setTcxoMode(uint8_t tune, uint32_t delay) {

Wyświetl plik

@ -33,7 +33,7 @@
#define RADIOLIB_LR11X0_CMD_SET_DIO_AS_RF_SWITCH (0x0112)
#define RADIOLIB_LR11X0_CMD_SET_DIO_IRQ_PARAMS (0x0113)
#define RADIOLIB_LR11X0_CMD_CLEAR_IRQ (0x0114)
#define RADIOLIB_LR11X0_CMD_CONFIG_LF_LOCK (0x0116)
#define RADIOLIB_LR11X0_CMD_CONFIG_LF_CLOCK (0x0116)
#define RADIOLIB_LR11X0_CMD_SET_TCXO_MODE (0x0117)
#define RADIOLIB_LR11X0_CMD_REBOOT (0x0118)
#define RADIOLIB_LR11X0_CMD_GET_VBAT (0x0119)
@ -281,7 +281,7 @@
#define RADIOLIB_LR11X0_IRQ_ALL (0x1BF80FFCUL) // 31 0 all interrupts
#define RADIOLIB_LR11X0_IRQ_NONE (0x00UL << 0) // 31 0 no interrupts
// RADIOLIB_LR11X0_CMD_CONFIG_LF_LOCK
// RADIOLIB_LR11X0_CMD_CONFIG_LF_CLOCK
#define RADIOLIB_LR11X0_LF_CLK_RC (0x00UL << 0) // 1 0 32.768 kHz source: RC oscillator
#define RADIOLIB_LR11X0_LF_CLK_XOSC (0x01UL << 0) // 1 0 crystal oscillator
#define RADIOLIB_LR11X0_LF_CLK_EXT (0x02UL << 0) // 1 0 external signal on DIO11
@ -1828,6 +1828,7 @@ class LR11x0: public PhysicalLayer {
float dataRateMeasured = 0;
uint8_t wifiScanMode = 0;
bool gnss = false;
int16_t modSetup(float tcxoVoltage, uint8_t modem);
static int16_t SPIparseStatus(uint8_t in);