CI130X SDK API手册  2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
ci130x_dpmu.h
浏览该文件的文档.
1 #ifndef CI130X_DPMU_H
2 #define CI130X_DPMU_H
3 
4 #include "ci130x_system.h"
5 #include "ci130x_scu.h"
6 
7 typedef enum
8 {
14 
19 typedef enum
20 {
21  DPMU_WAKEUP_GPIO = 0, //aon gpio模块
22  DPMU_WAKEUP_IWDG = 1, //iwdg模块
23  DPMU_WAKEUP_EFUSE = 2, //efuse ctrl模块
24  DPMU_WAKEUP_TIMER01_GPWM01 = 3, //timer0/1_gpwm0/1模块
25  DPMU_WAKEUP_IO_REG = 4, //DPMU里IO相关控制寄存器
26  DPMU_WAKEUP_PMU_RC_REG = 5, //DPMU里PMU及RC相关控制寄存器
28 
40 typedef enum
41 {
46 
51 typedef enum
52 {
56 
61 typedef enum
62 {
63  DPMU_XTAL_EN = 10,
67 
72 typedef enum
73 {
77 
82 typedef enum
83 {
87 
92 typedef enum
93 {
99 
104 typedef enum
105 {
110 
111 
116 typedef enum
117 {
127 
128 
133 typedef enum
134 {
141 
142 
147 typedef enum
148 {
158 
163 typedef enum
164 {
182 
187 typedef enum
188 {
193 
198 typedef enum
199 {
217 
222 typedef enum
223 {
228 
232 void dpmu_unlock_cfg_config(void);
233 
237 void dpmu_lock_cfg_config(void);
238 
244 void dpmu_set_io_reuse(PinPad_Name pin,IOResue_FUNCTION io_function);
245 
252 
259 
266 
273 
280 
287 
294 
301 
306 void dpmu_iwdg_reset_none_config(void);
307 
313 
318 void dpmu_iwdg_reset_bus_config(void);
319 
324 void dpmu_twdg_reset_none_config(void);
325 
331 
336 void dpmu_twdg_reset_bus_config(void);
337 
343 
349 
355 
361 
367 
373 
382 void dpmu_set_ext_filter_config(Ext_Num num,FunctionalState flag,uint32_t param);
383 
388 void dpmu_set_iwdg_halt();
389 
394 void dpmu_clean_iwdg_halt();
395 
401 
407 void dpmu_pmu_trim_en(bool en);
408 
414 void dpmu_set_pmu_trim_value(uint8_t val);
415 
421 uint8_t dpmu_get_pmu_trim_value(void);
422 
428 void dpmu_pmu_div_resistance_en(bool en);
429 
436 
442 void dpmu_vdt_en(bool en);
443 
449 void dpmu_ldo2_en(bool en);
450 
456 void dpmu_ldo3_en(bool en);
457 
463 void dpmu_ldo1_lv_set(uint8_t lv);
464 
470 void dpmu_ldo2_lv_set(uint8_t lv);
471 
477 void dpmu_ldo3_lv_set(uint8_t lv);
478 
485 
492 
498 void dpmu_set_rc_trim_c_value(uint8_t val);
499 
505 void dpmu_set_rc_trim_f_value(uint8_t val);
506 
512 void dpmu_set_rc_en(bool en);
513 
518 void dpmu_set_rc_update_cfg(void);
519 
526 void dpmu_pll_config(uint32_t in_clk, uint32_t out_clk);
527 
533 uint32_t dpmu_get_pll_frequency();
534 
540 void dpmu_set_vdt_mask(bool en);
541 
547 void dpmu_osc_pad_cfg_fma(uint8_t num);
548 
553 void dpmu_use_rc(void);
554 
567 
574 void dpmu_set_wakeup_int(int32_t wake_int_num,FunctionalState flag);
575 
581 uint32_t dpmu_get_wakeup_state(void);
582 
583 #endif /*CI130X_DPMU_H*/
Definition: ci130x_dpmu.h:174
Definition: ci130x_dpmu.h:9
void dpmu_twdg_reset_sysytem_config(void)
WWDG模块检测到系统喂狗异常时的复位范围:复位全系统
Definition: ci130x_dpmu.c:409
Definition: ci130x_dpmu.h:135
Definition: ci130x_dpmu.h:21
Definition: ci130x_dpmu.h:84
Dpmu_Io_Schmitt_Trigger_t
IO触发器选择
Definition: ci130x_dpmu.h:72
void dpmu_ldo3_en(bool en)
LDO3输出使能
Definition: ci130x_dpmu.c:1251
Definition: ci130x_dpmu.h:154
三代芯片scu底层驱动接口头文件
Definition: ci130x_dpmu.h:124
Dpmu_Rc_Freq_Sel_t
RC的频率段选择
Definition: ci130x_dpmu.h:147
Definition: ci130x_dpmu.h:22
void dpmu_iwdg_reset_system_config(void)
IWDG模块检测到系统喂狗异常时的复位范围:复位全系统
Definition: ci130x_dpmu.c:377
void dpmu_software_reset_bus_config(void)
软件复位系统总线
Definition: ci130x_dpmu.c:448
ADIOResue_MODE
IO模拟数字功能选择
Definition: ci130x_scu.h:123
Definition: ci130x_dpmu.h:201
Definition: ci130x_dpmu.h:121
void dpmu_set_wakeup_int(int32_t wake_int_num, FunctionalState flag)
低功耗唤醒源使能
Definition: ci130x_dpmu.c:978
Definition: ci130x_dpmu.h:63
Definition: ci130x_dpmu.h:122
Definition: ci130x_dpmu.h:189
Definition: ci130x_dpmu.h:44
Definition: ci130x_dpmu.h:25
Ext_Num
Definition: ci130x_system.h:89
Definition: ci130x_dpmu.h:169
void dpmu_clean_iwdg_halt()
设置watchdog计数和复位不受CPU HALTED信号控制
Definition: ci130x_dpmu.c:348
void dpmu_lock_cfg_config(void)
锁定dpmu配置寄存器
Definition: ci130x_dpmu.c:153
Definition: ci130x_dpmu.h:208
Dpmu_Io_Pull_t
IO上下拉选择
Definition: ci130x_dpmu.h:40
void dpmu_set_io_schmitt_trigger(PinPad_Name pin, Dpmu_Io_Schmitt_Trigger_t schmitt_trigger)
配置管脚触发器模式
Definition: ci130x_dpmu.c:808
void dpmu_twdg_reset_bus_config(void)
WWDG模块检测到系统喂狗异常时的复位范围:复位系统总线
Definition: ci130x_dpmu.c:420
Definition: ci130x_dpmu.h:23
Dpmu_Update_En_Num_t
PMU配置update的更新项
Definition: ci130x_dpmu.h:133
void dpmu_ldo3_lv_set(uint8_t lv)
LDO3输出电压调整
Definition: ci130x_dpmu.c:1275
Dpmu_Vdt_Lv_t
低电压检测档位设置
Definition: ci130x_dpmu.h:116
Definition: ci130x_dpmu.h:12
void dpmu_twdg_reset_none_config(void)
WWDG模块检测到系统喂狗异常时的复位范围:无复位操作
Definition: ci130x_dpmu.c:399
Definition: ci130x_dpmu.h:207
void dpmu_set_io_slew_rate(PinPad_Name pin, Dpmu_Io_Slew_Rate_t slew_rate)
配置管脚电压转换率模式
Definition: ci130x_dpmu.c:825
void dpmu_set_io_direction(PinPad_Name pin, Dpmu_Io_Direction_t dir)
配置管脚方向
Definition: ci130x_dpmu.c:772
Definition: ci130x_dpmu.h:168
void dpmu_pmu_trim_en(bool en)
PMU trim使能
Definition: ci130x_dpmu.c:1185
void dpmu_set_io_open_drain(PinPad_Name pin, FunctionalState cmd)
配置管脚开漏功能(例如IIC需要引脚配置成此功能)
Definition: ci130x_dpmu.c:719
void dpmu_set_io_driver_strength(PinPad_Name pin, Dpmu_Io_Driver_Strength_t driver_strength)
配置管脚驱动强度
Definition: ci130x_dpmu.c:842
Definition: ci130x_dpmu.h:26
void dpmu_vdt_lv_set(Dpmu_Vdt_Lv_t lv)
设置PMU的低电压检测档位
Definition: ci130x_dpmu.c:1227
Definition: ci130x_dpmu.h:211
void dpmu_ldo1_lv_set(uint8_t lv)
LDO1输出电压调整
Definition: ci130x_dpmu.c:1259
void dpmu_set_vdt_mask(bool en)
设置VDT中断屏蔽
Definition: ci130x_dpmu.c:1219
Definition: ci130x_dpmu.h:226
IOResue_FUNCTION
IO复用功能选择
Definition: ci130x_scu.h:110
void dpmu_core_reset_system_config()
cpu内核发出复位请求时的复位范围:复位CPU内核
Definition: ci130x_dpmu.c:472
Definition: ci130x_dpmu.h:138
Definition: ci130x_dpmu.h:224
Definition: ci130x_dpmu.h:43
void dpmu_osc_pad_cfg_fma(uint8_t num)
晶振IO频率和驱动能力选择
Definition: ci130x_dpmu.c:1177
Dpmu_Wakeup_Reset_Cfg_t
系统退出低功耗进入系统复位流程时是否复位
Definition: ci130x_dpmu.h:19
void dpmu_core_reset_bus_config()
cpu内核发出复位请求时的复位范围:复位系统总线
Definition: ci130x_dpmu.c:490
Definition: ci130x_dpmu.h:75
Definition: ci130x_dpmu.h:156
void dpmu_wakeup_reset_cfg(Dpmu_Wakeup_Reset_Cfg_t model, FunctionalState flag)
系统退出低功耗进入系统复位流程时是否复位模块
Definition: ci130x_dpmu.c:994
void dpmu_software_reset_none_config(void)
软件无复位操作
Definition: ci130x_dpmu.c:431
void dpmu_set_src_source(Dpmu_Src_Source_Sel_t sel)
选择SRC时钟的来源
Definition: ci130x_dpmu.c:221
void dpmu_pmu_div_resistance_en(bool en)
PMU分压电阻使能
Definition: ci130x_dpmu.c:1211
void dpmu_iwdg_reset_none_config(void)
IWDG模块检测到系统喂狗异常时的复位范围:无复位操作
Definition: ci130x_dpmu.c:367
Definition: ci130x_dpmu.h:170
Definition: ci130x_dpmu.h:190
Definition: ci130x_dpmu.h:96
void dpmu_set_pmu_trim_value(uint8_t val)
设置pmu trim信号
Definition: ci130x_dpmu.c:1193
Definition: ci130x_dpmu.h:108
void dpmu_config_update_en(Dpmu_Update_En_Num_t num)
PMU update en配置
Definition: ci130x_dpmu.c:1283
Dpmu_Lowpower_Mode_t
Definition: ci130x_dpmu.h:7
void dpmu_iwdg_reset_bus_config(void)
IWDG模块检测到系统喂狗异常时的复位范围:复位系统总线
Definition: ci130x_dpmu.c:388
Definition: ci130x_dpmu.h:179
Definition: ci130x_dpmu.h:204
Definition: ci130x_dpmu.h:10
Definition: ci130x_dpmu.h:200
Definition: ci130x_dpmu.h:136
Dpmu_Io_Direction_t
IO方向选择
Definition: ci130x_dpmu.h:51
Definition: ci130x_dpmu.h:54
Dpmu_Src_Source_Sel_t
SRC时钟源选择
Definition: ci130x_dpmu.h:104
Dpmu_Xtal_Mode_t
晶振功能配置选项
Definition: ci130x_dpmu.h:61
Definition: ci130x_dpmu.h:180
uint32_t dpmu_get_wakeup_state(void)
获取唤醒状态
Definition: ci130x_dpmu.c:1010
void dpmu_set_ext_filter_config(Ext_Num num, FunctionalState flag, uint32_t param)
设置pad输入信号(外部事件)滤波
Definition: ci130x_dpmu.c:677
Definition: ci130x_dpmu.h:152
void dpmu_set_rc_en(bool en)
RC 使能设置
Definition: ci130x_dpmu.c:1316
Definition: ci130x_dpmu.h:11
Dpmu_LDO2_Lv_t
LDO2的电压选择(配置值为0 ~ 31):2.725V + n * 0.025V,n为0 ~ 31
Definition: ci130x_dpmu.h:187
Definition: ci130x_dpmu.h:125
Definition: ci130x_dpmu.h:206
void dpmu_core_reset_none_config()
cpu内核发出复位请求时的复位范围:无复位操作
Definition: ci130x_dpmu.c:457
Definition: ci130x_dpmu.h:191
PinPad_Name
IO复用列表,左至右依次为第1功能 ~ 第6功能,用"---"表示无第几复用功能
Definition: ci130x_scu.h:132
Definition: ci130x_dpmu.h:166
void dpmu_vdt_en(bool en)
低电压检测使能
Definition: ci130x_dpmu.c:1235
Dpmu_LDO3_Lv_t
LDO3的电压选择(配置值为0 ~ 15)
Definition: ci130x_dpmu.h:198
Definition: ci130x_dpmu.h:119
chip级定义
void dpmu_set_iwdg_halt()
设置iwatchdog计数和复位受到CPU HALTED信号控制
Definition: ci130x_dpmu.c:329
void dpmu_set_low_power_mode(Dpmu_Lowpower_Mode_t mode)
Definition: ci130x_dpmu.c:947
Definition: ci130x_dpmu.h:173
void dpmu_software_reset_system_config(void)
软件复位全系统
Definition: ci130x_dpmu.c:439
Definition: ci130x_dpmu.h:123
Definition: ci130x_dpmu.h:202
Definition: ci130x_dpmu.h:171
Definition: ci130x_dpmu.h:212
Definition: ci130x_dpmu.h:205
Definition: ci130x_dpmu.h:24
void dpmu_set_rc_update_cfg(void)
RC配置寄存器更新
Definition: ci130x_dpmu.c:1324
void dpmu_use_rc(void)
设置使用SRC时钟作为系统时钟
Definition: ci130x_dpmu.c:227
Definition: ci130x_dpmu.h:64
Definition: ci130x_dpmu.h:213
Definition: ci130x_dpmu.h:155
Definition: ci130x_dpmu.h:149
Definition: ci130x_dpmu.h:85
FunctionalState
Definition: ci130x_system.h:86
void dpmu_set_rc_trim_f_value(uint8_t val)
RC trim时精调值设置
Definition: ci130x_dpmu.c:1308
void dpmu_pll_config(uint32_t in_clk, uint32_t out_clk)
配置系统主频
Definition: ci130x_dpmu.c:246
Definition: ci130x_dpmu.h:153
Definition: ci130x_dpmu.h:172
void dpmu_set_io_reuse(PinPad_Name pin, IOResue_FUNCTION io_function)
配置管脚复用对应功能
Definition: ci130x_dpmu.c:508
Definition: ci130x_dpmu.h:106
Definition: ci130x_dpmu.h:175
Definition: ci130x_dpmu.h:209
Definition: ci130x_dpmu.h:225
Definition: ci130x_dpmu.h:53
Definition: ci130x_dpmu.h:210
Definition: ci130x_dpmu.h:65
Definition: ci130x_dpmu.h:139
void dpmu_set_adio_reuse(PinPad_Name pin, ADIOResue_MODE adio_mode)
配置管脚数字模拟功能
Definition: ci130x_dpmu.c:615
void dpmu_set_io_pull(PinPad_Name pin, Dpmu_Io_Pull_t pull)
配置管脚上下拉功能
Definition: ci130x_dpmu.c:737
void dpmu_set_rc_trim_c_value(uint8_t val)
RC trim时粗调值设置
Definition: ci130x_dpmu.c:1300
Definition: ci130x_dpmu.h:118
void dpmu_unlock_cfg_config(void)
解锁dpmu配置寄存器
Definition: ci130x_dpmu.c:147
Definition: ci130x_dpmu.h:97
void dpmu_rc_freq_sel(Dpmu_Rc_Freq_Sel_t sel)
RC频率段选择
Definition: ci130x_dpmu.c:1292
void dpmu_osc_pad_for_gpio(FunctionalState en)
配置晶振脚PA0、PA1功能选择(晶振/GPIO)
Definition: ci130x_dpmu.c:1332
Definition: ci130x_dpmu.h:42
Definition: ci130x_dpmu.h:137
Dpmu_PMU_Trim_Lv_t
PMU trim的电压选择(配置值为0 ~ 31):0.71V + n * 0.0056V,n为0 ~ 31
Definition: ci130x_dpmu.h:222
Definition: ci130x_dpmu.h:167
Definition: ci130x_dpmu.h:165
uint32_t dpmu_get_pll_frequency()
获取系统主频
Definition: ci130x_dpmu.c:208
Definition: ci130x_dpmu.h:215
Definition: ci130x_dpmu.h:214
Definition: ci130x_dpmu.h:74
void dpmu_ldo2_en(bool en)
LDO2输出使能
Definition: ci130x_dpmu.c:1243
Definition: ci130x_dpmu.h:95
Dpmu_LDO1_Lv_t
LDO1的电压选择(配置值为0 ~ 15)
Definition: ci130x_dpmu.h:163
Definition: ci130x_dpmu.h:151
uint8_t dpmu_get_pmu_trim_value(void)
设置pmu trim信号
Definition: ci130x_dpmu.c:1201
void dpmu_ldo2_lv_set(uint8_t lv)
LDO2输出电压调整
Definition: ci130x_dpmu.c:1267
Dpmu_Io_Driver_Strength_t
IO驱动强度(数字越大,驱动能力越强)
Definition: ci130x_dpmu.h:92
Definition: ci130x_dpmu.h:94
Definition: ci130x_dpmu.h:177
Definition: ci130x_dpmu.h:120
Definition: ci130x_dpmu.h:178
Definition: ci130x_dpmu.h:203
Dpmu_Io_Slew_Rate_t
IO电压转换率模式
Definition: ci130x_dpmu.h:82
Definition: ci130x_dpmu.h:176
Definition: ci130x_dpmu.h:150
Definition: ci130x_dpmu.h:107