欢迎来到天天文库
浏览记录
ID:61419165
大小:41.50 KB
页数:8页
时间:2021-01-28
《DSP综合实验程序分析.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、#include"DSP281x_Device.h"//DSP281xHeaderfileIncludeFile#include"DSP281x_Examples.h"//DSP281xExamplesIncludeFilevoidDelay(unsignedintnTime);voidSetLEDArray1(intnNumber);//修改显示内容voidRefreshLEDArray1();//刷新显示interruptvoidcpu_timer0_isr(void);//CPUTimer0的中断服务程序int
2、erruptvoidXINT2_isr(void);//利用ICETEK-CTR键盘产生外中断的中断服务程序voidEndICETEKCTR();#defineXINT2CR(*((unsignedint*)0x7071))#defineXNMICR(*((unsignedint*)0x7077))#defineT46uS0x0d40#defineSCANCODE_00x70//键盘的扫描码,由DSP的扩展地址0x给出,当有键盘输入时,#defineSCANCODE_10x69//读此端口得到扫描码,当无键盘被按下时
3、,读此端口的结果为0#defineSCANCODE_20x72#defineSCANCODE_30x7A#defineSCANCODE_40x6B#defineSCANCODE_50x73#defineSCANCODE_60x74#defineSCANCODE_70x6C#defineSCANCODE_80x75#defineSCANCODE_90x7D#defineSCANCODE_Del0x49#defineSCANCODE_Enter0x5A#defineSCANCODE_Plus0x79#defineSCAN
4、CODE_Minus0x7B#defineSCANCODE_Mult0x7C#defineSCANCODE_Divid0x4A#defineSCANCODE_Num0x77#defineCTRGR*(int*)0x//全局控制寄存器#defineCTRLCDCMDR*(int*)0x#defineCTRKEY*(int*)0x//键盘数据回读寄存器#defineCTRLCDCR*(int*)0x#defineCTRCLKEY*(int*)0x//清除键盘#defineCTRLCDLCR*(int*)0x#define
5、CTRLCDRCR*(int*)0x#defineCTRLA*(int*)0x//发光二极管控制#defineCTRLR*(int*)0x//辅助控制Uint16var1=0;Uint16var2=0;Uint16var3=0;Uint16test_count=0;Uint16Test_flag=0;Uint16Test_var=0;Uint16Test_status[32];#definenStatusNSGreenEWRed160//用数字来区分每一个状态南北绿灯,东西红灯#definenStatusNSFlas
6、hEWRed184//南北绿灯闪烁,东西红灯#definenStatusNSYellowEWRed200//南北黄灯,东西红灯#definenStatusNSRedEWYellow216//南北红灯,东西黄灯#definenStatusNSRedEWGreen376//南北红灯,东西绿灯#definenStatusNSRedEWFlash400//南北红灯,东西绿灯闪烁#definenStatusNSRedEWYellow1416//南北红灯,东西黄灯#definenStatusNSYellowEWRed1432//
7、南北黄灯,东西红灯#definenTotalTime448//正常顺序一个循环#definenStatusHold160//突发情况#definestatusNSGreenEWRed0//一共7个状态#definestatusNSFlashEWRed1#definestatusNSYellowEWRed2#definestatusNSRedEWYellow3#definestatusNSRedEWGreen4#definestatusNSRedEWFlash5#definestatusHold6inta=0;unsi
8、gnedintuWork,nTimeCount,nTimeMS;//计数时使用的变量unsignedintuLightStatusEW,uLightStatusSN;//东西、南北红黄绿二极管的亮灭情况unsignedintbHold;//用来表明是否处于突发情况unsignedcharledbuf[8],ledx[8];//二极管点阵显示用到
此文档下载收益归作者所有