资源简介
CCS5.4+Proteus8的F28027实践课三、外部中断0控制LED流水灯
代码片段和文件信息
#include “DSP28x_Project.h“ // Device Headerfile and Examples Include File
void main(void)
{
// Step 1. Initialize System Control:
// PLL WatchDog enable Peripheral Clocks
// This example function is found in the DSP2802x_SysCtrl.c file.
InitSysCtrl();
// Step 2. Initalize GPIO:
// This example function is found in the DSP2802x_Gpio.c file and
// illustrates how to set the GPIO to it‘s default state.
InitGpio();
// 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 DSP2802x_PieCtrl.c file.
InitPieCtrl();
// Disable CPU interrupts and clear all CPU interrupt flags:
IER = 0x0000;
IFR = 0x0000;
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
// This will populate the entire table even if the interrupt
// is not used in this example. This is useful for debug purposes.
// The shell ISR routines are found in DSP2802x_DefaultIsr.c.
// This function is found in DSP2802x_PieVect.c.
InitPieVectTable();
// Step 4. Initialize all the Device Peripherals:
// This function is found in DSP2802x_InitPeripherals.c
// InitPeripherals(); // Not required for this example
// Step 5. User specific code:
GpioDataRegs.GPADAT.all = 0x00000000; //GPIO0-GPIO31 initial value are 0
EALLOW;
XIntruptRegs.XINT1CR.bit.POLARITY=0;
XIntruptRegs.XINT1CR.bit.ENABLE=1;
PieCtrlRegs.PIEIER1.bit.INTx4 = 1;
PieCtrlRegs.PIECTRL.bit.ENPIE = 1;
IER = 0x0001;
EINT;
EDIS;
while(1)
{
// GpioDataRegs.GPATOGGLE.all=0x000000ff;
// DELAY_US(1000);
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 14363 2016-07-31 01:33 day003\Backup Of day003.pdsbak
文件 14914 2016-07-31 21:19 day003\day003.pdsprj
文件 7617 2016-07-31 21:19 day003\day003.pdsprj.MS-20160623EOHF.Administrator.workspace
文件 517 2016-07-31 20:47 day003\project\.ccsproject
文件 23122 2016-07-31 20:48 day003\project\.cproject
文件 836 2016-07-31 20:46 day003\project\.project
文件 62 2016-07-31 20:46 day003\project\.settings\org.eclipse.cdt.codan.core.prefs
文件 123 2016-07-31 20:46 day003\project\.settings\org.eclipse.cdt.debug.core.prefs
文件 293 2016-07-31 20:48 day003\project\.settings\org.eclipse.core.resources.prefs
文件 6393 2016-07-25 22:56 day003\project\28027_RAM_lnk.cmd
文件 306 2016-07-31 21:26 day003\project\Debug\ccsObjs.opt
文件 87437 2016-07-31 21:26 day003\project\Debug\day003.cof
文件 21 2016-07-31 21:26 day003\project\Debug\day003.cof.asm
文件 4408 2016-07-31 21:26 day003\project\Debug\day003.hex
文件 1245 2016-07-31 21:26 day003\project\Debug\day003.i10
文件 17639 2016-07-31 21:26 day003\project\Debug\day003.map
文件 89041 2016-07-31 21:26 day003\project\Debug\day003_li
文件 1530 2016-07-31 21:22 day003\project\Debug\F2802x_CodeStartBranch.obj
文件 1261 2016-07-31 21:22 day003\project\Debug\F2802x_usDelay.obj
文件 9446 2016-07-31 21:23 day003\project\Debug\main.obj
文件 3639 2016-07-31 21:23 day003\project\Debug\main.pp
文件 4192 2016-07-31 21:26 day003\project\Debug\makefile
文件 250 2016-07-31 21:22 day003\project\Debug\ob
文件 1868 2016-07-31 21:26 day003\project\Debug\sources.mk
文件 34768 2016-07-31 21:22 day003\project\Debug\src\F2802x_DefaultIsr.obj
文件 4205 2016-07-31 21:22 day003\project\Debug\src\F2802x_DefaultIsr.pp
文件 69816 2016-07-31 21:22 day003\project\Debug\src\F2802x_GlobalVariableDefs.obj
文件 3748 2016-07-31 21:22 day003\project\Debug\src\F2802x_GlobalVariableDefs.pp
文件 9246 2016-07-31 21:26 day003\project\Debug\src\F2802x_Gpio.obj
文件 4001 2016-07-31 21:26 day003\project\Debug\src\F2802x_Gpio.pp
............此处省略58个文件信息
- 上一篇:骑士周游问题贪心算法的实现
- 下一篇:完整的基于视觉无人机自主精准降落方案
评论
共有 条评论