boards: rw612: Add code to configure the pins in PM Mode 3

These settings are used to put the pins in power saving mode
when we enter SUSPEND power mode.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
This commit is contained in:
Mahesh Mahadevan 2025-05-21 16:59:17 -05:00 committed by Anas Nashif
commit db6ca32346
2 changed files with 54 additions and 0 deletions

View file

@ -6,6 +6,17 @@
#include <zephyr/pm/pm.h>
#include <fsl_power.h>
#include <fsl_common.h>
#include <fsl_io_mux.h>
#define NON_AON_PINS_START 0
#define NON_AON_PINS_BREAK 21
#define NON_AON_PINS_RESTART 28
#define NON_AON_PINS_END 63
#define RF_CNTL_PINS_START 0
#define RF_CNTL_PINS_END 3
#define LED_BLUE_GPIO 0
#define LED_RED_GPIO 1
#define LED_GREEN_GPIO 12
static void frdm_rw612_power_init_config(void)
{
@ -42,6 +53,26 @@ void board_early_init_hook(void)
};
pm_notifier_register(&frdm_rw612_pm_notifier);
int32_t i;
/* Set all non-AON pins output low level in sleep mode. */
for (i = NON_AON_PINS_START; i <= NON_AON_PINS_BREAK; i++) {
IO_MUX_SetPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
}
for (i = NON_AON_PINS_RESTART; i <= NON_AON_PINS_END; i++) {
IO_MUX_SetPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
}
/* Set the LED GPIO output pins to be High in PM3 as these pins are Active Low */
IO_MUX_SetPinOutLevelInSleep(LED_BLUE_GPIO, IO_MUX_SleepPinLevelHigh);
IO_MUX_SetPinOutLevelInSleep(LED_RED_GPIO, IO_MUX_SleepPinLevelHigh);
IO_MUX_SetPinOutLevelInSleep(LED_GREEN_GPIO, IO_MUX_SleepPinLevelHigh);
/* Set RF_CNTL 0-3 output low level in sleep mode. */
for (i = RF_CNTL_PINS_START; i <= RF_CNTL_PINS_END; i++) {
IO_MUX_SetRfPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
}
#endif
#ifdef CONFIG_I2S_TEST_SEPARATE_DEVICES

View file

@ -6,6 +6,14 @@
#include <zephyr/pm/pm.h>
#include <fsl_power.h>
#include <fsl_common.h>
#include <fsl_io_mux.h>
#define NON_AON_PINS_START 0
#define NON_AON_PINS_BREAK 21
#define NON_AON_PINS_RESTART 28
#define NON_AON_PINS_END 63
#define RF_CNTL_PINS_START 0
#define RF_CNTL_PINS_END 3
static void rdrw61x_power_init_config(void)
{
@ -42,6 +50,21 @@ void board_early_init_hook(void)
};
pm_notifier_register(&rdrw61x_pm_notifier);
int32_t i;
/* Set all non-AON pins output low level in sleep mode. */
for (i = NON_AON_PINS_START; i <= NON_AON_PINS_BREAK; i++) {
IO_MUX_SetPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
}
for (i = NON_AON_PINS_RESTART; i <= NON_AON_PINS_END; i++) {
IO_MUX_SetPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
}
/* Set RF_CNTL 0-3 output low level in sleep mode. */
for (i = RF_CNTL_PINS_START; i <= RF_CNTL_PINS_END; i++) {
IO_MUX_SetRfPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
}
#endif
#ifdef CONFIG_I2S_TEST_SEPARATE_DEVICES