L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
Loading...
Searching...
No Matches
stm32_lpm_if.c File Reference

Low layer function to enter/exit low power modes (stop, sleep). More...

#include "platform.h"
#include "stm32_lpm.h"
#include "stm32_lpm_if.h"
#include "usart_if.h"
#include "spi.h"
#include "rtc.h"
#include "adc.h"
#include "lora_app.h"
#include "timer_if.h"
#include "mymems.h"
#include "radio.h"
#include "mysensors_base.h"
Include dependency graph for stm32_lpm_if.c:

Go to the source code of this file.

Functions

void PWR_EnterOffMode (void)
 Accumulates the total time spent in STOP or SLEEP mode (in ms or ticks). Incremented each time PWR_ExitStopMode() or PWR_ExitSleepMode() is called so that the application can track duty-cycle or battery consumption.
void PWR_ExitOffMode (void)
 Exits Low Power Off Mode.
void PWR_EnterStopMode (void)
 Enters Low Power Stop Mode.
void PWR_ExitStopMode (void)
 Exits Low Power Stop Mode.
void PWR_EnterSleepMode (void)
 Enters Low Power Sleep Mode.
void PWR_ExitSleepMode (void)
 Exits Low Power Sleep Mode.

Variables

const struct UTIL_LPM_Driver_s UTIL_PowerDriver
 Power driver callbacks handler.

Detailed Description

Low layer function to enter/exit low power modes (stop, sleep).

Author
MCD Application Team
Attention

Copyright (c) 2026 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32_lpm_if.c.

Function Documentation

◆ PWR_EnterOffMode()

void PWR_EnterOffMode ( void )

Accumulates the total time spent in STOP or SLEEP mode (in ms or ticks). Incremented each time PWR_ExitStopMode() or PWR_ExitSleepMode() is called so that the application can track duty-cycle or battery consumption.

Enters Low Power Off Mode

Definition at line 85 of file stm32_lpm_if.c.

References hadc, hrtc, MX_SPI1_DeInit(), NFC_INT_Pin, RTC_BKP_STANDBY, RTC_BKP_STANDBY_SIGN, and setBackUpRegister().

Here is the call graph for this function:

◆ PWR_EnterSleepMode()

void PWR_EnterSleepMode ( void )

Enters Low Power Sleep Mode.

Note
ARM exits the function when waking up

Definition at line 260 of file stm32_lpm_if.c.

References writeLog().

Here is the call graph for this function:

◆ PWR_EnterStopMode()

void PWR_EnterStopMode ( void )

Enters Low Power Stop Mode.

Note
ARM exists the function when waking up

Definition at line 206 of file stm32_lpm_if.c.

References MX_SPI1_DeInit(), sensorsBase_StartTimerToOff(), and writeLog().

Here is the call graph for this function:

◆ PWR_ExitOffMode()

void PWR_ExitOffMode ( void )

Exits Low Power Off Mode.

Definition at line 198 of file stm32_lpm_if.c.

◆ PWR_ExitSleepMode()

void PWR_ExitSleepMode ( void )

Exits Low Power Sleep Mode.

Note
ARM exits the function when waking up

Definition at line 277 of file stm32_lpm_if.c.

References writeLog().

Here is the call graph for this function:

◆ PWR_ExitStopMode()

void PWR_ExitStopMode ( void )

Exits Low Power Stop Mode.

Note
Enable the pll at 32MHz

Definition at line 236 of file stm32_lpm_if.c.

References MX_SPI1_Init(), sensorsBase_StopTimerToOff(), SystemClock_Config(), uart_Start(), vcom_Resume(), and writeLog().

Here is the call graph for this function:

Variable Documentation

◆ UTIL_PowerDriver

const struct UTIL_LPM_Driver_s UTIL_PowerDriver
Initial value:
=
{
}
void PWR_ExitStopMode(void)
Exits Low Power Stop Mode.
void PWR_EnterOffMode(void)
Accumulates the total time spent in STOP or SLEEP mode (in ms or ticks). Incremented each time PWR_Ex...
void PWR_EnterSleepMode(void)
Enters Low Power Sleep Mode.
void PWR_EnterStopMode(void)
Enters Low Power Stop Mode.
void PWR_ExitSleepMode(void)
Exits Low Power Sleep Mode.
void PWR_ExitOffMode(void)
Exits Low Power Off Mode.

Power driver callbacks handler.

Definition at line 47 of file stm32_lpm_if.c.