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

📄 main_nonbios.c

📁 DSP 2812 开发的一些功能介绍, 内容丰富
💻 C
字号:
/**********************************************************************
* File: main_nonBIOS.c
* Devices: TMS320F2808, TMS320F2806, TMS320F2801
* Author: David M. Alter, Texas Instruments Inc.
* History:
*   02/11/05 - original (D. Alter)
**********************************************************************/

#include "DSP280x_Device.h"				// Peripheral address definitions

#ifdef EXAMPLE_BIOS
    #include "example_BIOS.h"
#endif

#ifdef EXAMPLE_NONBIOS
    #include "example_nonBIOS.h"
#endif


/**********************************************************************
* Function: main()
*
* Description: Main function for F280x example.
**********************************************************************/
void main(void)
{

/*** CPU Initialization ***/
	InitSysCtrl();						// Initialize the CPU (FILE: SysCtrl.c)
	InitGpio();							// Initialize the shared GPIO pins (FILE: Gpio.c)
	InitPieCtrl();						// Initialize and enable the PIE (FILE: PieCtrl.c)

/*** Copy all FLASH sections that need to run from RAM (use memcpy() from RTS library) ***/

// Section secureRamFuncs contains user defined code that runs from CSM secured RAM
	memcpy(	&secureRamFuncs_runstart,
			&secureRamFuncs_loadstart,
			&secureRamFuncs_loadend - &secureRamFuncs_loadstart);

/*** Initialize the FLASH ***/
	InitFlash();						// Initialize the FLASH (FILE: SysCtrl.c)

/*** Peripheral Initialization ***/
	InitAdc();							// Initialize the ADC (FILE: Adc.c)
	InitEPwm();							// Initialize the Event Manager (FILE: EPwm.c)
	InitECap();							// Initialize the Capture units (FILE: ECap.c)

/*** Enable the clocks to the ePWM module ***/
// Note: this should be done after all ePWM modules are configured
// to ensure synchronization between the ePWM modules.
	asm(" EALLOW");							// Enable EALLOW protected register access
	SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 1;	// HSPCLK to ePWM modules enabled
	asm(" EDIS");							// Disable EALLOW protected register access

/*** Enable interrupts ***/
    SetDBGIER(IER);						// Configure the DBGIER for realtime debug
	asm(" CLRC INTM, DBGM");			// Enable global interrupts and realtime debug

/*** Main Loop ***/

	while(1)							// Dummy loop.  Wait for an interrupt.
	{
		asm(" NOP");
	}

} //end of main()


/*** end of file *****************************************************/

⌨️ 快捷键说明

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