Skip to main content
Knowledgebase
Home
Renesas India - Knowledgebase

r_lpmv2 Module Guide Resources

Last Updated:07/31/2017

Question:

Where can I find the references to module guide resources for the Low Power Modes HAL module on r_lpmv2?

Answer:

Information on the module guide itself and the associated resources and known issues are available here.

Introduction

The LPM V2 HAL module supports configuration of MCU operating power-control modes and MCU low-power
modes using the low-power mode hardware peripheral.

The LPM V2 HAL module supports the following low power modes:
• Deep Software Standby mode
• Software Standby mode
• Sleep mode
• Snooze mode

The LPM V2 HAL module supports reducing power consumption when in deep stand-by mode through internal
power-supply control and by resetting the states of I/O ports. The LPM V2 HAL module supports disabling and
enabling of the MCU’s other hardware peripherals.Note: Not all low-power V2 modes are available on all MCUs Groups.

Module Guide

The LPMV2 HAL module guide is targeted for SSP 1.2.0 and the SK-S7G2 Kit.

The most recent versions of the LPMV2 HAL module guide application note, application project and import guide are available here.

Module Guide Resources

The following application projects for the LPMV2 HAL module are available from the Synergy Gallery. You can find them in the zip file located on the right side of the page here

  • LPM ADC DK-S124 with SSP 1.2.0
  • LPM ADC DK-S3A7 with SSP 1.2.0
  • LPM and Mode Transitions with SSP 1.2.0

Known issues

  • Refer to the SSP release notes for known issues, available here.

Additional Information- Examples of Custom Usage

Here are some examples that may help with customizing your own implementation. 

Sleep Low-Power Mode: LPMV2

By default, at power on, sleep mode is enabled as the low-power mode. Sleep mode is the most convenient low-power mode available, as it does not require any special configuration (other than configuring and enabling a suitable interrupt or event to wake the MCU from sleep) to return to normal program-execution mode. Any interrupt wakes the MCU device from sleep low-power mode. The states of the SRAM, the processor registers, and the hardware peripherals are all maintained in sleep mode, and the time needed to enter and wake from sleep is minimal. Any interrupt causes the MCU device to wake from sleep mode, including the Systick interrupt used by the ThreadX® thread scheduler. The LPM API function lpm_v2_api_t::init  should be called before any other function. The LPM API function, lpm_v2_api_t::lowPowerCfg, can be used to configure the MCU to use sleep as its low‑power mode. The LPM API function lpm_v2_api_t::lowPowerModeEnter should be used to directly enter sleep mode.

The following code example configures sleep as a low-power mode and enters low-power mode sleep. In this example, the LPM V2 sleep module uses the name g_lpmv2_sleep0:

/* HAL-only entry function */

#include "hal_data.h"

void hal_entry(void)

{

    ssp_err_t error = SSP_SUCCESS;

    /* Initialize the LPM V2 Driver */

    error = g_lpmv2_sleep0.p_api->init();

 

    /* Handle error if any */

 

    /* Configure LPM peripheral for sleep mode */

    error = g_lpmv2_sleep0.p_api->lowPowerCfg(g_lpmv2_sleep0.p_cfg);

 

    /* Handle error if any */

 

    /* Entry sleep mode */

    error = g_lpmv2_sleep0.p_api->lowPowerModeEnter();

 

    /* Handle error if any */

}

 

Software Standby Mode: LPM V2

In software-standby mode, the CPU, as well as most of the on-chip peripheral functions and all of the internal oscillators, are stopped. Retained are the contents of the CPU internal registers and SRAM data, the states of on-chip peripheral functions and I/O Ports. Software-standby mode allows significant reduction in power consumption, because most of the oscillators are stopped in this mode. Like sleep mode, standby mode requires an interrupt or event be configured and enabled to wake from standby mode.

The possible triggers for waking from standby mode are enumerated in the Properties window for convenience; multiple triggers can be enabled.

The following code example is for configuring standby as the low-power mode and entering low-power mode standby. In this example, the LPM V2 standby module with name g_lpmv2_standby0 is used. The code for using the standby module with snooze enabled is identical.

/* HAL-only entry function */

#include "hal_data.h"

void hal_entry(void)

{

    ssp_err_t error = SSP_SUCCESS;

 

    /* Initialize the LPM V2 Driver */

    error = g_lpmv2_standby0.p_api->init();

 

    /* Handle error if any */

 

    /* Configure LPM peripheral for standby mode */

    error = g_lpmv2_standby0.p_api->lowPowerCfg(g_lpmv2_standby0.p_cfg);

 

    /* Handle error if any */

 

    /* Entry standby mode */

    error = g_lpmv2_standby0.p_api->lowPowerModeEnter();

 

    /* Handle error if any */

}

 

Snooze Mode with Software Standby Mode: LPM V2

Snooze mode is available through the standby mode LPM V2 instance. Choose "Standby with Snooze Enabled" for “Choose the low power mode” in the Properties window. Snooze mode can be used with some MCU peripherals to execute basic tasks, while keeping the MCU in a low-power state. The snooze settings are below the standby settings in the Properties window. The ADC, DTC, and other peripherals can be enabled in snooze mode. All the settings for snooze are available through configuration properties for the standby instance, with the exception of the Event Link Controller settings for registers SELSR0 and IELSRn. Snooze is considered an advanced feature.

The “Snooze Mode Settings” are only used if the low-power mode choice is “Standby with Snooze Enabled,” as shown in the following screen capture:

KB_LPMV2_Fig1.png

Snooze is a feature of standby mode that allows some peripherals to run even though the MCU core is not executing instructions. The low-power mode peripheral options related to snooze mode are shown in the following image. Only one snooze-entry source can be enabled, while multiple snooze-exit sources can be enabled; the DTC peripheral can be enabled in snooze mode as well.

KB_LPMV2_Fig2.png

 

Deep Software Standby Mode: LPM V2

Deep Software Standby Mode is only available on some MCU devices. The MCU device always wakes from Deep Software Standby Mode by going through reset, either by the negation of the reset pin or by one of a set of wake up events displayed in the configuration Properties window for the LPM deep standby instance.

The possible triggers for waking from deep standby mode are enumerated in the Properties window for convenience. Multiple triggers can be enabled. Some triggers have an associated edge type, falling or rising. These options are enumerated also as shown above and below.

The following code example is for configuring deep standby as the low power mode and entering low power mode deep standby. In this example, the LPM V2 deep standby module with name g_lpmv2_deep_standby0 is used.

/* HAL-only entry function */

#include "hal_data.h"

void hal_entry(void)

{

    ssp_err_t error = SSP_SUCCESS;

 

    /* Initialize the LPM V2 Driver */

    error = g_lpmv2_deep_standby0.p_api->init();

 

    /* Handle error if any */

 

    /* Configure LPM peripheral for deep sleep mode */

    error = g_lpmv2_deep_standby0.p_api->lowPowerCfg(g_lpmv2_deep_standby0.p_cfg);

 

    /* Handle error if any */

 

    /* Entry deep sleep mode */

    error = g_lpmv2_deep_standby0.p_api->lowPowerModeEnter();

 

    /* Handle error if any */

 
LPMV2 HAL module on r_lmpv2 (SSP 1.2.0)
  • Was this article helpful?