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

📄 systeminit.c

📁 cap口例程
💻 C
字号:
//
//      TMDX ALPHA RELEASE
//      Intended for product evaluation purposes
//
//###########################################################################
//
// FILE:	systeminit.c
//
// TITLE:	DSP28 system initilization program.
//
//###########################################################################

// Step 0.  Include required header files
         // DSP28_Device.h: device specific definitions #include statements for
         // all of the peripheral .h definition files.
         // DSP28_Example.h is specific for the given example.  

#include "DSP28_Device.h"

// Prototype statements for functions found within this file.
extern interrupt void cap(void);

void InitSystem(void)
{

// Step 1. Initialize System Control registers, PLL, WatchDog, Clocks to default state:
        // This function is found in the DSP28_SysCtrl.c file.
	InitSysCtrl();

// Step 2. Select GPIO for the device or for the specific application:
        // This function is found in the DSP28_Gpio.c file.
	// InitGpio();  // Skip for this test

// Step 3. Initialize PIE vector table:
	// The PIE vector table is initialized with pointers to shell Interrupt 
        // Service Routines (ISR).  The shell routines are found in DSP28_DefaultIsr.c.
	// Insert user specific ISR code in the appropriate shell ISR routine in 
        // the DSP28_DefaultIsr.c file.

	// Disable and clear all CPU interrupts:
	DINT;
	IER = 0x0000;
	IFR = 0x0000;

	// Initialize Pie Control Registers To Default State:
        // This function is found in the DSP28_PieCtrl.c file.
	InitPieCtrl();

	// Initialize the PIE Vector Table To a Known State:
        // This function is found in DSP28_PieVect.c.
	// This function populates the PIE vector table with pointers
        // to the shell ISR functions found in DSP28_DefaultIsr.c.
	InitPieVectTable();	
	
// Step 4. Initialize all the Device Peripherals to a known state:
	// This function is found in DSP28_InitPeripherals.c
    // InitPeripherals();
    // Just init the timers for this test
//    InitCpuTimers();
    
// Step 5. User specific functions, Reassign vectors (optional), Enable Interrupts:
	
	// Initialize Timer 2:
	//		> Connect To INT14
	//		> Set Up For 1 Second Interrupt Period
	//		> Point To "ISRTimer2" function

	// Reassign CPU-Timer2 ISR. 
        // Reassign the PIE vector for TINT2 to point to a different ISR then
        // the shell routine found in DSP28_DefaultIsr.c.
        // This is done if the user does not want to use the shell ISR routine
        // but instead wants to use their own ISR.  This step is optional:
	
	EALLOW;	// This is needed to write to EALLOW protected registers
	PieVectTable.CAPINT1=∩
	EDIS;   // This is needed to disable write to EALLOW protected registers
    
    // Include application specific functions. This is for this example:
	
	// Configure CPU-Timer 2 to interrupt every second:
//	ConfigCpuTimer(&CpuTimer2, 100, 1000000);	// 100MHz CPU Freq, 1 second Period (in uSeconds)
// 	StartCpuTimer2();

    // Enable INT5 which is connected to Evb:
    PieCtrl.PIEIER3.bit.INTx5=1;
    IER |= M_INT3;
	//KickDog();
    // Enable global Interrupts and higher priority real-time debug events:
    	
	EINT;   // Enable Global interrupt INTM
	ERTM;	// Enable Global realtime interrupt DBGM
    InitGpio();
    InitEv();
} 	

//===========================================================================
// No more.
//===========================================================================

⌨️ 快捷键说明

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