CI130X SDK API手册  2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
ci130x_system.h
浏览该文件的文档.
1 
10 #ifndef _CI130X_SYSTEM_H_
11 #define _CI130X_SYSTEM_H_
12 
13 #include <stdint.h>
14 
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif /* __cplusplus */
19 
20 
21 /*******function return defines******/
22 #define INT32_T_MAX (0x7fffffff)
23 #define INT32_T_MIN (0x80000000)
24 
25 enum _retval
26 {
30  RET_MOMEM = -3,
35 
37 };
38 
39 
40 typedef enum IRQn
41 {
42 /****** RISC-V N307 Processor Exceptions Numbers *******************************/
43  MSIP_IRQn = 3,
44  MTIP_IRQ = 7,
45 /****** smt specific Interrupt Numbers ****************************************/
46  TWDG_IRQn = 19 + 0,
47  SCU_IRQn = 19 + 1,
48  NPU_IRQn = 19 + 2,
49  ADC_IRQn = 19 + 3,
50  DMA_IRQn = 19 + 4,
51  TIMER0_IRQn = 19 + 5,
52  TIMER1_IRQn = 19 + 6,
53  TIMER2_IRQn = 19 + 7,
54  TIMER3_IRQn = 19 + 8,
55  IIC0_IRQn = 19 + 9,
56  PA_IRQn = 19 + 10,
57  PB_IRQn = 19 + 11,
58  UART0_IRQn = 19 + 12,
59  UART1_IRQn = 19 + 13,
60  UART2_IRQn = 19 + 14,
61  IIS0_IRQn = 19 + 15,
62  IIS1_IRQn = 19 + 16,
63  IIS2_IRQn = 19 + 17,
64  IIS_DMA_IRQn = 19 + 18,
65  ALC_IRQn = 19 + 19,
66  PDM_IRQn = 19 + 20,
67  DTR_IRQn = 19 + 21,
68  V11_OK_IRQn = 19 + 22,
69  VDT_IRQn = 19 + 23,
70  EXT0_IRQn = 19 + 24,
71  EXT1_IRQn = 19 + 25,
72  IWDG_IRQn = 19 + 26,
73  AON_TIM_INT0_IRQn = 19 + 27,
74  AON_TIM_INT1_IRQn = 19 + 28,
75  AON_EFUSE_IRQn = 19 + 29,
76  AON_PC_IRQn = 19 + 30,
77  MAILBOX_IRQn = 19 + 31,
78 /********************************* END ****************************************/
79 } IRQn_Type;
80 
81 #define IRQn_MAX_NUMBER (51)
82 
83 
84 typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
85 
86 typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
87 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
88 
89 typedef enum
90 {
91  EXT0 = 0,
92  EXT1 = 1,
93 }Ext_Num;
94 
95 
96 #ifndef NULL
97 #define NULL 0
98 #endif
99 
100 
101 /*SCU寄存器定义*/
102 
103 typedef struct
104 {
105  volatile unsigned int SYS_CTRL_CFG;
106  volatile uint32_t REV_SYR_CFG_0[(0x0C-0x00)/4-0x1];
107  volatile unsigned int EXT_INT_CFG;
108  volatile uint32_t REV_SYR_CFG_1[(0x50-0x0C)/4-0x1];
109  volatile unsigned int SYSCFG_LOCK_CFG;
110  volatile unsigned int RSTCFG_LOCK_CFG;
111  volatile unsigned int CKCFG_LOCK_CFG;
112  volatile uint32_t REV_SYR_CFG_2[(0x80-0x58)/4-0x1];
113  volatile unsigned int CLK_DIV_PARAM0_CFG;
114  volatile unsigned int CLK_DIV_PARAM1_CFG;
115  volatile unsigned int CLK_DIV_PARAM2_CFG;
116  volatile uint32_t REV_SYR_CFG_3[(0xB0-0x88)/4-0x1];
117  volatile unsigned int CLK_DIV_PARAM_EN_CFG;
118  volatile uint32_t REV_SYR_CFG_4[(0xC0-0xB0)/4-0x1];
119  volatile unsigned int SRC0_MCLK_CFG;
120  volatile unsigned int SRC1_MCLK_CFG;
121  volatile unsigned int SRC2_MCLK_CFG;
122  volatile uint32_t REV_SYR_CFG_5[(0xD0-0xC8)/4-0x1];
123  volatile unsigned int MCLK0_CFG;
124  volatile unsigned int MCLK1_CFG;
125  volatile unsigned int MCLK2_CFG;
126  volatile uint32_t REV_SYR_CFG_6[(0xE0-0xD8)/4-0x1];
127  volatile unsigned int IIS0_CLK_SEL_CFG;
128  volatile unsigned int IIS1_CLK_SEL_CFG;
129  volatile unsigned int IIS2_CLK_SEL_CFG;
130  volatile uint32_t REV_SYR_CFG_7[(0xF0-0xE8)/4-0x1];
131  volatile unsigned int PAD_CLK_SEL_CFG;
132  volatile unsigned int CODEC_CLK_SEL_CFG;
133  volatile unsigned int PDM_CLK_SEL_CFG;
134  volatile uint32_t REV_SYR_CFG_8[(0x11C-0xF8)/4-0x1];
135  volatile unsigned int SYS_CLKGATE_CFG0;
136  volatile unsigned int SYS_CLKGATE_CFG1;
137  volatile unsigned int AHB_CLKGATE_CFG;
138  volatile unsigned int APB0_CLKGATE_CFG;
139  volatile unsigned int APB1_CLKGATE_CFG;
140  volatile uint32_t REV_SYR_CFG_9[(0x178-0x12C)/4-0x1];
141  volatile unsigned int SCU_STATE_REG;
142  volatile uint32_t REV_SYR_CFG_10[(0x190-0x178)/4-0x1];
143  volatile unsigned int AHB_RESET_CFG;
144  volatile unsigned int APB0_RERST_CFG;
145  volatile unsigned int APB1_RERST_CFG;
146  volatile uint32_t REV_SYR_CFG_11[(0x1DC-0x198)/4-0x1];
147  volatile unsigned int WAKEUP_MASK_CFG0;
148  volatile unsigned int WAKEUP_MASK_CFG1;
149  volatile unsigned int EXT0_FILTER_CFG;
150  volatile unsigned int EXT1_FILTER_CFG;
151  volatile uint32_t REV_SYR_CFG_12[(0x1F4-0x1E8)/4-0x1];
152  volatile unsigned int INT_STATE_REG0;
153  volatile unsigned int INT_STATE_REG1;
154  volatile uint32_t REV_SYR_CFG_13[(0x210-0x1F8)/4-0x1];
155  volatile unsigned int RC_TRIM_CFG;
156  volatile unsigned int RC_TRIM_STATE;
157  volatile uint32_t REV_SYR_CFG_14[(0x240-0x214)/4-0x1];
158  volatile unsigned int MEM0_EMA_CFG;
159  volatile unsigned int MEM1_EMA_CFG;
160  volatile uint32_t REV_SYR_CFG_15[(0x264-0x244)/4-0x1];
161  volatile unsigned int IIS_DATA_SEL_CFG;
162  volatile uint32_t REV_SYR_CFG_16[(0x290-0x264)/4-0x1];
163  volatile unsigned int PAD_STATE;
164  volatile uint32_t REV_SYR_CFG_17[(0x2C0-0x290)/4-0x1];
165  volatile unsigned int BOOT_ADDR_CFG;
166  volatile uint32_t REV_SYR_CFG_18[(0x2D0-0x2C0)/4-0x1];
167  volatile unsigned int DMAINT_SEL_CFG;
168 }SCU_TypeDef;
169 
170 
174 typedef struct
175 {
176  volatile unsigned int CFG_LOCK_CFG;
177  volatile uint32_t REV_SYR_CFG_0[(0x10-0x00)/4-0x1];
178  volatile unsigned int SYS_RESET_CFG;
179  volatile unsigned int SYS_SOFTRST_CFG;
180  volatile uint32_t REV_SYR_CFG_1[(0x20-0x14)/4-0x1];
181  volatile unsigned int SYS_CLK_SEL_CFG;
182  volatile uint32_t REV_SYR_CFG_2[(0x30-0x20)/4-0x1];
183  volatile unsigned int PLL_CFG;
184  volatile unsigned int AON_CLK_PARAM_CFG;
185  volatile uint32_t REV_SYR_CFG_3[(0x40-0x34)/4-0x1];
186  volatile unsigned int AON_CLK_PARAM_EN_CFG;
187  volatile uint32_t REV_SYR_CFG_4[(0x50-0x40)/4-0x1];
188  volatile unsigned int AON_CLKGATE_CFG;
189  volatile uint32_t REV_SYR_CFG_5[(0x70-0x50)/4-0x1];
190  volatile unsigned int AON_RESET_CFG;
191  volatile uint32_t REV_SYR_CFG_6[(0xC0-0x70)/4-0x1];
192  volatile unsigned int PMU_CFG;
193  volatile uint32_t REV_SYR_CFG_7[(0xC8-0xC0)/4-0x1];
194  volatile unsigned int PMU_UPDATE_EN;
195  volatile uint32_t REV_SYR_CFG_8[(0xD0-0xC8)/4-0x1];
196  volatile unsigned int LOW_POWER_CFG;
197  volatile unsigned int PMU_PWROFF_CFG;
198  volatile unsigned int PMU_PWRON_CFG;
199  volatile uint32_t REV_SYR_CFG_9[(0xE0-0xD8)/4-0x1];
200  volatile unsigned int WAKEUP_RESET_CFG;
201  volatile unsigned int WAKEUP_MASK_CFG;
202  volatile unsigned int WAKEUP_EXT_FILTER_CFG;
203  volatile unsigned int WAKEUP_CFG;
204  volatile uint32_t REV_SYR_CFG_10[(0x100-0xEC)/4-0x1];
205  volatile unsigned int RC_CFG;
206  volatile unsigned int RC_UPDATE_CFG;
207  volatile unsigned int OSC_PAD_CFG;
208  volatile uint32_t REV_SYR_CFG_11[(0x140-0x108)/4-0x1];
209  volatile unsigned int IOREUSE_CFG0;
210  volatile unsigned int IOREUSE_CFG1;
211  volatile uint32_t REV_SYR_CFG_12[(0x14c-0x144)/4-0x1];
212  volatile unsigned int OD_CFG0;
213  volatile unsigned int PD_CFG0;
214  volatile uint32_t REV_SYR_CFG_13[(0x158-0x150)/4-0x1];
215  volatile unsigned int PU_CFG0;
216  volatile uint32_t REV_SYR_CFG_14[(0x160-0x158)/4-0x1];
217  volatile unsigned int DS_CFG0;
218  volatile unsigned int DS_CFG1;
219  volatile uint32_t REV_SYR_CFG_15[(0x170-0x164)/4-0x1];
220  volatile unsigned int SL_CFG0;
221  volatile uint32_t REV_SYR_CFG_16[(0x178-0x170)/4-0x1];
222  volatile unsigned int ST_CFG0;
223  volatile uint32_t REV_SYR_CFG_17[(0x180-0x178)/4-0x1];
224  volatile unsigned int IE_CFG0;
225  volatile uint32_t REV_SYR_CFG_18[(0x190-0x180)/4-0x1];
226  volatile unsigned int AD_CFG0;
227  volatile unsigned int OD_CFG1;
228  volatile unsigned int PD_CFG1;
229  volatile unsigned int PU_CFG1;
230  volatile unsigned int DS_CFG2;
231  volatile unsigned int SL_CFG1;
232  volatile unsigned int ST_CFG1;
233  volatile unsigned int IE_CFG1;
234  volatile uint32_t REV_SYR_CFG_19[(0x1C0-0x1AC)/4-0x1];
235  volatile unsigned int RST_STATE_REG;
236  volatile uint32_t REV_SYR_CFG_20[(0x1D0-0x1C0)/4-0x1];
237  volatile unsigned int PWR_WAKEUP_STATE_REG;
238  volatile uint32_t REV_SYR_CFG_21[(0x1E0-0x1D0)/4-0x1];
239  volatile unsigned int CHIP_STATE_REG_ADDR;
240  volatile unsigned int CHIP_INT_MASK_CFG_ADDR;
241  volatile unsigned int PAD_FILTER_CFG_ADDR;
242 }DPMU_TypeDef;
243 
244 
245 /*UART寄存器定义*/
246 typedef struct
247 {
248  volatile unsigned int UARTRdDR; //0x0
249  volatile unsigned int UARTWrDR; //0x04
250  volatile unsigned int UARTRxErrStat; //0x08
251  volatile unsigned int UARTFlag; //0x0c
252  volatile unsigned int UARTIBrd; //0x10
253  volatile unsigned int UARTFBrd; //0x14
254  volatile unsigned int UARTLCR; //0x18
255  volatile unsigned int UARTCR; //0x1c
256  volatile unsigned int UARTFIFOlevel; //0x20
257  volatile unsigned int UARTMaskInt; //0x24
258  volatile unsigned int UARTRIS; //0x28
259  volatile unsigned int UARTMIS; //0x2c
260  volatile unsigned int UARTICR; //0x30
261  volatile unsigned int UARTDMACR; //0x34
262  volatile unsigned int UARTTimeOut; //0x38
263  volatile unsigned int REMCR; //0x3c
264  volatile unsigned int REMTXDATA; //0x40
265  volatile unsigned int REMRXDATA; //0x44
266  volatile unsigned int REMINTCLR; //0x48
267  volatile unsigned int REMINTSTAE; //0x4c
268  volatile unsigned int BYTE_HW_MODE; //0x50
269 }UART_TypeDef;
270 
271 
272 typedef struct
273 {
274  volatile unsigned int DMACCxSrcAddr;
275  volatile unsigned int DMACCxDestAddr;
276  volatile unsigned int DMACCxLLI;
277  volatile unsigned int DMACCxControl;
278  volatile unsigned int DMACCxConfiguration;
279  unsigned int reserved[3];
281 
282 
283 typedef struct
284 {
285  volatile unsigned int DMACIntStatus;
286  volatile unsigned int DMACIntTCStatus;
287  volatile unsigned int DMACIntTCClear;
288  volatile unsigned int DMACIntErrorStatus;
289  volatile unsigned int DMACIntErrClr;
290  volatile unsigned int DMACRawIntTCStatus;
291  volatile unsigned int DMACRawIntErrorStatus;
292  volatile unsigned int DMACEnbldChns;
293  volatile unsigned int DMACSoftBReq;
294  volatile unsigned int DMACSoftSReq;
295  volatile unsigned int DMACSoftLBReq;
296  volatile unsigned int DMACSoftLSReq;
297  volatile unsigned int DMACConfiguration;
298  volatile unsigned int DMACSync;
299  unsigned int reserved1[50];
300  DMACChanx_TypeDef DMACChannel[8];
301  unsigned int reserved2[195];
302  volatile unsigned int DMACITCR;
303  volatile unsigned int DMACITOP[3];
304  unsigned int reserved3[693];
305  volatile unsigned int DMACPeriphID[4];
306  volatile unsigned int DMACPCellID[4];
307 }DMA_TypeDef;
308 
309 
310 typedef struct
311 {
312  unsigned int SrcAddr;
313  unsigned int DestAddr;
314  unsigned int NextLLI;
315  unsigned int Control;
316 }DMAC_LLI;
317 
318 
319 typedef struct
320 {
321  volatile unsigned int IISxDMARADDR; //4 //1C //34
322  volatile unsigned int IISxDMARNUM; //8 //20 //38
323  volatile unsigned int IISxDMATADDR0; //C //24 //3c
324  volatile unsigned int IISxDMATNUM0; //10 //28 //40
325  volatile unsigned int IISxDMATADDR1; //14 //2C //44
326  volatile unsigned int IISxDMATNUM1; //18 //30 //48
328 
329 
330 typedef struct
331 {
332  volatile unsigned int IISDMACTRL; //0
334  volatile unsigned int IISDMAPTR; //4c
335  volatile unsigned int IISDMASTATE; //50
336  volatile unsigned int IISDMACLR; //54
337  volatile unsigned int IISDMAIISCLR; //58
338  volatile unsigned int IISDMARADDR[3]; //5C,60,64
339  volatile unsigned int RX_VAD_CTRL; //68
340  volatile unsigned int RX_LAST_ADDR; //6C
341  volatile unsigned int IIS_END_NUM_EN; //70
342  volatile unsigned int IIS_END_NUM; //74
343  volatile unsigned int DMA_REQ_CLR_STATE; //78
344  volatile unsigned int DMATADDR[3]; //7C,80,84
346 
347 
348 /*CODEC寄存器*/
349 //以2代的CODEC为基础,修改一些
350 
351 typedef struct
352 {
353  volatile unsigned int reg40;
354  volatile unsigned int reg41;
355  volatile unsigned int reg42;
356  volatile unsigned int reg43;
357  volatile unsigned int reg44;
358  volatile unsigned int reg45;
359  volatile unsigned int reg46;
360  volatile unsigned int reg47;
361  volatile unsigned int reg48;
362  volatile unsigned int reg49;
363  unsigned int resver7[2];
364  volatile unsigned int reg4c;
365  unsigned int resver8[3];
367 
368 typedef struct
369 {
370  volatile unsigned int reg0;
371  unsigned int resver1;
372  volatile unsigned int reg2;
373  volatile unsigned int reg3;
374  volatile unsigned int reg4;
375  volatile unsigned int reg5;
376  volatile unsigned int reg6;
377  volatile unsigned int reg7;
378  volatile unsigned int adc_dig_gain_reg[2];
379  volatile unsigned int rega;
380  unsigned int resver4[22];
381  volatile unsigned int reg21;
382  volatile unsigned int reg22;
383  volatile unsigned int reg23;
384  volatile unsigned int reg24;
385  volatile unsigned int reg25;
386  volatile unsigned int reg26;
387  volatile unsigned int pga_gain_reg[2];
388  volatile unsigned int reg29;
389  volatile unsigned int reg2a;
390  volatile unsigned int reg2b;
391  volatile unsigned int reg2c;
392  volatile unsigned int reg2d;
393  volatile unsigned int reg2e;
394  volatile unsigned int reg2f;
395  volatile unsigned int reg30;
396  unsigned int resver6[15];
397 
398  CODEC_ALC_TypeDef alc_reg[2];
400 /*CODEC寄存器end*/
401 
402 
403 /*PDM寄存器*/
404 typedef struct
405 {
406  volatile unsigned int reg0;
407  unsigned int resver1;
408  volatile unsigned int reg2;
409  volatile unsigned int reg3;
410  volatile unsigned int reg4;
411  volatile unsigned int reg5;
412  unsigned int resver2;
413  volatile unsigned int reg7;
414  volatile unsigned int pdm_dig_gain[2];
415  volatile unsigned int rega;
416  unsigned int resver4[22];
417  volatile unsigned int reg21;
418  volatile unsigned int reg22;
419  volatile unsigned int reg23;
420  volatile unsigned int reg24;
421  volatile unsigned int reg25;
422  volatile unsigned int reg26;
423  volatile unsigned int reg27;
424  volatile unsigned int reg28;
425  volatile unsigned int reg29;
426  volatile unsigned int reg2a;
427  volatile unsigned int reg2b;
428  volatile unsigned int reg2c;
429  volatile unsigned int reg2d;
430  volatile unsigned int reg2e;
431  volatile unsigned int reg2f;
432  volatile unsigned int reg30;
433  unsigned int resver6[15];
434  CODEC_ALC_TypeDef alc_reg[2];
435 }PDM_TypeDef;
436 /*PDM寄存器end*/
437 
438 
439 typedef struct
440 {
441  volatile uint32_t ALC_INT_STATUS; /*0x00*/
442  volatile uint32_t ALC_INT_EN; /*0x04*/
443  volatile uint32_t ALC_INT_CLR; /*0x08*/
444  volatile uint32_t GLB_CTRL; /*0x0c*/
445  volatile uint32_t LEFT_CTRL; /*0x10*/
446  volatile uint32_t L_STEP_TMR_ATK; /*0x14*/
447  volatile uint32_t L_STEP_TMR_DCY; /*0x18*/
448  volatile uint32_t L_CFG_ADDR; /*0x1c*/
449  volatile uint32_t L_MIN_MAX_DB; /*0x20*/
450  volatile uint32_t L_DB_STATUS; /*0x24*/
451  volatile uint32_t L_ATK_DCY_STATUS; /*0x28*/
452  uint32_t reserve;
453  volatile uint32_t RIGHT_CTRL; /*0x30*/
454  volatile uint32_t R_STEP_TMR_ATK; /*0x34*/
455  volatile uint32_t R_STEP_TMR_DCY; /*0x38*/
456  volatile uint32_t R_CFG_ADDR; /*0x3c*/
457  volatile uint32_t R_MIN_MAX_DB; /*0x40*/
458  volatile uint32_t R_DB_STATUS; /*0x44*/
459  volatile uint32_t R_ATK_DCY_STATUS; /*0x48*/
460 
461  volatile uint32_t PAUSE_STATUS; /*0x4c*/
462 }ALC_TypeDef;
463 
464 #define HAL_NPU_BASE (0xECC644)
465 
466 /* APB peripherals*/
467 #define IPCORE_BASE (0xa6a6a6a6)
468 #define APB_BASE (0x5a5a5a5a)
469 #define SYSTICK_BASE (0x77777777)
470 #define PLL_BASE (0x34343434)
471 #define HAL_DTRFLASH_RAM_BASE (0x45454545)
472 
473 
474 #define SCU_BASE_INDEX 0
475 #define HAL_SCU_BASE (0x40000000)
476 #define HAL_GDMA_BASE (0x40001000)
477 #define HAL_ADC_BASE (0x40002000)
478 #define HAL_IISDMA0_BASE (0x40003000)
479 #define HAL_DTRFLASH_BASE (0x40004000)
480 #define HAL_ALC_BASE (0x40005000)
481 
482 
483 #define HAL_TWDG_BASE (0x40010000) //WWDG
484 #define HAL_IIC0_BASE (0x40011000)
485 #define HAL_PDM_BASE (0x40012000)
486 #define HAL_ALC_PDM_BASE (0x40012200)
487 #define HAL_CODEC_BASE (0x40013000)
488 #define HAL_PWM0_BASE (0x40014000)
489 #define HAL_PWM1_BASE (0x40015000)
490 #define HAL_PWM2_BASE (0x40016000)
491 #define HAL_PWM3_BASE (0x40017000)
492 #define HAL_TIMER0_BASE (0x40018000)
493 #define HAL_TIMER1_BASE (0x40019000)
494 #define HAL_TIMER2_BASE (0x4001a000)
495 #define HAL_TIMER3_BASE (0x4001b000)
496 //以下4个为非真实的地址
497 #define CODEC_AD_GATE (0x4001c000)
498 #define CODEC_DA_GATE (0x4001d000)
499 #define WWDG_CPU0_HALT_GATE (0x4001e000)
500 #define WWDG_CPU1_HALT_GATE (0x4001f000)
501 
502 
503 #define HAL_PA_BASE (0x40020000)
504 #define HAL_PB_BASE (0x40021000)
505 #define HAL_UART0_BASE (0x40022000)
506 #define HAL_UART1_BASE (0x40023000)
507 #define HAL_UART2_BASE (0x40024000)
508 #define HAL_IIS0_BASE (0x40025000)//(IO)
509 #define HAL_IIS1_BASE (0x40026000)//(CODEC)
510 #define HAL_IIS2_BASE (0x40027000)//(PDM)
511 #define HAL_PD_BASE (0x40028000)
512 //以下2个为非真实的地址
513 #define IIS1_RX_GATE (0x40029000)
514 #define IIS1_TX_GATE (0x4002A000)
515 
516 
517 #define HAL_DPMU_BASE (0x40030000)
518 #define HAL_PC_BASE (0x40031000)
519 #define HAL_IWDG_BASE (0x40032000)
520 #define HAL_EFUSE_BASE (0x40033000)
521 #define HAL_PWM4_BASE (0x40034000)//复用TIMER0
522 #define HAL_PWM5_BASE (0x40035000)//复用TIMER1
523 //以下2个为非真实的地址
524 #define IWDG_CPU0_HALT_GATE (0x40036000)
525 #define IWDG_CPU1_HALT_GATE (0x40037000)
526 #define PLL_OUT_GATE (0x40038000)
527 
528 
529 #define HAL_MAILBOX0_BASE (0x40006000)
530 #define HAL_MAILBOX1_BASE (0x30010000)
531 
532 
533 #define SPI0FIFO_BASE (0x60000000)
534 #define UART0FIFO_BASE (0x61000000)
535 #define UART1FIFO_BASE (0x62000000)
536 #define UART2FIFO_BASE (0x63000000)
537 
538 
539 #define SCU ((SCU_TypeDef*)HAL_SCU_BASE)
540 #define DPMU ((DPMU_TypeDef*)HAL_DPMU_BASE)
541 #define ADC ((ADC_TypeDef*)HAL_ADC_BASE)
542 #define UART0 ((UART_TypeDef*)HAL_UART0_BASE)
543 #define UART1 ((UART_TypeDef*)HAL_UART1_BASE)
544 #define UART2 ((UART_TypeDef*)HAL_UART2_BASE)
545 #define TWDG ((TWDG_TypeDef *)HAL_TWDG_BASE)
546 #define PDM ((PDM_TypeDef*)HAL_PDM_BASE)
547 #define CODEC ((CODEC_TypeDef*)HAL_CODEC_BASE)
548 #define ALC ((ALC_TypeDef*)HAL_ALC_BASE)
549 #define ALC_PDM ((ALC_TypeDef*)HAL_ALC_PDM_BASE)
550 #define DMAC ((DMA_TypeDef*)HAL_GDMA_BASE)
551 #define IISDMA0 ((IISDMA_TypeDef*)HAL_IISDMA0_BASE)
552 
553 
559 /******************************************************************************/
560 /* Peripheral Registers_Bits_Definition */
561 /******************************************************************************/
562 
563 void _delay_10us_240M(uint32_t cnt);
564 
565 #ifdef __cplusplus
566 }
567 #endif /* __cplusplus */
568 
569 #endif
570 
571 /************************ (C) COPYRIGHT chipintelli *****END OF FILE****/
572 
573 
574 
575 
576 
577 
578 
579 
580 
581 
582 
volatile unsigned int reg2
Definition: ci130x_system.h:372
volatile unsigned int reg6
Definition: ci130x_system.h:376
volatile unsigned int BYTE_HW_MODE
Definition: ci130x_system.h:268
void _delay_10us_240M(uint32_t cnt)
Definition: ci130x_system.c:12
volatile unsigned int LOW_POWER_CFG
Definition: ci130x_system.h:196
volatile unsigned int UARTIBrd
Definition: ci130x_system.h:252
Definition: ci130x_system.h:76
Definition: ci130x_system.h:46
volatile unsigned int SYS_CLK_SEL_CFG
Definition: ci130x_system.h:181
volatile unsigned int IISxDMATADDR0
Definition: ci130x_system.h:323
volatile unsigned int REMINTCLR
Definition: ci130x_system.h:266
volatile unsigned int PU_CFG1
Definition: ci130x_system.h:229
volatile uint32_t ALC_INT_STATUS
Definition: ci130x_system.h:441
volatile unsigned int AON_RESET_CFG
Definition: ci130x_system.h:190
volatile unsigned int reg30
Definition: ci130x_system.h:395
volatile unsigned int BOOT_ADDR_CFG
Definition: ci130x_system.h:165
volatile uint32_t RIGHT_CTRL
Definition: ci130x_system.h:453
volatile unsigned int reg26
Definition: ci130x_system.h:386
volatile uint32_t R_DB_STATUS
Definition: ci130x_system.h:458
unsigned int NextLLI
Definition: ci130x_system.h:314
volatile unsigned int UARTFIFOlevel
Definition: ci130x_system.h:256
volatile unsigned int IISDMAIISCLR
Definition: ci130x_system.h:337
volatile unsigned int WAKEUP_MASK_CFG0
Definition: ci130x_system.h:147
volatile unsigned int REMTXDATA
Definition: ci130x_system.h:264
Definition: ci130x_system.h:65
volatile unsigned int MCLK0_CFG
Definition: ci130x_system.h:123
volatile unsigned int PMU_PWROFF_CFG
Definition: ci130x_system.h:197
volatile unsigned int reg47
Definition: ci130x_system.h:360
volatile unsigned int UARTICR
Definition: ci130x_system.h:260
volatile unsigned int reg25
Definition: ci130x_system.h:385
volatile unsigned int reg5
Definition: ci130x_system.h:375
volatile unsigned int WAKEUP_RESET_CFG
Definition: ci130x_system.h:200
Definition: ci130x_system.h:54
volatile unsigned int DMACIntErrClr
Definition: ci130x_system.h:289
Ext_Num
Definition: ci130x_system.h:89
Definition: ci130x_system.h:62
volatile uint32_t L_ATK_DCY_STATUS
Definition: ci130x_system.h:451
volatile unsigned int AON_CLK_PARAM_EN_CFG
Definition: ci130x_system.h:186
volatile unsigned int MCLK2_CFG
Definition: ci130x_system.h:125
volatile unsigned int ST_CFG0
Definition: ci130x_system.h:222
volatile unsigned int IIS_DATA_SEL_CFG
Definition: ci130x_system.h:161
volatile unsigned int rega
Definition: ci130x_system.h:379
Definition: ci130x_system.h:272
volatile unsigned int PD_CFG0
Definition: ci130x_system.h:213
volatile unsigned int IIS0_CLK_SEL_CFG
Definition: ci130x_system.h:127
enum FlagStatus ITStatus
volatile unsigned int UARTWrDR
Definition: ci130x_system.h:249
volatile unsigned int DMACIntStatus
Definition: ci130x_system.h:285
volatile unsigned int IIS_END_NUM_EN
Definition: ci130x_system.h:341
volatile unsigned int RSTCFG_LOCK_CFG
Definition: ci130x_system.h:110
volatile unsigned int APB0_RERST_CFG
Definition: ci130x_system.h:144
volatile unsigned int IISDMACLR
Definition: ci130x_system.h:336
volatile unsigned int DMACEnbldChns
Definition: ci130x_system.h:292
volatile unsigned int REMINTSTAE
Definition: ci130x_system.h:267
Definition: ci130x_system.h:58
volatile unsigned int SYS_CLKGATE_CFG1
Definition: ci130x_system.h:136
volatile unsigned int UARTCR
Definition: ci130x_system.h:255
volatile unsigned int reg2e
Definition: ci130x_system.h:393
Definition: ci130x_system.h:84
volatile unsigned int IISDMACTRL
Definition: ci130x_system.h:332
volatile unsigned int UARTMIS
Definition: ci130x_system.h:259
Definition: ci130x_system.h:77
Definition: ci130x_system.h:30
Definition: ci130x_system.h:92
unsigned int SrcAddr
Definition: ci130x_system.h:312
volatile unsigned int RX_VAD_CTRL
Definition: ci130x_system.h:339
volatile uint32_t LEFT_CTRL
Definition: ci130x_system.h:445
volatile unsigned int DMA_REQ_CLR_STATE
Definition: ci130x_system.h:343
volatile unsigned int reg45
Definition: ci130x_system.h:358
volatile unsigned int CFG_LOCK_CFG
Definition: ci130x_system.h:176
Definition: ci130x_system.h:71
Definition: ci130x_system.h:310
Definition: ci130x_system.h:351
volatile unsigned int IISxDMARADDR
Definition: ci130x_system.h:321
volatile uint32_t GLB_CTRL
Definition: ci130x_system.h:444
volatile unsigned int reg43
Definition: ci130x_system.h:356
volatile unsigned int reg27
Definition: ci130x_system.h:423
volatile unsigned int DMACITCR
Definition: ci130x_system.h:302
Definition: ci130x_system.h:28
unsigned int resver1
Definition: ci130x_system.h:371
Definition: ci130x_system.h:67
Definition: ci130x_system.h:60
volatile unsigned int OD_CFG1
Definition: ci130x_system.h:227
Definition: ci130x_system.h:64
enum IRQn IRQn_Type
volatile unsigned int MEM1_EMA_CFG
Definition: ci130x_system.h:159
volatile unsigned int reg44
Definition: ci130x_system.h:357
volatile unsigned int CHIP_INT_MASK_CFG_ADDR
Definition: ci130x_system.h:240
volatile unsigned int DMACIntTCStatus
Definition: ci130x_system.h:286
volatile unsigned int SCU_STATE_REG
Definition: ci130x_system.h:141
Definition: ci130x_system.h:51
volatile unsigned int reg24
Definition: ci130x_system.h:384
volatile unsigned int CLK_DIV_PARAM_EN_CFG
Definition: ci130x_system.h:117
volatile unsigned int reg0
Definition: ci130x_system.h:370
volatile unsigned int AON_CLKGATE_CFG
Definition: ci130x_system.h:188
volatile unsigned int UARTDMACR
Definition: ci130x_system.h:261
Definition: ci130x_system.h:84
volatile unsigned int RX_LAST_ADDR
Definition: ci130x_system.h:340
volatile unsigned int DMACSoftLSReq
Definition: ci130x_system.h:296
volatile unsigned int reg40
Definition: ci130x_system.h:353
volatile unsigned int APB1_CLKGATE_CFG
Definition: ci130x_system.h:139
volatile uint32_t R_MIN_MAX_DB
Definition: ci130x_system.h:457
IRQn
Definition: ci130x_system.h:40
volatile unsigned int reg29
Definition: ci130x_system.h:388
volatile unsigned int reg2b
Definition: ci130x_system.h:390
volatile unsigned int REMRXDATA
Definition: ci130x_system.h:265
volatile unsigned int PMU_PWRON_CFG
Definition: ci130x_system.h:198
Definition: ci130x_system.h:47
volatile unsigned int PD_CFG1
Definition: ci130x_system.h:228
volatile unsigned int UARTRIS
Definition: ci130x_system.h:258
unsigned int Control
Definition: ci130x_system.h:315
volatile unsigned int SRC1_MCLK_CFG
Definition: ci130x_system.h:120
Definition: ci130x_system.h:59
volatile unsigned int UARTFBrd
Definition: ci130x_system.h:253
volatile unsigned int MEM0_EMA_CFG
Definition: ci130x_system.h:158
volatile unsigned int INT_STATE_REG1
Definition: ci130x_system.h:153
volatile unsigned int IISxDMARNUM
Definition: ci130x_system.h:322
volatile unsigned int IISxDMATNUM0
Definition: ci130x_system.h:324
volatile unsigned int reg7
Definition: ci130x_system.h:377
Definition: ci130x_system.h:70
volatile unsigned int UARTLCR
Definition: ci130x_system.h:254
volatile unsigned int PMU_CFG
Definition: ci130x_system.h:192
volatile unsigned int PAD_STATE
Definition: ci130x_system.h:163
Definition: ci130x_system.h:86
volatile unsigned int SRC2_MCLK_CFG
Definition: ci130x_system.h:121
Definition: ci130x_system.h:72
volatile unsigned int PMU_UPDATE_EN
Definition: ci130x_system.h:194
volatile unsigned int DMACCxLLI
Definition: ci130x_system.h:276
volatile unsigned int RC_TRIM_STATE
Definition: ci130x_system.h:156
Definition: ci130x_system.h:28
volatile unsigned int DMACRawIntTCStatus
Definition: ci130x_system.h:290
volatile unsigned int IIS_END_NUM
Definition: ci130x_system.h:342
volatile unsigned int reg2d
Definition: ci130x_system.h:392
volatile unsigned int AON_CLK_PARAM_CFG
Definition: ci130x_system.h:184
Definition: ci130x_system.h:29
Definition: ci130x_system.h:55
volatile unsigned int reg22
Definition: ci130x_system.h:382
volatile unsigned int reg2a
Definition: ci130x_system.h:389
volatile unsigned int DMACIntTCClear
Definition: ci130x_system.h:287
Definition: ci130x_system.h:68
volatile unsigned int PAD_CLK_SEL_CFG
Definition: ci130x_system.h:131
volatile unsigned int IISDMAPTR
Definition: ci130x_system.h:334
DPMU寄存器结构体
Definition: ci130x_system.h:174
volatile unsigned int SL_CFG1
Definition: ci130x_system.h:231
volatile unsigned int DS_CFG0
Definition: ci130x_system.h:217
volatile unsigned int DMACCxConfiguration
Definition: ci130x_system.h:278
volatile unsigned int UARTMaskInt
Definition: ci130x_system.h:257
volatile unsigned int reg4c
Definition: ci130x_system.h:364
volatile unsigned int UARTRdDR
Definition: ci130x_system.h:248
unsigned int DestAddr
Definition: ci130x_system.h:313
volatile unsigned int DMACSync
Definition: ci130x_system.h:298
Definition: ci130x_system.h:49
volatile unsigned int DMACSoftLBReq
Definition: ci130x_system.h:295
volatile unsigned int DMACConfiguration
Definition: ci130x_system.h:297
Definition: ci130x_system.h:34
Definition: ci130x_system.h:103
Definition: ci130x_system.h:31
volatile unsigned int RC_UPDATE_CFG
Definition: ci130x_system.h:206
volatile unsigned int reg23
Definition: ci130x_system.h:383
volatile unsigned int OSC_PAD_CFG
Definition: ci130x_system.h:207
volatile unsigned int IOREUSE_CFG0
Definition: ci130x_system.h:209
Definition: ci130x_system.h:57
volatile unsigned int CKCFG_LOCK_CFG
Definition: ci130x_system.h:111
volatile unsigned int IISxDMATADDR1
Definition: ci130x_system.h:325
volatile unsigned int PDM_CLK_SEL_CFG
Definition: ci130x_system.h:133
volatile unsigned int reg46
Definition: ci130x_system.h:359
volatile uint32_t L_CFG_ADDR
Definition: ci130x_system.h:448
Definition: ci130x_system.h:44
_retval
Definition: ci130x_system.h:25
volatile unsigned int CLK_DIV_PARAM1_CFG
Definition: ci130x_system.h:114
volatile unsigned int WAKEUP_EXT_FILTER_CFG
Definition: ci130x_system.h:202
volatile unsigned int RC_CFG
Definition: ci130x_system.h:205
volatile uint32_t L_MIN_MAX_DB
Definition: ci130x_system.h:449
volatile unsigned int CODEC_CLK_SEL_CFG
Definition: ci130x_system.h:132
volatile unsigned int DMACRawIntErrorStatus
Definition: ci130x_system.h:291
volatile unsigned int MCLK1_CFG
Definition: ci130x_system.h:124
volatile uint32_t R_CFG_ADDR
Definition: ci130x_system.h:456
Definition: ci130x_system.h:27
volatile unsigned int IIS2_CLK_SEL_CFG
Definition: ci130x_system.h:129
volatile uint32_t L_STEP_TMR_ATK
Definition: ci130x_system.h:446
volatile unsigned int IE_CFG1
Definition: ci130x_system.h:233
volatile uint32_t ALC_INT_EN
Definition: ci130x_system.h:442
volatile unsigned int OD_CFG0
Definition: ci130x_system.h:212
volatile unsigned int CLK_DIV_PARAM2_CFG
Definition: ci130x_system.h:115
volatile unsigned int SYS_CTRL_CFG
Definition: ci130x_system.h:105
Definition: ci130x_system.h:48
volatile unsigned int RC_TRIM_CFG
Definition: ci130x_system.h:155
volatile unsigned int WAKEUP_MASK_CFG1
Definition: ci130x_system.h:148
Definition: ci130x_system.h:86
volatile unsigned int SL_CFG0
Definition: ci130x_system.h:220
Definition: ci130x_system.h:33
volatile unsigned int SYS_SOFTRST_CFG
Definition: ci130x_system.h:179
volatile unsigned int DS_CFG1
Definition: ci130x_system.h:218
volatile unsigned int reg41
Definition: ci130x_system.h:354
volatile unsigned int AD_CFG0
Definition: ci130x_system.h:226
volatile unsigned int UARTFlag
Definition: ci130x_system.h:251
uint32_t reserve
Definition: ci130x_system.h:452
volatile unsigned int DMACCxControl
Definition: ci130x_system.h:277
volatile unsigned int PWR_WAKEUP_STATE_REG
Definition: ci130x_system.h:237
volatile unsigned int DMACIntErrorStatus
Definition: ci130x_system.h:288
volatile unsigned int IISxDMATNUM1
Definition: ci130x_system.h:326
volatile unsigned int PAD_FILTER_CFG_ADDR
Definition: ci130x_system.h:241
volatile unsigned int IISDMASTATE
Definition: ci130x_system.h:335
Definition: ci130x_system.h:246
volatile unsigned int PLL_CFG
Definition: ci130x_system.h:183
FunctionalState
Definition: ci130x_system.h:86
volatile uint32_t L_DB_STATUS
Definition: ci130x_system.h:450
volatile unsigned int IIS1_CLK_SEL_CFG
Definition: ci130x_system.h:128
Definition: ci130x_system.h:439
volatile unsigned int INT_STATE_REG0
Definition: ci130x_system.h:152
volatile unsigned int reg4
Definition: ci130x_system.h:374
volatile uint32_t R_STEP_TMR_ATK
Definition: ci130x_system.h:454
Definition: ci130x_system.h:75
volatile unsigned int AHB_RESET_CFG
Definition: ci130x_system.h:143
volatile unsigned int REMCR
Definition: ci130x_system.h:263
volatile unsigned int reg2c
Definition: ci130x_system.h:391
Definition: ci130x_system.h:36
volatile unsigned int UARTTimeOut
Definition: ci130x_system.h:262
Definition: ci130x_system.h:32
Definition: ci130x_system.h:29
Definition: ci130x_system.h:74
volatile unsigned int DMACCxDestAddr
Definition: ci130x_system.h:275
volatile unsigned int SYSCFG_LOCK_CFG
Definition: ci130x_system.h:109
volatile unsigned int ST_CFG1
Definition: ci130x_system.h:232
volatile unsigned int APB0_CLKGATE_CFG
Definition: ci130x_system.h:138
volatile unsigned int CHIP_STATE_REG_ADDR
Definition: ci130x_system.h:239
unsigned int resver2
Definition: ci130x_system.h:412
volatile unsigned int DS_CFG2
Definition: ci130x_system.h:230
volatile unsigned int APB1_RERST_CFG
Definition: ci130x_system.h:145
Definition: ci130x_system.h:43
volatile unsigned int IE_CFG0
Definition: ci130x_system.h:224
volatile unsigned int CLK_DIV_PARAM0_CFG
Definition: ci130x_system.h:113
Definition: ci130x_system.h:73
volatile uint32_t L_STEP_TMR_DCY
Definition: ci130x_system.h:447
volatile unsigned int PU_CFG0
Definition: ci130x_system.h:215
volatile uint32_t R_ATK_DCY_STATUS
Definition: ci130x_system.h:459
Definition: ci130x_system.h:69
Definition: ci130x_system.h:404
Definition: ci130x_system.h:330
volatile unsigned int DMAINT_SEL_CFG
Definition: ci130x_system.h:167
volatile unsigned int reg49
Definition: ci130x_system.h:362
Definition: ci130x_system.h:66
volatile uint32_t PAUSE_STATUS
Definition: ci130x_system.h:461
Definition: ci130x_system.h:91
volatile unsigned int reg28
Definition: ci130x_system.h:424
volatile unsigned int IOREUSE_CFG1
Definition: ci130x_system.h:210
Definition: ci130x_system.h:52
volatile unsigned int DMACSoftSReq
Definition: ci130x_system.h:294
volatile unsigned int DMACCxSrcAddr
Definition: ci130x_system.h:274
volatile uint32_t ALC_INT_CLR
Definition: ci130x_system.h:443
Definition: ci130x_system.h:283
volatile unsigned int reg48
Definition: ci130x_system.h:361
volatile unsigned int EXT0_FILTER_CFG
Definition: ci130x_system.h:149
volatile uint32_t R_STEP_TMR_DCY
Definition: ci130x_system.h:455
Definition: ci130x_system.h:61
volatile unsigned int EXT_INT_CFG
Definition: ci130x_system.h:107
Definition: ci130x_system.h:50
volatile unsigned int UARTRxErrStat
Definition: ci130x_system.h:250
volatile unsigned int reg3
Definition: ci130x_system.h:373
volatile unsigned int RST_STATE_REG
Definition: ci130x_system.h:235
Definition: ci130x_system.h:319
volatile unsigned int DMACSoftBReq
Definition: ci130x_system.h:293
volatile unsigned int reg2f
Definition: ci130x_system.h:394
volatile unsigned int reg21
Definition: ci130x_system.h:381
volatile unsigned int reg42
Definition: ci130x_system.h:355
volatile unsigned int EXT1_FILTER_CFG
Definition: ci130x_system.h:150
volatile unsigned int SRC0_MCLK_CFG
Definition: ci130x_system.h:119
Definition: ci130x_system.h:53
Definition: ci130x_system.h:27
volatile unsigned int AHB_CLKGATE_CFG
Definition: ci130x_system.h:137
Definition: ci130x_system.h:63
volatile unsigned int SYS_CLKGATE_CFG0
Definition: ci130x_system.h:135
volatile unsigned int WAKEUP_CFG
Definition: ci130x_system.h:203
volatile unsigned int SYS_RESET_CFG
Definition: ci130x_system.h:178
volatile unsigned int WAKEUP_MASK_CFG
Definition: ci130x_system.h:201
#define INT32_T_MIN
Definition: ci130x_system.h:23
Definition: ci130x_system.h:56
Definition: ci130x_system.h:368
FlagStatus
Definition: ci130x_system.h:84