18#ifndef __HAL_DRIVER_NUVOTON_M480_PM_H__
19#define __HAL_DRIVER_NUVOTON_M480_PM_H__
24#include "../../__device.h"
28#define VSF_PM_CFG_REIMPLEMENT_TYPE_PLL_CFG ENABLED
29#define VSF_PM_CFG_REIMPLEMENT_TYPE_PLL_SEL ENABLED
31#define VSF_PM_CFG_REIMPLEMENT_TYPE_POWER_NUMBER ENABLED
32#define VSF_PM_CFG_REIMPLEMENT_TYPE_POWER_NUMBER_MASK ENABLED
33#define VSF_PM_CFG_REIMPLEMENT_TYPE_SLEEP_MODE ENABLED
34#define VSF_PM_CFG_REIMPLEMENT_TYPE_PCLK_NUMBER ENABLED
35#define VSF_PM_CFG_REIMPLEMENT_TYPE_PCLK_CFG ENABLED
36#define VSF_PM_CFG_REIMPLEMENT_TYPE_SCLK_NUMBER ENABLED
37#define VSF_PM_CFG_REIMPLEMENT_TYPE_SCLK_NUMBER_MASK ENABLED
38#define VSF_PM_CFG_REIMPLEMENT_TYPE_SCLK_SEL ENABLED
39#define VSF_PM_CFG_REIMPLEMENT_TYPE_MCLK_CFG ENABLED
40#define VSF_PM_CFG_REIMPLEMENT_TYPE_MCLK_NO ENABLED
44#define __def_idx(__name, __no) VSF_MCONNECT2(__name, _IDX) = (__no)
45#define __def_msk(__name) VSF_MCONNECT2(__name, _MSK) = VSF_BIT(VSF_MCONNECT2(__name, _IDX) & 0x1F)
50#define __def_pclk(__name, __bf_clksel, __bf_clkdiv, __clksel_map_idx) \
51 VSF_MCONNECT2(__name, _IDX) = ((__bf_clksel) << 0) \
52 | ((__bf_clkdiv) << 14) \
53 | ((__clksel_map_idx) << 28)
55#define __def_sclk_idx(__name, __bus_idx, __bit_idx) \
56 VSF_MCONNECT2(__name, _IDX) = ((__bit_idx) << 0) | ((__bus_idx) << 5)
58#define __def_clk_src(__name, __value) \
587#define VSF_PM_CFG_DEC_PREFIX vsf_hw
588#define VSF_PM_CFG_DEC_UPCASE_PREFIX VSF_HW
#define __def_idx(__name, __no)
Definition pm.h:44
#define __def_clk_src(__name, __value)
Definition pm.h:58
pm_periph_clksrc_t
Definition pm.h:93
@ CLKSRC_HCLKD2
Definition pm.h:103
@ CLKSRC_LXT
Definition pm.h:96
@ CLKSRC_TM2_PIN
Definition pm.h:110
@ CLKSRC_HIRCD2
Definition pm.h:98
@ CLKSRC_HXT
Definition pm.h:94
@ CLKSRC_HCLK
Definition pm.h:102
@ CLKSRC_PCLK1
Definition pm.h:106
@ CLKSRC_PCLK0
Definition pm.h:105
@ CLKSRC_HCLKD2K
Definition pm.h:104
@ CLKSRC_LIRC
Definition pm.h:99
@ CLKSRC_PLL
Definition pm.h:101
@ CLKSRC_HIRC
Definition pm.h:97
@ CLKSRC_TM0_PIN
Definition pm.h:108
@ CLKSRC_TM3_PIN
Definition pm.h:111
@ CLKSRC_TM1_PIN
Definition pm.h:109
@ CLKSRC_HXTD2
Definition pm.h:95
#define __def_sclk_idx(__name, __bus_idx, __bit_idx)
Definition pm.h:55
vsf_pm_mclk_no_t
Definition pm.h:254
@ VSF_MCLK_CORE_IDX
Definition pm.h:255
vsf_pm_sclk_msk_t
Definition pm.h:323
vsf_pm_pll_sel_t
Definition pm.h:545
@ VSF_PLL0_IDX
Definition pm.h:546
vsf_pm_power_cfg_msk_t
power set mask
Definition pm.h:71
vsf_pm_power_cfg_no_t
power set index
Definition pm.h:63
struct vsf_pm_mclk_cfg_t vsf_pm_mclk_cfg_t
main clock config struct
vsf_pm_pclk_no_t
peripheral clock index
Definition pm.h:170
@ M480_BIT_FIELD
Definition pm.h:172
struct io_wakeup_cfg_t io_wakeup_cfg_t
pm_periph_clksel_t
Definition pm.h:114
@ RTC_CLKSEL_MAP
Definition pm.h:146
@ SPI0_CLKSEL_MAP_IDX
Definition pm.h:156
@ SPI3_CLKSEL_MAP_IDX
Definition pm.h:159
@ TMR0_CLKSEL_MAP_IDX
Definition pm.h:133
@ WDT_CLKSEL_MAP
Definition pm.h:136
@ SDH0_CLKSEL_MAP_IDX
Definition pm.h:148
@ EPWM0_CLKSEL_MAP_IDX
Definition pm.h:162
@ SDH1_CLKSEL_MAP_IDX
Definition pm.h:149
@ UART4_CLKSEL_MAP_IDX
Definition pm.h:154
@ STCLK_CLKSEL_MAP_IDX
Definition pm.h:117
@ SPI13_CLKSEL_MAP
Definition pm.h:138
@ BPWM1_CLKSEL_MAP_IDX
Definition pm.h:141
@ EPWM1_CLKSEL_MAP_IDX
Definition pm.h:161
@ HCLK_CLKSEL_MAP
Definition pm.h:120
@ SDH_CLKSEL_MAP
Definition pm.h:116
@ BPWM0_CLKSEL_MAP_IDX
Definition pm.h:143
@ TMR0_CLKSEL_MAP
Definition pm.h:134
@ UART_CLKSEL_MAP_IDX
Definition pm.h:125
@ TMR3_CLKSEL_MAP_IDX
Definition pm.h:127
@ WDT_CLKSEL_MAP_IDX
Definition pm.h:135
@ TMR2_CLKSEL_MAP_IDX
Definition pm.h:129
@ TMR1_CLKSEL_MAP_IDX
Definition pm.h:131
@ HCLK_CLKSEL_MAP_IDX
Definition pm.h:119
@ I2S0_CLKSEL_MAP_IDX
Definition pm.h:163
@ CLKO_CLKSEL_MAP
Definition pm.h:124
@ SPI02_CLKSEL_MAP
Definition pm.h:140
@ SPI2_CLKSEL_MAP_IDX
Definition pm.h:158
@ RTC_CLKSEL_MAP_IDX
Definition pm.h:145
@ UART3_CLKSEL_MAP_IDX
Definition pm.h:153
@ UART_CLKSEL_MAP
Definition pm.h:126
@ TMR2_CLKSEL_MAP
Definition pm.h:130
@ TMR1_CLKSEL_MAP
Definition pm.h:132
@ SPI1_CLKSEL_MAP_IDX
Definition pm.h:157
@ SC1_CLKSEL_MAP_IDX
Definition pm.h:165
@ QSPI0_CLKSEL_MAP_IDX
Definition pm.h:160
@ SPI02_CLKSEL_MAP_IDX
Definition pm.h:139
@ UART5_CLKSEL_MAP_IDX
Definition pm.h:155
@ SPI13_CLKSEL_MAP_IDX
Definition pm.h:137
@ CLKO_CLKSEL_MAP_IDX
Definition pm.h:123
@ BPWM1_CLKSEL_MAP
Definition pm.h:142
@ SDH_CLKSEL_MAP_IDX
Definition pm.h:115
@ SC0_CLKSEL_MAP_IDX
Definition pm.h:164
@ TMR3_CLKSEL_MAP
Definition pm.h:128
@ BPWM0_CLKSEL_MAP
Definition pm.h:144
@ UART0_CLKSEL_MAP_IDX
Definition pm.h:150
@ WWDT_CLKSEL_MAP_IDX
Definition pm.h:121
@ UART2_CLKSEL_MAP_IDX
Definition pm.h:152
@ SC2_CLKSEL_MAP_IDX
Definition pm.h:166
@ WWDT_CLKSEL_MAP
Definition pm.h:122
@ STCLK_CLKSEL_MAP
Definition pm.h:118
@ UART1_CLKSEL_MAP_IDX
Definition pm.h:151
#define __def_pclk(__name, __bf_clksel, __bf_clkdiv, __clksel_map_idx)
Definition pm.h:50
#define __def_msk(__name)
Definition pm.h:45
vsf_pm_sclk_no_t
Peripheral AHB Clock Macros.
Definition pm.h:258
vsf_pm_sleep_mode_t
the lowpower mode
Definition pm.h:79
@ VSF_PM_SPD1
Definition pm.h:84
@ VSF_PM_POWER_OFF
Definition pm.h:90
@ VSF_PM_DEEP_SLEEP
Definition pm.h:89
@ VSF_PM_SPD0
Definition pm.h:83
@ VSF_PM_DPD
Definition pm.h:85
@ VSF_PM_LLPD
Definition pm.h:81
@ VSF_PM_WAIT
Definition pm.h:87
@ VSF_PM_FWPD
Definition pm.h:82
@ VSF_PM_NPD
Definition pm.h:80
@ VSF_PM_SLEEP
Definition pm.h:88
vsf_pm_clk_src_sel_t
Definition pm.h:387
unsigned short uint16_t
Definition lvgl.h:41
unsigned int uint32_t
Definition lvgl.h:43
unsigned char uint8_t
Definition lvgl.h:40
uint32_t dummy
Definition pm.h:550
main clock config struct
Definition vsf_template_pm.h:347
uint16_t apb_div[2]
system APB clock divider
Definition pm.h:573
uint16_t core_div[1]
system core clock divider
Definition pm.h:571
uint32_t freq
system oscillator frequency
Definition vsf_template_pm.h:349
vsf_pm_clk_src_sel_t clk_src
main clock source
Definition vsf_template_pm.h:348
uint16_t ahb_div[1]
system AHB clock divider
Definition pm.h:572
Definition vsf_template_pm.h:314
uint16_t div
Definition vsf_template_pm.h:316
vsf_pm_clk_src_sel_t clk_src
Definition vsf_template_pm.h:315
pll config struct
Definition vsf_template_pm.h:381
uint8_t Psel
pll Feedback divider value
Definition pm.h:581
vsf_pm_clk_src_sel_t pll_clk_src
pll clock source
Definition vsf_template_pm.h:382
uint8_t Msel
PLL Feedback divider value.
Definition pm.h:580
uint32_t freq
system oscillator frequency
Definition vsf_template_pm.h:383
vsf_pm_mclk_no_t
Definition vsf_template_pm.h:354
vsf_pm_sclk_msk_t
Definition vsf_template_pm.h:251
vsf_pm_pll_sel_t
Definition vsf_template_pm.h:374
vsf_pm_power_cfg_msk_t
Definition vsf_template_pm.h:210
vsf_pm_power_cfg_no_t
Definition vsf_template_pm.h:204
vsf_pm_pclk_no_t
Definition vsf_template_pm.h:304
vsf_pm_sclk_no_t
Definition vsf_template_pm.h:242
vsf_pm_sleep_mode_t
Definition vsf_template_pm.h:222
vsf_pm_clk_src_sel_t
Definition vsf_template_pm.h:266