This example project will show user how to use and configure the basic functionalities of WKPU + RTC timeout.
------------------------------------------------------------------------------
* Test HW: S32K3X4EVB-T172 (SCH-53148 REV B2)
* MCU: S32K344
* IDE: S32DS3.5 & S32DS3.6
* SDK release: RTD 6.0.0
* Debugger: PE Micro
* Target: internal_FLASH
------------------------------------------------------------------------------
This example routine configures the WKPU & RTC units for wake-up. The RTC is present in always ON domain, hence available in RUN mode as well as in STANDBY mode.
The RTC can trigger a single wake-up event (timeout). When the RTC counter reaches a specific, pre-defined alarm time set by the user.
RTC timeout is mapped as wake-up source 1. RTC0_CLK source is configured as SIRC_CLK, and SIRC_CLK must be enabled in standby mode.
Chapter 69.3.1 RTC explains the functionality of the RTC timer. RTCVAL is updated at the point where no counter match is due as per the previous RTCVAL, the RTCF flag is set when the counter matches the new value. If there is a match when in the low-power mode, then the RTC first generates a wakeup request to force a wakeup to run mode, and then the RTCF flag is set.
The routine waits for SW5 to be pressed, then turns off the green LED, and enters Wkpu_EnterStandby() function which:
After the period defined with RTC_TIME or RTC_PERIOD_DELAY_MS(x) macros defined in Wkpu.h, MCU wakes up. After wake-up, MCU resets and polls for SW5 to be pressed again.
This example is provided as is with no guarantees and no support.