diff --git a/examples/ArduinoLoRa/LoRaReceiver/LoRaBoards.cpp b/examples/ArduinoLoRa/LoRaReceiver/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/ArduinoLoRa/LoRaReceiver/LoRaBoards.cpp +++ b/examples/ArduinoLoRa/LoRaReceiver/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/ArduinoLoRa/LoRaSender/LoRaBoards.cpp b/examples/ArduinoLoRa/LoRaSender/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/ArduinoLoRa/LoRaSender/LoRaBoards.cpp +++ b/examples/ArduinoLoRa/LoRaSender/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/BPFFactory/LoRaBoards.cpp b/examples/BPFFactory/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/BPFFactory/LoRaBoards.cpp +++ b/examples/BPFFactory/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Display/Free_Font_Demo/LoRaBoards.cpp b/examples/Display/Free_Font_Demo/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Display/Free_Font_Demo/LoRaBoards.cpp +++ b/examples/Display/Free_Font_Demo/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Display/TBeam_TFT_Shield/LoRaBoards.cpp b/examples/Display/TBeam_TFT_Shield/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Display/TBeam_TFT_Shield/LoRaBoards.cpp +++ b/examples/Display/TBeam_TFT_Shield/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Display/TFT_Char_times/LoRaBoards.cpp b/examples/Display/TFT_Char_times/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Display/TFT_Char_times/LoRaBoards.cpp +++ b/examples/Display/TFT_Char_times/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Display/UTFT_demo/LoRaBoards.cpp b/examples/Display/UTFT_demo/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Display/UTFT_demo/LoRaBoards.cpp +++ b/examples/Display/UTFT_demo/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/GPS/TinyGPS_Example/LoRaBoards.cpp b/examples/GPS/TinyGPS_Example/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/GPS/TinyGPS_Example/LoRaBoards.cpp +++ b/examples/GPS/TinyGPS_Example/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/GPS/TinyGPS_FullExample/LoRaBoards.cpp b/examples/GPS/TinyGPS_FullExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/GPS/TinyGPS_FullExample/LoRaBoards.cpp +++ b/examples/GPS/TinyGPS_FullExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/GPS/TinyGPS_KitchenSink/LoRaBoards.cpp b/examples/GPS/TinyGPS_KitchenSink/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/GPS/TinyGPS_KitchenSink/LoRaBoards.cpp +++ b/examples/GPS/TinyGPS_KitchenSink/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/GPS/UBlox_BasicNMEARead/LoRaBoards.cpp b/examples/GPS/UBlox_BasicNMEARead/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/GPS/UBlox_BasicNMEARead/LoRaBoards.cpp +++ b/examples/GPS/UBlox_BasicNMEARead/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/GPS/UBlox_NMEAParsing/LoRaBoards.cpp b/examples/GPS/UBlox_NMEAParsing/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/GPS/UBlox_NMEAParsing/LoRaBoards.cpp +++ b/examples/GPS/UBlox_NMEAParsing/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/GPS/UBlox_OutputRate/LoRaBoards.cpp b/examples/GPS/UBlox_OutputRate/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/GPS/UBlox_OutputRate/LoRaBoards.cpp +++ b/examples/GPS/UBlox_OutputRate/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/GPS/UBlox_Recovery/LoRaBoards.cpp b/examples/GPS/UBlox_Recovery/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/GPS/UBlox_Recovery/LoRaBoards.cpp +++ b/examples/GPS/UBlox_Recovery/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/LoRaWAN/LMIC_Library_OTTA/LoRaBoards.cpp b/examples/LoRaWAN/LMIC_Library_OTTA/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/LoRaWAN/LMIC_Library_OTTA/LoRaBoards.cpp +++ b/examples/LoRaWAN/LMIC_Library_OTTA/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/LoRaWAN/LoRaWAN_ABP/LoRaBoards.cpp b/examples/LoRaWAN/LoRaWAN_ABP/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/LoRaWAN/LoRaWAN_ABP/LoRaBoards.cpp +++ b/examples/LoRaWAN/LoRaWAN_ABP/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/LoRaWAN/RadioLib_OTAA/LoRaBoards.cpp b/examples/LoRaWAN/RadioLib_OTAA/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/LoRaWAN/RadioLib_OTAA/LoRaBoards.cpp +++ b/examples/LoRaWAN/RadioLib_OTAA/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/OLED/SH1106FontUsage/LoRaBoards.cpp b/examples/OLED/SH1106FontUsage/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/OLED/SH1106FontUsage/LoRaBoards.cpp +++ b/examples/OLED/SH1106FontUsage/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/OLED/SH1106GraphicsTest/LoRaBoards.cpp b/examples/OLED/SH1106GraphicsTest/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/OLED/SH1106GraphicsTest/LoRaBoards.cpp +++ b/examples/OLED/SH1106GraphicsTest/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/OLED/SH1106IconMenu/LoRaBoards.cpp b/examples/OLED/SH1106IconMenu/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/OLED/SH1106IconMenu/LoRaBoards.cpp +++ b/examples/OLED/SH1106IconMenu/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/OLED/SH1106PrintUTF8/LoRaBoards.cpp b/examples/OLED/SH1106PrintUTF8/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/OLED/SH1106PrintUTF8/LoRaBoards.cpp +++ b/examples/OLED/SH1106PrintUTF8/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/OLED/SSD1306SimpleDemo/LoRaBoards.cpp b/examples/OLED/SSD1306SimpleDemo/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/OLED/SSD1306SimpleDemo/LoRaBoards.cpp +++ b/examples/OLED/SSD1306SimpleDemo/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/OLED/SSD1306UiDemo/LoRaBoards.cpp b/examples/OLED/SSD1306UiDemo/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/OLED/SSD1306UiDemo/LoRaBoards.cpp +++ b/examples/OLED/SSD1306UiDemo/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/PMU/LoRaBoards.cpp b/examples/PMU/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/PMU/LoRaBoards.cpp +++ b/examples/PMU/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/RadioLibExamples/Receive_Interrupt/LoRaBoards.cpp b/examples/RadioLibExamples/Receive_Interrupt/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/RadioLibExamples/Receive_Interrupt/LoRaBoards.cpp +++ b/examples/RadioLibExamples/Receive_Interrupt/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/RadioLibExamples/Transmit_Interrupt/LoRaBoards.cpp b/examples/RadioLibExamples/Transmit_Interrupt/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/RadioLibExamples/Transmit_Interrupt/LoRaBoards.cpp +++ b/examples/RadioLibExamples/Transmit_Interrupt/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/BME280_AdvancedsettingsExample/LoRaBoards.cpp b/examples/Sensor/BME280_AdvancedsettingsExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/BME280_AdvancedsettingsExample/LoRaBoards.cpp +++ b/examples/Sensor/BME280_AdvancedsettingsExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/BME280_TestExample/LoRaBoards.cpp b/examples/Sensor/BME280_TestExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/BME280_TestExample/LoRaBoards.cpp +++ b/examples/Sensor/BME280_TestExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/BME280_UnifiedExample/LoRaBoards.cpp b/examples/Sensor/BME280_UnifiedExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/BME280_UnifiedExample/LoRaBoards.cpp +++ b/examples/Sensor/BME280_UnifiedExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/PCF8563_AlarmByUnits/LoRaBoards.cpp b/examples/Sensor/PCF8563_AlarmByUnits/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/PCF8563_AlarmByUnits/LoRaBoards.cpp +++ b/examples/Sensor/PCF8563_AlarmByUnits/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/PCF8563_SimpleTime/LoRaBoards.cpp b/examples/Sensor/PCF8563_SimpleTime/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/PCF8563_SimpleTime/LoRaBoards.cpp +++ b/examples/Sensor/PCF8563_SimpleTime/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/PCF8563_TimeLib/LoRaBoards.cpp b/examples/Sensor/PCF8563_TimeLib/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/PCF8563_TimeLib/LoRaBoards.cpp +++ b/examples/Sensor/PCF8563_TimeLib/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/PCF8563_TimeSynchronization/LoRaBoards.cpp b/examples/Sensor/PCF8563_TimeSynchronization/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/PCF8563_TimeSynchronization/LoRaBoards.cpp +++ b/examples/Sensor/PCF8563_TimeSynchronization/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/QMC6310_CalibrateExample/LoRaBoards.cpp b/examples/Sensor/QMC6310_CalibrateExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/QMC6310_CalibrateExample/LoRaBoards.cpp +++ b/examples/Sensor/QMC6310_CalibrateExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/QMC6310_CompassExample/LoRaBoards.cpp b/examples/Sensor/QMC6310_CompassExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/QMC6310_CompassExample/LoRaBoards.cpp +++ b/examples/Sensor/QMC6310_CompassExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/QMC6310_GetDataExample/LoRaBoards.cpp b/examples/Sensor/QMC6310_GetDataExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/QMC6310_GetDataExample/LoRaBoards.cpp +++ b/examples/Sensor/QMC6310_GetDataExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/QMC6310_GetPolarExample/LoRaBoards.cpp b/examples/Sensor/QMC6310_GetPolarExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/QMC6310_GetPolarExample/LoRaBoards.cpp +++ b/examples/Sensor/QMC6310_GetPolarExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/QMI8658_BlockExample/LoRaBoards.cpp b/examples/Sensor/QMI8658_BlockExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/QMI8658_BlockExample/LoRaBoards.cpp +++ b/examples/Sensor/QMI8658_BlockExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/QMI8658_GetDataExample/LoRaBoards.cpp b/examples/Sensor/QMI8658_GetDataExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/QMI8658_GetDataExample/LoRaBoards.cpp +++ b/examples/Sensor/QMI8658_GetDataExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/QMI8658_InterruptBlockExample/LoRaBoards.cpp b/examples/Sensor/QMI8658_InterruptBlockExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/QMI8658_InterruptBlockExample/LoRaBoards.cpp +++ b/examples/Sensor/QMI8658_InterruptBlockExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/QMI8658_InterruptExample/LoRaBoards.cpp b/examples/Sensor/QMI8658_InterruptExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/QMI8658_InterruptExample/LoRaBoards.cpp +++ b/examples/Sensor/QMI8658_InterruptExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/QMI8658_LockingMechanismExample/LoRaBoards.cpp b/examples/Sensor/QMI8658_LockingMechanismExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/QMI8658_LockingMechanismExample/LoRaBoards.cpp +++ b/examples/Sensor/QMI8658_LockingMechanismExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/QMI8658_MadgwickAHRS/LoRaBoards.cpp b/examples/Sensor/QMI8658_MadgwickAHRS/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/QMI8658_MadgwickAHRS/LoRaBoards.cpp +++ b/examples/Sensor/QMI8658_MadgwickAHRS/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/QMI8658_PedometerExample/LoRaBoards.cpp b/examples/Sensor/QMI8658_PedometerExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/QMI8658_PedometerExample/LoRaBoards.cpp +++ b/examples/Sensor/QMI8658_PedometerExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/QMI8658_ReadFromFifoExample/LoRaBoards.cpp b/examples/Sensor/QMI8658_ReadFromFifoExample/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/QMI8658_ReadFromFifoExample/LoRaBoards.cpp +++ b/examples/Sensor/QMI8658_ReadFromFifoExample/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/Sensor/QMI8658_WakeOnMotion/LoRaBoards.cpp b/examples/Sensor/QMI8658_WakeOnMotion/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/Sensor/QMI8658_WakeOnMotion/LoRaBoards.cpp +++ b/examples/Sensor/QMI8658_WakeOnMotion/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif } diff --git a/examples/T3S3Factory/LoRaBoards.cpp b/examples/T3S3Factory/LoRaBoards.cpp index 697ea86..bbe966a 100644 --- a/examples/T3S3Factory/LoRaBoards.cpp +++ b/examples/T3S3Factory/LoRaBoards.cpp @@ -129,6 +129,7 @@ bool beginPower() PMU->disablePowerOutput(XPOWERS_BLDO2); PMU->disablePowerOutput(XPOWERS_DLDO1); PMU->disablePowerOutput(XPOWERS_DLDO2); + PMU->disablePowerOutput(XPOWERS_CPULDO); // GNSS RTC PowerVDD 3300mV PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300); @@ -341,10 +342,6 @@ void disablePeripherals() PMU->disableBattVoltageMeasure(); PMU->disableTemperatureMeasure(); PMU->disableBattDetection(); - // Disable all PMU interrupts - PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); - // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase - PMU->clearIrqStatus(); #if defined(T_BEAM_S3_BPF) PMU->disablePowerOutput(XPOWERS_ALDO4); //gps @@ -353,10 +350,33 @@ void disablePeripherals() PMU->disablePowerOutput(XPOWERS_DCDC5); PMU->disablePowerOutput(XPOWERS_ALDO1); #else - // LoRa VDD - PMU->disablePowerOutput(XPOWERS_ALDO2); - //GNSS VDD - PMU->disablePowerOutput(XPOWERS_ALDO3); + + if (PMU->getChipModel() == XPOWERS_AXP2101) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // GNSS RTC Power , Turning off GPS backup voltage and current can further reduce ~ 100 uA + PMU->disablePowerOutput(XPOWERS_VBACKUP); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_ALDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_ALDO3); + + } else if (PMU->getChipModel() == XPOWERS_AXP192) { + + // Disable all PMU interrupts + PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ); + // Clear the PMU interrupt status before sleeping, otherwise the sleep current will increase + PMU->clearIrqStatus(); + // LoRa VDD + PMU->disablePowerOutput(XPOWERS_LDO2); + // GNSS VDD + PMU->disablePowerOutput(XPOWERS_LDO3); + + + } #endif #endif }