资源简介
本节描述了在F28027芯片上的数字引脚控制输出示例代码。代码中,实现了对8个led灯的跑马灯控制。
适用范围:本节所描述的代码适用于F28027芯片,对于其他型号或封装的芯片,未经测试。

代码片段和文件信息
#include “DSP28x_Project.h“ // Device Headerfile and Examples Include File
// Prototype statements for functions found within this file.
interrupt void cpu_timer0_isr(void);
void GPIO_init(void);
//void gpio1(void);
//void gpio2(void);
//void gpio3(void);
//Uint32 a = 0x000000FF;
//Uint32 b = 0x00000001;
//Uint32 GpioInterruptFlag = 0;
//Uint32 LED[] = {0x0000007F //7个灯亮
// 0x0000003F //6个灯亮
// 0x0000001F //5个灯亮
// 0x0000000F //4个灯亮
// 0x00000007 //3个灯亮
// 0x00000003 //2个灯亮
// 0x00000001 //1个灯亮
// 0x00000000 //0个灯亮
// 0x00000001 //1个灯亮
// 0x00000003 //2个灯亮
// 0x00000007 //3个灯亮
// 0x0000000F //4个灯亮
// 0x0000001F //5个灯亮
// 0x0000003F //6个灯亮
// 0x0000007F //7个灯亮
// 0x000000FF //8个灯亮
//};
int16 keyScanFlag = 0; //按键扫描标志
int16 ledNumberCounter = 0; //LED灯数量计数器
int16 keyScanBuff[] = {0xFFFF0xFFFF}; //按键扫描缓冲器
int16 keyStatusCurrent[] = {0 0}; //按键当前状态
int16 keyStatusBackup[] = {0 0}; //按键之前状态
Uint32 led[] = {
0x00000000
0x00000001
0x00000003
0x00000007
0x0000000F
0x0000001F
0x0000003F
0x0000007F
0x000000FF
};
void keyScan(void);
void ledGpio(void);
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. Initialize 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(); // Skipped for this example
GPIO_init();
// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
DINT;
// Initialize the 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();
// Interrupts that are used in this example are re-mapped to
// ISR functions found within this file.
EALLOW; // This is needed to write to EALLOW protected registers
PieVectTable.TINT0 = &cpu_timer0_isr;
EDIS; // This is ne
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-07-05 15:17 28027_GPIO\
文件 492 2014-03-12 10:36 28027_GPIO\.ccsproject
文件 20658 2014-03-12 10:37 28027_GPIO\.cproject
目录 0 2018-07-05 15:17 28027_GPIO\.launches\
文件 3940 2014-03-12 10:41 28027_GPIO\.launches\28027_GPIO.launch
文件 840 2014-03-12 10:36 28027_GPIO\.project
目录 0 2018-07-05 15:17 28027_GPIO\.settings\
文件 62 2014-03-12 10:36 28027_GPIO\.settings\org.eclipse.cdt.codan.core.prefs
文件 123 2014-03-12 10:36 28027_GPIO\.settings\org.eclipse.cdt.debug.core.prefs
文件 407 2018-01-06 14:03 28027_GPIO\.settings\org.eclipse.core.resources.prefs
目录 0 2018-07-05 15:17 28027_GPIO\__Previews\
文件 148151 2014-04-28 15:09 28027_GPIO\__Previews\main.cPreview
文件 4343 2017-12-05 19:41 28027_GPIO\1
文件 25557 2018-01-06 09:18 28027_GPIO\2
目录 0 2018-07-05 15:17 28027_GPIO\ASM\
文件 3247 2013-08-15 12:45 28027_GPIO\ASM\DSP2802x_CodeStartBranch.asm
文件 2575 2013-09-05 15:16 28027_GPIO\ASM\DSP2802x_CSMPasswords.asm
文件 2646 2013-08-15 12:45 28027_GPIO\ASM\DSP2802x_usDelay.asm
目录 0 2018-07-05 15:17 28027_GPIO\Debug\
文件 34673 2018-01-28 14:56 28027_GPIO\Debug\28027_GPIO.map
文件 105098 2018-01-28 14:56 28027_GPIO\Debug\28027_GPIO.out
文件 129261 2018-01-28 14:56 28027_GPIO\Debug\28027_GPIO_li
目录 0 2018-07-05 15:17 28027_GPIO\Debug\ASM\
文件 1838 2017-12-05 19:42 28027_GPIO\Debug\ASM\DSP2802x_CodeStartBranch.obj
文件 861 2017-12-05 19:41 28027_GPIO\Debug\ASM\DSP2802x_CSMPasswords.obj
文件 1539 2017-12-05 19:42 28027_GPIO\Debug\ASM\DSP2802x_usDelay.obj
文件 2087 2018-01-28 14:56 28027_GPIO\Debug\ASM\subdir_rules.mk
文件 1023 2018-01-28 14:56 28027_GPIO\Debug\ASM\subdir_vars.mk
文件 541 2018-01-28 14:56 28027_GPIO\Debug\ccsObjs.opt
文件 2847 2018-01-28 14:56 28027_GPIO\Debug\main.d
文件 25153 2018-01-28 14:56 28027_GPIO\Debug\main.obj
............此处省略87个文件信息
- 上一篇:基于MPI并行计算的高斯消元法程序
- 下一篇:软件著作权多人合作开发协议书模板
相关资源
- DSP实验(10次实验有详细步骤)
- CCS5.05.1可使用的license
- dsp2812上128点FFTc程序以及其CMD文件
- DSP28335程序片内FLASH搬运至RAM运行的
- 基于DSP2812的以太网调试程序
- DSP与PC通讯的几种方法
- DSP 语音识别程序 DTW MFCC
- 创龙C66x平台GigE工业相机图像采集案例
- VC工程转Qt工程文件的工具
- 基于DSP的大功率开关电源的设计方案
- 基于DSP 56F801的正弦波输出DC/AC电源
- 基于DSP的大功率开关电源设计
- 基于ARM7和DSP的逆变电源设计电路
- 基于运动控制器MCK2407的无刷直流电机
- es(elasticsearch)整合SpringCloudSpringBo
- tms320c6748 DSP原理图 SCH PCB
- TMS320F280049最小系统原理图
- F280049C_CMPSS_01.zip
- 基于DSP的矿用静止无功发生器的研制
- 基于DSP的矿井提升机永磁同步电机D
- 基于DSP的SVPWM变频调速系统
- 基于DSP的下一代车载娱乐系统
- DSP控制器原理及其在运动控制系统中
- 北京交通大学-数字图像处理试卷+ 答
- 十字路口交通灯.pdsprj
- 用DSP Builder实现FIR滤波器
- TMS320C54X DSP结构、原理及应用(第二版
- DSP 28035 源码
- PCI总线接口与DSP的HPI接口
- 基于DSP交流伺服系统与CAN总线的通信
评论
共有 条评论