⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 SmartARM2400系列开发板全套资料
💻 C
字号:
/****************************************Copyright (c)***************************************************
**                               Guangzou ZHIYUAN electronics Co.,LTD.
**                                      
**                                 http://www.embedtools.com
**
**--------------File Info--------------------------------------------------------------------------------
** File name:			main.c
** Last modified Date:  2008.05.06
** Last Version:		V1.00
** Descriptions:		the cursor interrupt function
**
**-------------------------------------------------------------------------------------------------------
** Created by:		   	Houxiaolong
** Created date:		2008.05.06
** Version:				V1.00
** Descriptions:		the cursor interrupt function
**
**-------------------------------------------------------------------------------------------------------
** Modified by:			
** Modified date:		
** Version:
** Descriptions:		
**
*********************************************************************************************************/
#include "config.h"
#include "LCD2478.h"
#include "cursor.h"

/*********************************************************************************************************
** Function name :        cursor_ISR
** Function Description : cursor's ISR fuction
** Input:                 none                      
** Output:                none
*********************************************************************************************************/
void __irq cursor_ISR(void)
{
    if (CRSR_INTRAW == 0x01) {
        cursor_SetPosition(0,0);
        cursor_On();
    }
    
    CRSR_INTCLR = (1 << 0);
    CRSR_INTMSK = (0 << 0);
    
    VICVectAddr = 0x00;
}


/*********************************************************************************************************
** Function name :        cursor_IRQInit
** Function Description : enable cursor interrupt
** Input:                 none                      
** Output:                none
*********************************************************************************************************/
void cursor_IRQInit(void)
{
    CRSR_INTMSK   = (1 <<0); 
    VICIntSelect &= ~(1 << 16);
    VICVectAddr16 = (unsigned int)cursor_ISR;
    VICVectPri16  = 0;
    VICIntEnable  = (1 << 16); 
    IRQEnable();
}


/*********************************************************************************************************
** 函数名称 :main()
** 函数功能 :演示LPC247X的LCD控制器
** 调试说明 :本例程不能在外部FLASH和内部RAM中调试
*********************************************************************************************************/
int main (void)
{
    int i;                                                              
 
    lcd_Init();                                                         /*  初始化液晶                  */                                           

    cursor_IRQInit();                                                   /*  使能光标中断                */                  

	for (i = 0; i < 220; i++)
	{
	    cursor_SetPosition(i,i);                                        /*  移动光标                    */
	    delay_Ns(10);
	}

	while(1);
	
    return 0;
}
/*********************************************************************************************************
**                            End Of File
*********************************************************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -