随便打开一个TI的例子(controlSUITE软件),在它的main函数里都可以看到以下5部:直接copy
// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the DSP2833x_SysCtrl.c file.
InitSysCtrl();
系统初始化,上两篇文章已经说过了
// Step 2. Initialize GPIO:
// This example function is found in the DSP2833x_Gpio.c file and
// illustrates how to set the GPIO to it's default state.
// InitGpio(); Skipped for this example
对要用到的管脚进行配置,在GPIO例子中,直接跳过,但是在main函数后边对管脚进行配置。一般最简单的例子是就是点亮LED就会了
// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
DINT;
汇编语言,清中断
// Initialize PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags
// are cleared.
// This function is found in the DSP2833x_PieCtrl.c file.
InitPieCtrl();
初始化PIE向量,以后研究
// Disable CPU interrupts and clear all