31 #if USE_EXTERNAL_CRYSTAL_OSC 32 #define MAIN_FREQUENCY 240000000 34 #define MAIN_FREQUENCY 200000000 37 #define SRC_FREQUENCY_NORMAL 12288000U 43 #define SRC_FREQUENCY_LOWPOWER 12288000U IIS 时钟源 SRC配置结构体
Definition: ci130x_scu.h:406
Definition: ci130x_scu.h:96
CODEC DA
Definition: ci130x_scu.h:399
Definition: ci130x_scu.h:125
Definition: ci130x_scu.h:114
IIS2的编号
Definition: ci130x_scu.h:187
Definition: ci130x_scu.h:163
Definition: ci130x_scu.h:169
codec dac输出数据来源于PAD_IN
Definition: ci130x_scu.h:355
过采样率192
Definition: ci130x_scu.h:275
Definition: ci130x_scu.h:160
Definition: ci130x_scu.h:113
codec dac输出数据来源于CODEC_ADC
Definition: ci130x_scu.h:357
来源于 SRC1
Definition: ci130x_scu.h:303
uint8_t scu_get_rc_trim_state(void)
获取RC trim状态设置
Definition: ci130x_scu.c:1025
IIS_Mode_Sel_t
IIS主从模式选择
Definition: ci130x_scu.h:194
int32_t scu_set_div_parameter(uint32_t device_base, uint32_t div_num)
设置外设时钟分频
Definition: ci130x_scu.c:553
Definition: ci130x_scu.h:104
Definition: ci130x_scu.h:152
输出
Definition: ci130x_scu.h:385
IIS_Clk_Source_t clk_cfg
Definition: ci130x_scu.h:434
void scu_rc_trim_state_clear(void)
清除RC trim的状态
Definition: ci130x_scu.c:1048
PLL倍频后的时钟
Definition: ci130x_scu.h:247
Definition: ci130x_scu.h:103
输入
Definition: ci130x_scu.h:387
ADIOResue_MODE
IO模拟数字功能选择
Definition: ci130x_scu.h:123
来源于 PAD IN
Definition: ci130x_scu.h:263
IIS_Mclk_Config_t mclk_cfg
Definition: ci130x_scu.h:433
void dsu_init(unsigned int addr)
启动NPU模块.
Definition: ci130x_dsu.c:20
Definition: ci130x_scu.h:145
Ext_Num
Definition: ci130x_system.h:89
DmaInt_Sel_t
DMA 中断 channel 选择
Definition: ci130x_scu.h:228
IIS_Sck_Lrck_Wid_t
IIS SCK和LRCK的频率关系比值
Definition: ci130x_scu.h:286
IIS_Mclk_Mode_t mclk_mode
Definition: ci130x_scu.h:435
SCK/LRCK=64
Definition: ci130x_scu.h:291
Definition: ci130x_scu.h:144
void scu_iis_src_config(IIS_Src_Config_t *config, IIS_Mclk_Source_t src)
设置IIS MCLK 时钟来源 SRC 时钟(0、1、2)的分频
Definition: ci130x_scu.c:720
codec dac输出数据来源于IIS1_TX
Definition: ci130x_scu.h:353
Definition: ci130x_scu.h:75
Definition: ci130x_scu.h:146
CODEC AD
Definition: ci130x_scu.h:397
int32_t scu_set_device_gate(uint32_t device_base, int32_t gate)
设置外设时钟开关
Definition: ci130x_scu.c:118
codec_da_sck_in
Definition: ci130x_scu.h:341
来源于 SRC0
Definition: ci130x_scu.h:301
Definition: ci130x_scu.h:138
PLL倍频前的时钟
Definition: ci130x_scu.h:245
void scu_sel_dtrflash_clk(Dtr_Clk_Sel_t clk)
设置DTR控制器时钟来源
Definition: ci130x_scu.c:693
Codec_Channel_t
CODEC AD/DA 选择
Definition: ci130x_scu.h:394
Definition: ci130x_scu.h:79
int32_t scu_set_ext_wakeup_int(Ext_Num num, FunctionalState cmd)
设置外部事件中断唤醒
Definition: ci130x_scu.c:229
void scu_iis_codec_dac_data_config(Codec_Dac_Data_Sel_t src)
设置 codec dac IIS 输出数据来源
Definition: ci130x_scu.c:919
IIS_Mclk_Fs_t fs
Definition: ci130x_scu.h:420
Definition: ci130x_scu.h:126
IIS 时钟配置结构体
Definition: ci130x_scu.h:428
pdm_sck_in
Definition: ci130x_scu.h:343
codec_ad_sck_in
Definition: ci130x_scu.h:339
来源于 SRC2
Definition: ci130x_scu.h:305
void scu_set_dma_mode(DmaInt_Sel_t channel)
设置 DMA chanel 中断开启
Definition: ci130x_scu.c:652
来源于 PAD IN
Definition: ci130x_scu.h:307
Definition: ci130x_scu.h:170
过采样率256
Definition: ci130x_scu.h:277
void scu_lock_reset_config(void)
锁定复位寄存器
Definition: ci130x_scu.c:81
Definition: ci130x_scu.h:101
int32_t scu_clear_ext_int_state(Ext_Num num)
清除外部事件中断唤醒状态
Definition: ci130x_scu.c:269
IIS_Mclk_t mclk
Definition: ci130x_scu.h:418
Definition: ci130x_scu.h:149
void scu_iis_clk_config(IISNumx device, IIS_Clk_Source_t clk_source)
设置IIS(0、1、2)时钟参数
Definition: ci130x_scu.c:792
Definition: ci130x_scu.h:164
IIS_Src_Source_t
MCLK 时钟源SRC的 来源选择
Definition: ci130x_scu.h:254
Definition: ci130x_scu.h:112
Definition: ci130x_scu.h:139
void scu_run_in_flash(void)
设置程序在FLASH中运行
Definition: ci130x_scu.c:673
void scu_unlock_reset_config(void)
解锁复位相关寄存器
Definition: ci130x_scu.c:65
IIS pad sdo输出数据来源于CODEC_ADC
Definition: ci130x_scu.h:373
IOResue_FUNCTION
IO复用功能选择
Definition: ci130x_scu.h:110
MCLK0
Definition: ci130x_scu.h:317
Sys_Clk_Gate_t
系统时钟选择
Definition: ci130x_scu.h:91
IIS做SLAVE
Definition: ci130x_scu.h:197
来源于 INTERNAL RC
Definition: ci130x_scu.h:261
Definition: ci130x_scu.h:150
Pad_IIS_Data_Sel_t
IIS pad sdo输出数据来源选择
Definition: ci130x_scu.h:366
Definition: ci130x_scu.h:116
Definition: ci130x_scu.h:167
Definition: ci130x_scu.h:72
Definition: ci130x_scu.h:137
void scu_iis_mclk_Config(IIS_Mclk_Config_t *config)
设置IIS MCLK(0、1、2) 时钟参数
Definition: ci130x_scu.c:763
IIS_Mclk_Source_t
MCLK 时钟来源选择
Definition: ci130x_scu.h:298
IIS_Mclk_Mode_t
IIS MCLK 输入/输出
Definition: ci130x_scu.h:206
IIS_Clk_Source_t
IIS SCK/LRCK输出来源
Definition: ci130x_scu.h:328
void scu_run_not_in_flash(void)
设置程序不在FLASH中运行
Definition: ci130x_scu.c:684
int32_t scu_get_system_reset_state(void)
获取系统复位状态
Definition: ci130x_scu.c:1004
Definition: ci130x_scu.h:162
正常模式
Definition: ci130x_scu.h:54
void scu_wait_pll_lock_state()
等待 PLL 处于 LOCK 状态
Definition: ci130x_scu.c:711
IISNumx device_select
Definition: ci130x_scu.h:430
Definition: ci130x_scu.h:100
来源于 IPCORE
Definition: ci130x_scu.h:257
Definition: ci130x_scu.h:155
Definition: ci130x_scu.h:219
Definition: ci130x_scu.h:220
只打开DMA channel 0的中断
Definition: ci130x_scu.h:231
MCLK1
Definition: ci130x_scu.h:319
Definition: ci130x_scu.h:153
IIS MCLK配置结构体
Definition: ci130x_scu.h:416
Definition: ci130x_scu.h:141
Definition: ci130x_scu.h:97
Definition: ci130x_scu.h:94
Definition: ci130x_scu.h:151
Codec_Dac_Data_Sel_t
codec dac 输出数据来源选择
Definition: ci130x_scu.h:350
void scu_iis_pad_clk_config(IIS_Clk_Source_t clk_source, IIS_Clk_Mode_t mode)
设置 IIS PAD CLK 时钟参数
Definition: ci130x_scu.c:818
Definition: ci130x_scu.h:115
Definition: ci130x_scu.h:70
PAD输入的SCK/LRCK
Definition: ci130x_scu.h:337
IIS1_RX的编号
Definition: ci130x_scu.h:183
Definition: ci130x_scu.h:81
int8_t scu_para_en_enable(uint32_t device_base)
配置外设分频参数之后需将CLK_DIV_PARAM_EN_CFG寄存器相应位置1
Definition: ci130x_scu.c:500
uint8_t scu_get_rc_trim_c_value(void)
获取RC trim的粗调值
Definition: ci130x_scu.c:1032
Definition: ci130x_scu.h:77
void scu_lock_system_config(void)
锁定系统控制寄存器
Definition: ci130x_scu.c:71
Definition: ci130x_scu.h:148
Definition: ci130x_scu.h:156
int32_t scu_set_device_reset_release(uint32_t device_base)
配置外设复位释放
Definition: ci130x_scu.c:393
codec dac输出数据来源于PDM
Definition: ci130x_scu.h:359
PinPad_Name
IO复用列表,左至右依次为第1功能 ~ 第6功能,用"---"表示无第几复用功能
Definition: ci130x_scu.h:132
IIS_Mode_Sel_t model_sel
Definition: ci130x_scu.h:431
Definition: ci130x_scu.h:165
Definition: ci130x_scu.h:168
Definition: ci130x_scu.h:142
Definition: ci130x_scu.h:154
void scu_iis_pad_mclk_config(IIS_Mclk_Source_t src, IIS_Clk_Mode_t mode)
设置IIS PAD MCLK时钟参数
Definition: ci130x_scu.c:845
uint8_t scu_get_rc_trim_f_value(void)
获取RC trim的细调值
Definition: ci130x_scu.c:1040
Definition: ci130x_scu.h:98
Definition: ci130x_scu.h:147
Definition: ci130x_scu.h:71
int32_t scu_set_system_clk_gate(Sys_Clk_Gate_t base, FunctionalState gate)
设置系统时钟开关
Definition: ci130x_scu.c:86
SCK/LRCK=32
Definition: ci130x_scu.h:289
void scu_lock_clk_config(void)
锁定时钟相关寄存器
Definition: ci130x_scu.c:76
Definition: ci130x_scu.h:84
IIS_Src_Config_t src_cfg
Definition: ci130x_scu.h:432
Definition: ci130x_scu.h:157
Definition: ci130x_scu.h:135
Definition: ci130x_scu.h:80
Definition: ci130x_scu.h:210
Definition: ci130x_scu.h:83
void scu_iis_pdm_mclk_config(IIS_Mclk_Source_t src)
设置 PDM MCLK 时钟参数
Definition: ci130x_scu.c:898
Nmi_Irq_t
nmi中断选择
Definition: ci130x_scu.h:68
int8_t scu_para_en_disable(uint32_t device_base)
配置外设分频参数之前需将CLK_DIV_PARAM_EN_CFG寄存器相应位置0
Definition: ci130x_scu.c:447
IIS_Clk_Mode_t
IIS 输入输出选择
Definition: ci130x_scu.h:382
FunctionalState
Definition: ci130x_system.h:86
Definition: ci130x_scu.h:208
void scu_iis_codec_mclk_config(Codec_Channel_t channel, IIS_Mclk_Source_t src)
设置CODEC MCLK 时钟参数
Definition: ci130x_scu.c:873
IIS pad sdo输出数据来源于IIS1_TX
Definition: ci130x_scu.h:371
void iis_clk_config(IIS_Clk_ConfigTypedef *config)
IIS时钟配置。 master模式时,配置iis的sck和lrck来源,codec和pdm的mclk来源,iis pad输出的mclk和sck lrck...
Definition: ci130x_scu.c:945
IIS0的编号
Definition: ci130x_scu.h:181
void scu_nmi_irq_cfg(Nmi_Irq_t irq)
nmi中断使能
Definition: ci130x_scu.c:1053
Definition: ci130x_scu.h:143
IIS_Mclk_t
MCLK 选择
Definition: ci130x_scu.h:314
uint32_t source_div
Definition: ci130x_scu.h:409
MCLK2
Definition: ci130x_scu.h:321
MCLK1产生的SCK/LRCK
Definition: ci130x_scu.h:333
Definition: ci130x_scu.h:73
Definition: ci130x_scu.h:93
Definition: ci130x_scu.h:102
IIS_Src_Source_t source
Definition: ci130x_scu.h:408
IIS_Mclk_Fs_t
IIS MCLK 过采样率选择
Definition: ci130x_scu.h:270
Definition: ci130x_scu.h:171
Definition: ci130x_scu.h:166
Definition: ci130x_scu.h:78
IIS_SckLrck_Mode_t clk_mode
Definition: ci130x_scu.h:436
void scu_iis_pad_data_config(Pad_IIS_Data_Sel_t src)
设置 pad IIS输出数据来源选择
Definition: ci130x_scu.c:931
void scu_rc_trim_en(bool en)
RC trim使能
Definition: ci130x_scu.c:1019
来源于 EXT_OSC
Definition: ci130x_scu.h:259
IISNumx
IIS号选择
Definition: ci130x_scu.h:178
Definition: ci130x_scu.h:158
IIS_Mclk_Source_t src
Definition: ci130x_scu.h:419
Definition: ci130x_scu.h:221
void scu_spiflash_no_boot_set(void)
配置QSPI0 非boot 模式
Definition: ci130x_scu.c:641
Definition: ci130x_scu.h:140
过采样率384
Definition: ci130x_scu.h:279
void scu_set_wwdg_halt()
设置watchdog计数和复位受到CPU HALTED信号控制
Definition: ci130x_scu.c:191
Definition: ci130x_scu.h:95
IIS_SckLrck_Mode_t
IIS SCK和LRCK 输入/输出
Definition: ci130x_scu.h:217
Definition: ci130x_scu.h:161
Qspi_Mode_t
QSPI0控制器模式
Definition: ci130x_scu.h:49
过采样率128
Definition: ci130x_scu.h:273
Definition: ci130x_scu.h:76
IIS_Sck_Lrck_Wid_t sck_lrck
Definition: ci130x_scu.h:421
void scu_clean_wwdg_halt()
设置watchdog计数和复位不受CPU HALTED信号控制
Definition: ci130x_scu.c:210
只打开DMA channel 1的中断
Definition: ci130x_scu.h:233
Definition: ci130x_scu.h:159
int32_t scu_set_device_reset(uint32_t device_base)
配置外设复位
Definition: ci130x_scu.c:339
Definition: ci130x_scu.h:136
IIS做MASTER
Definition: ci130x_scu.h:199
Dtr_Clk_Sel_t
DTRFLASH时钟来源选择
Definition: ci130x_scu.h:242
BOOT模式
Definition: ci130x_scu.h:52
打开DMA 两个channel 中断
Definition: ci130x_scu.h:235
IIS pad sdo输出数据来源于PDM
Definition: ci130x_scu.h:375
void scu_unlock_system_config(void)
解锁系统控制寄存器
Definition: ci130x_scu.c:53
MCLK0产生的SCK/LRCK
Definition: ci130x_scu.h:331
Definition: ci130x_scu.h:117
MCLK2产生的SCK/LRCK
Definition: ci130x_scu.h:335
Definition: ci130x_scu.h:99
void scu_set_ext_filter_config(Ext_Num num, FunctionalState cmd, uint32_t param)
设置pad输入信号(外部事件)滤波
Definition: ci130x_scu.c:295
Definition: ci130x_scu.h:209
void scu_unlock_clk_config(void)
解锁时钟相关寄存器
Definition: ci130x_scu.c:59
IIS1_TX的编号
Definition: ci130x_scu.h:185
Definition: ci130x_scu.h:82
IIS pad sdo输出数据来源于IIS0_TX
Definition: ci130x_scu.h:369
Definition: ci130x_scu.h:74