User`s manual
RX62N Group, RX621 Group 5. Usage Examples
5.3. Low Power Consumption
5.3.1.
Software Standby Mode
Figure 5-3 shows an example of entering Software Standby mode through Low Power Consumption control.
/* Peripheral driver function prototypes */
#include "r_pdl_lpc.h"
#include "r_pdl_intc.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
void SW2_handler(void);
void main(void)
{
/* Enable the switch SW2 interrupt */
R_INTC_CreateExtInterrupt(
PDL_INTC_IRQ9,
PDL_INTC_FALLING | PDL_INTC_A,
SW2_handler,
7
);
/* Select the default options */
R_LPC_Create(
PDL_NO_DATA,
PDL_NO_DATA
);
/* Enter software standby mode */
R_LPC_Control(
PDL_LPC_MODE_SOFTWARE_STANDBY
);
/* Normal execution will resume after switch SW2 is pressed */
}
void SW2_handler(void)
{
nop();
}
Figure 5-3: Example of Software Standby Mode
R20UT0084EE0112 Rev.1.12 Page 5-5
July. 16, 2014