### void begin() Source: https://github.com/stm32duino/stm32lowpower/blob/main/README.md Initializes and configures the Low Power functionality. This function must be called before using other low-power functions like idle(), sleep(), deepSleep(), or shutdown(). ```APIDOC ## void begin() ### Description Initializes and configures the Low Power functionality. ### Method `void` ### Parameters None ### Notes This function must be called at least once before `idle()`, `sleep()`, `deepSleep()`, or `shutdown()` functions. ``` -------------------------------- ### void enableWakeupFrom(HardwareSerial *serial, voidFuncPtrVoid callback) Source: https://github.com/stm32duino/stm32lowpower/blob/main/README.md Enables a UART peripheral to wake up the system from a low-power mode. A callback function is executed upon wake-up. ```APIDOC ## void enableWakeupFrom(HardwareSerial *serial, voidFuncPtrVoid callback) ### Description Enables a specified UART peripheral to act as a wakeup source from a low-power mode. Refer to the board documentation for compatibility details regarding low-power modes. ### Method `void` ### Parameters #### Path Parameters - **serial** (HardwareSerial *) - Required - A pointer to the UART peripheral to be enabled for wake-up. - **callback** (voidFuncPtrVoid) - Required - A pointer to the callback function to be executed when the board is woken up by the UART. ### Notes - HardwareSerial used as a Wakeup source will configure it to use the HSI clock source, even if another peripheral clock is already configured. - Wakeup from UART is not supported for STM32WB0x and STM32WL3x. ``` -------------------------------- ### void enableWakeupFrom(TwoWire *wire, voidFuncPtrVoid callback) Source: https://github.com/stm32duino/stm32lowpower/blob/main/README.md Enables an I2C peripheral for wake-up from a low-power mode. This functionality is currently not available. ```APIDOC ## void enableWakeupFrom(TwoWire *wire, voidFuncPtrVoid callback) ### Description Enables a specified I2C peripheral to act as a wake-up source from a low-power mode. Please note that this functionality is currently not available. ### Method `void` ### Parameters #### Path Parameters - **wire** (TwoWire *) - Required - A pointer to the I2C peripheral to be enabled for wake-up. - **callback** (voidFuncPtrVoid) - Required - A pointer to the callback function to be executed when the board is woken up by the I2C. ``` -------------------------------- ### void enableWakeupFrom(STM32RTC *rtc, voidFuncPtr callback, void * data) Source: https://github.com/stm32duino/stm32lowpower/blob/main/README.md Attaches a callback function to the RTC peripheral to trigger wake-up from a low-power mode. Optional data can be passed to the callback. ```APIDOC ## void enableWakeupFrom(STM32RTC *rtc, voidFuncPtr callback, void * data) ### Description Attaches a callback function to the RTC peripheral, enabling it to trigger a wake-up from a low-power mode. Optional data can be passed to the callback function. ### Method `void` ### Parameters #### Path Parameters - **rtc** (STM32RTC *) - Optional - A pointer to the RTC peripheral. Can be NULL as RTC is a Singleton. - **callback** (voidFuncPtr) - Required - A pointer to the callback function to be executed when the board is woken up by the RTC. - **data** (void *) - Optional - An optional pointer to callback data parameters (defaults to NULL). ``` -------------------------------- ### void idle(uint32_t ms) Source: https://github.com/stm32duino/stm32lowpower/blob/main/README.md Enters the microcontroller into Idle mode, a low-power state with minimal power saving mainly on the core. Optionally, specifies a wakeup time in milliseconds. ```APIDOC ## void idle(uint32_t ms) ### Description Enters the microcontroller into Idle mode. In this mode, wake-up latency is in the microsecond range. Memories and voltage supplies are retained, offering minimal power saving primarily on the core itself. ### Method `void` ### Parameters #### Path Parameters - **ms** (uint32_t) - Optional - Number of milliseconds before exiting the mode. The RTC is used in alarm mode to wake up the chip in `ms` milliseconds. ``` -------------------------------- ### void attachInterruptWakeup(uint32_t pin, voidFuncPtrVoid callback, uint32_t mode, LP_Mode LowPowerMode) Source: https://github.com/stm32duino/stm32lowpower/blob/main/README.md Enables a GPIO pin for interrupt-driven wake-up from a low-power mode. The pin is configured as a wakeup source. ```APIDOC ## void attachInterruptWakeup(uint32_t pin, voidFuncPtrVoid callback, uint32_t mode, LP_Mode LowPowerMode) ### Description Enables a GPIO pin to trigger an interrupt, serving as a wakeup source from a low-power mode. If the specified pin is a designated wakeup pin for the board, it will be configured accordingly. ### Method `void` ### Parameters #### Path Parameters - **pin** (uint32_t) - Required - The pin number to configure for interrupt wake-up. - **callback** (voidFuncPtrVoid) - Required - A pointer to the callback function to be executed when the interrupt occurs. - **mode** (uint32_t) - Required - The interrupt mode (e.g., HIGH, LOW, RISING, FALLING, CHANGE). - **LowPowerMode** (LP_Mode) - Required - The low-power mode to be used for wake-up (IDLE_MODE, SLEEP_MODE, DEEP_SLEEP_MODE, or SHUTDOWN_MODE). If SHUTDOWN_MODE is selected, only the Wakeup pin capability is activated. ``` -------------------------------- ### void shutdown(uint32_t ms) Source: https://github.com/stm32duino/stm32lowpower/blob/main/README.md Enters the microcontroller into Shutdown mode, the deepest low-power state with high wake-up latency, where voltage supplies are cut except for the always-on domain. Optionally, specifies a wakeup time in milliseconds. ```APIDOC ## void shutdown(uint32_t ms) ### Description Enters the microcontroller into Shutdown mode, offering the deepest power saving with high wake-up latency (hundreds of milliseconds or seconds). In this mode, voltage supplies are cut except for the always-on domain, and memory content is lost, causing the system to reboot upon wake-up. ### Method `void` ### Parameters #### Path Parameters - **ms** (uint32_t) - Optional - Number of milliseconds before exiting the mode. The RTC is used in alarm mode to wake up the board in `ms` milliseconds. ### Notes - The board will restart when exiting shutdown mode. - For STM32WB0x and STM32WL3x, shutdown wakeup is only possible via the reset pin. - With STM32RTC version lower than 1.1.0, the minimum number of milliseconds is 1000 ms. ``` -------------------------------- ### void sleep(uint32_t ms) Source: https://github.com/stm32duino/stm32lowpower/blob/main/README.md Enters the microcontroller into Sleep mode, a low-power state with higher power saving than Idle mode. Optionally, specifies a wakeup time in milliseconds. ```APIDOC ## void sleep(uint32_t ms) ### Description Enters the microcontroller into Sleep mode. This mode offers higher power saving than Idle mode while maintaining low wake-up latency in the microsecond range. Memories and voltage supplies are retained. ### Method `void` ### Parameters #### Path Parameters - **ms** (uint32_t) - Optional - Number of milliseconds before exiting the mode. The RTC is used in alarm mode to wake up the chip in `ms` milliseconds. ``` -------------------------------- ### void deepSleep(uint32_t ms) Source: https://github.com/stm32duino/stm32lowpower/blob/main/README.md Enters the microcontroller into Deep Sleep mode, a low-power state with medium latency where clocks are gated to reduce power consumption. Optionally, specifies a wakeup time in milliseconds. ```APIDOC ## void deepSleep(uint32_t ms) ### Description Enters the microcontroller into Deep Sleep mode. This mode features medium wake-up latency (millisecond range) as clocks are gated to reduce power consumption. Memories and voltage supplies are retained. If supported, peripherals like UART and I2C can be used for wake-up. ### Method `void` ### Parameters #### Path Parameters - **ms** (uint32_t) - Optional - Number of milliseconds before exiting the mode. The RTC is used in alarm mode to wake up the chip in `ms` milliseconds. ### Notes For STM32WB0x and STM32WL3x, the board will restart when exiting deep sleep mode. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.