⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 essaicslmain.c

📁 Code for devellop for most DSP application. This code includes configurations for register into the
💻 C
字号:

#include "essaiCSL.h"
#include <csl_pll.h>

short acqBufFlip[ACQ_SIZE];
short acqBufFlop[ACQ_SIZE];

void initChip(void) {
   CHIP_Config devCfgReg = 
     {
          CHIP_DEVCFG_RMK(
               CHIP_DEVCFG_EKSRC_DEFAULT,	//dans csl_chiphal.h
               CHIP_DEVCFG_TOUT1SEL_DEFAULT,
               CHIP_DEVCFG_TOUT0SEL_DEFAULT,
               CHIP_DEVCFG_MCBSP0DIS_DEFAULT,
               CHIP_DEVCFG_MCBSP1DIS_DEFAULT)              
     };

	 PLL_Init pll50 =	//oscillateur 50 MHz
	 { 
		4,				//multiplie par 4
		0x0000,			//entr閑 PLL divis閑 par 1
		0x0000,			//divise par 1 pour DSP core = 200 MHz
		0x0001,			//divise par 2 pour Periph = 100 MHz
		0x0001,			//divise par 2 pour ECLK = 100 MHz
		DIV				//sortie CLKOUT3
	};		

	CHIP_config(&devCfgReg);

	//PLL_init(&pll50); //fait planter

	//PLL_enablePllDiv(0);
	//PLL_enablePllDiv(1);
	//PLL_enablePllDiv(2);
	//PLL_enablePllDiv(3);

	*(char*)0x90080000 = 0xf;//allume LED dans CPLD
	*(char*)0x90080006 = 0x3;//McBSP sur connecteur

	PLL_FSET(OSCDIV1, OD1EN, PLL_OSCDIV1_OD1EN_DISABLE); 
	PLL_FSET(OSCDIV1, RATIO, DIV);//programme CLKOUT3
	PLL_enableOscDiv();

}

void main() {
	int i;
	  
	CSL_init();  
	for (i = 0; i < ACQ_SIZE; i++)
	{
	  acqBufFlip[i] = 0;
      acqBufFlop[i] = 0;
	}
	/* Sets GIE = 0 and NMIE = 1.  Also disables all interrupts, */
    /* clears all interrupt flags. */
    IRQ_globalDisable(); /* GIE=0 */
    CHIP_FSET(CSR, PGIE, CHIP_CSR_PGIE_DEFAULT);//??	
	for (i = 4; i < 16; ++i)
	{
		IRQ_reset(i);
	}
	initChip();	    

	initMcbsp();//g閚鑢e CLK pour McASP

	initMcasp(1);

	/* Setup EDMA and enable channels to service MCASP */     
    /* See function for details in init_dma.c */    
    initDmaAcq(1);
    
    /* Sets up interrupts to service EDMA transfers */
    SetInterruptsEdma();   
    runMcasp();//arme r閏eption

    runMcbsp();//envoie sans fin

	while (1);//acquisition

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -