Skip to content

Commit db6ca32

Browse files
mmahadevan108nashif
authored andcommitted
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>
1 parent bfd5fab commit db6ca32

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

boards/nxp/frdm_rw612/init.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
#include <zephyr/pm/pm.h>
77
#include <fsl_power.h>
88
#include <fsl_common.h>
9+
#include <fsl_io_mux.h>
10+
11+
#define NON_AON_PINS_START 0
12+
#define NON_AON_PINS_BREAK 21
13+
#define NON_AON_PINS_RESTART 28
14+
#define NON_AON_PINS_END 63
15+
#define RF_CNTL_PINS_START 0
16+
#define RF_CNTL_PINS_END 3
17+
#define LED_BLUE_GPIO 0
18+
#define LED_RED_GPIO 1
19+
#define LED_GREEN_GPIO 12
920

1021
static void frdm_rw612_power_init_config(void)
1122
{
@@ -42,6 +53,26 @@ void board_early_init_hook(void)
4253
};
4354

4455
pm_notifier_register(&frdm_rw612_pm_notifier);
56+
57+
int32_t i;
58+
59+
/* Set all non-AON pins output low level in sleep mode. */
60+
for (i = NON_AON_PINS_START; i <= NON_AON_PINS_BREAK; i++) {
61+
IO_MUX_SetPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
62+
}
63+
for (i = NON_AON_PINS_RESTART; i <= NON_AON_PINS_END; i++) {
64+
IO_MUX_SetPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
65+
}
66+
67+
/* Set the LED GPIO output pins to be High in PM3 as these pins are Active Low */
68+
IO_MUX_SetPinOutLevelInSleep(LED_BLUE_GPIO, IO_MUX_SleepPinLevelHigh);
69+
IO_MUX_SetPinOutLevelInSleep(LED_RED_GPIO, IO_MUX_SleepPinLevelHigh);
70+
IO_MUX_SetPinOutLevelInSleep(LED_GREEN_GPIO, IO_MUX_SleepPinLevelHigh);
71+
72+
/* Set RF_CNTL 0-3 output low level in sleep mode. */
73+
for (i = RF_CNTL_PINS_START; i <= RF_CNTL_PINS_END; i++) {
74+
IO_MUX_SetRfPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
75+
}
4576
#endif
4677

4778
#ifdef CONFIG_I2S_TEST_SEPARATE_DEVICES

boards/nxp/rd_rw612_bga/init.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
#include <zephyr/pm/pm.h>
77
#include <fsl_power.h>
88
#include <fsl_common.h>
9+
#include <fsl_io_mux.h>
10+
11+
#define NON_AON_PINS_START 0
12+
#define NON_AON_PINS_BREAK 21
13+
#define NON_AON_PINS_RESTART 28
14+
#define NON_AON_PINS_END 63
15+
#define RF_CNTL_PINS_START 0
16+
#define RF_CNTL_PINS_END 3
917

1018
static void rdrw61x_power_init_config(void)
1119
{
@@ -42,6 +50,21 @@ void board_early_init_hook(void)
4250
};
4351

4452
pm_notifier_register(&rdrw61x_pm_notifier);
53+
54+
int32_t i;
55+
56+
/* Set all non-AON pins output low level in sleep mode. */
57+
for (i = NON_AON_PINS_START; i <= NON_AON_PINS_BREAK; i++) {
58+
IO_MUX_SetPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
59+
}
60+
for (i = NON_AON_PINS_RESTART; i <= NON_AON_PINS_END; i++) {
61+
IO_MUX_SetPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
62+
}
63+
64+
/* Set RF_CNTL 0-3 output low level in sleep mode. */
65+
for (i = RF_CNTL_PINS_START; i <= RF_CNTL_PINS_END; i++) {
66+
IO_MUX_SetRfPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
67+
}
4568
#endif
4669

4770
#ifdef CONFIG_I2S_TEST_SEPARATE_DEVICES

0 commit comments

Comments
 (0)