Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3295710
  • 博文数量: 754
  • 博客积分: 10132
  • 博客等级: 上将
  • 技术积分: 7780
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-14 23:36
文章分类

全部博文(754)

文章存档

2012年(3)

2011年(39)

2010年(66)

2009年(167)

2008年(479)

我的朋友

分类: LINUX

2008-04-21 01:19:40

#include "2410lib.h"
#include "2410addr.h"
#include "timer.h"
//KEY10->EINT0
void __irq Eint0Handler();
int Main()
{
            
    SetClockDivider(1, 1);
 SetSysFclk(DFT_FCLK_VAL);
 Port_Init();
  
 Uart_Select(0);
 Uart_Init(0, UART_BAUD);
       
 rGPFCON=(rGPFCON|0x01)&0xFFFFFFFE;//GPF0设置为EINT0
    rGPFUP|=0x01;   //disable GPF0 pull up
 
 //设置GPE11为输出0
 rGPECON=(rGPFCON|0xC00000)&0xFF7FFFFF;
 rGPEUP|=0x800;
 rGPEDAT&=0xF7FF;
 
 pISR_EINT0=(unsigned)Eint0Handler;
    rEXTINT0 &= ~(7); 
 rEXTINT0 |=  (2); //set eint0 falling edge int
    EnableIrq(BIT_EINT0);//开中断
    while(1)
    {    
    Uart_Printf("the main is running\n");
    Delay(500);    
    }
    
}
阅读(1110) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~