summaryrefslogtreecommitdiff
path: root/bsp/hc32/ev_hc32f448_lqfp80/board/config/pm_config.h
blob: 1e5b5c9a8ee585d207b92aa390b8df2ce50ce756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
 * Copyright (c) 2006-2022, RT-Thread Development Team
 * Copyright (c) 2022-2024, Xiaohua Semiconductor Co., Ltd.
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2024-02-20     CDT          first version
 * 2026-06-24     CDT          delete PM_TICKLESS_TIMER_ENABLE_MASK for unsupport pm tickless timer
 */

#ifndef __PM_CONFIG_H__
#define __PM_CONFIG_H__

#include <rtthread.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifdef BSP_USING_PM
extern void rt_hw_board_pm_sysclk_cfg(uint8_t run_mode);

/**
 * @brief  run mode config @ref pm_run_mode_config structure
 */
#ifndef PM_RUN_MODE_CFG
#define PM_RUN_MODE_CFG                          \
    {                                            \
        .sys_clk_cfg = rt_hw_board_pm_sysclk_cfg \
    }
#endif /* PM_RUN_MODE_CFG */

/**
 * @brief  sleep idle config @ref pm_sleep_mode_idle_config structure
 */
#ifndef PM_SLEEP_IDLE_CFG
#define PM_SLEEP_IDLE_CFG                    \
    {                                        \
        .pwc_sleep_type = PWC_SLEEP_WFE_INT, \
    }
#endif /*PM_SLEEP_IDLE_CFG*/

/**
 * @brief  sleep deep config @ref pm_sleep_mode_deep_config structure
 */
#ifndef PM_SLEEP_DEEP_CFG
#define PM_SLEEP_DEEP_CFG                           \
    {                                               \
        {                                           \
            .u16Clock = PWC_STOP_CLK_KEEP,          \
            .u8StopDrv = PWC_STOP_DRV_HIGH,         \
            .u16ExBusHold = PWC_STOP_EXBUS_HIZ,     \
            .u16FlashWait = PWC_STOP_FLASH_WAIT_ON, \
        },                                          \
        .pwc_stop_type = PWC_STOP_WFE_INT,          \
    }
#endif /*PM_SLEEP_DEEP_CFG*/

/**
 * @brief  sleep standby config @ref pm_sleep_mode_standby_config structure
 */
#ifndef PM_SLEEP_STANDBY_CFG
#define PM_SLEEP_STANDBY_CFG                   \
    {                                          \
        {                                      \
            .u8Mode = PWC_PD_MD1,              \
            .u8IOState = PWC_PD_IO_KEEP1,      \
            .u8VcapCtrl = PWC_PD_VCAP_0P047UF, \
        },                                     \
    }
#endif /*PM_SLEEP_STANDBY_CFG*/

/**
 * @brief  sleep shutdown config @ref pm_sleep_mode_shutdown_config structure
 */
#ifndef PM_SLEEP_SHUTDOWN_CFG
#define PM_SLEEP_SHUTDOWN_CFG                  \
    {                                          \
        {                                      \
            .u8Mode = PWC_PD_MD3,              \
            .u8IOState = PWC_PD_IO_KEEP1,      \
            .u8VcapCtrl = PWC_PD_VCAP_0P047UF, \
        },                                     \
    }
#endif /*PM_SLEEP_SHUTDOWN_CFG*/

#endif /* BSP_USING_PM */

#ifdef __cplusplus
}
#endif

#endif /* __PM_CONFIG_H__ */