📄 register_lcd_main.c
字号:
/*********************************************************************
Author : ADI - Apps www.analog.com/MicroConverter
Date : August 2006
File : Register_LCD_Main.c
Hardware : Applicable to ADuC702x rev H or I silicon
Description : This file provides the routines necessary to interface
to a Register based LCD display module.
*********************************************************************/
#include <ADuC7020.h> // Include ADuC7020 Header File
#include <Register_LCD_Driver.h>
volatile unsigned short ucFlag, ucAwaiting_IRQ = 0;
void main (void)
{
while (1)
{
delay(3000); // KS0070B needs 30mS after power-on
IRQEN = 0;
ucAwaiting_IRQ = 0;
Init_MC08_LCD(); // Init the ADuC7020 interface to the LCD module
Select_Function_Set(0x38); // Select 8-bit character set, 2 line display
// Clear_Display_LCD(0x1);
Clear_Display_LCD(0xE); // Clear Display/Blink off/display on
Set_Entry_Mode(0x6); // Increment on/No shifting
Clear_Display_LCD(0x2);
Clear_Display_LCD(0x1);
if (ucFlag == 0)
{
Wr_Data_LCD(0x41); //A
Wr_Data_LCD(0x6E); //n
Wr_Data_LCD(0x61); //a
Wr_Data_LCD(0x6C); //l
Wr_Data_LCD(0x6F); //o
Wr_Data_LCD(0x67); //g
Wr_Data_LCD(0x20); //_
Wr_Data_LCD(0x44); //D
Wr_Data_LCD(0x65); //e
Wr_Data_LCD(0x76); //v
Wr_Data_LCD(0x69); //i
Wr_Data_LCD(0x63); //c
Wr_Data_LCD(0x65); //e
Wr_Data_LCD(0x73); //s
Clear_Display_LCD(0x2);
// Clear_Display_LCD(0x1);
Clear_Display_LCD(0x40); // Second Line
Clear_Display_LCD(0xC0); // Second Line
Wr_Data_LCD(0x41); //A
Wr_Data_LCD(0x44); //D
Wr_Data_LCD(0x75); //u
Wr_Data_LCD(0x43); //C
Wr_Data_LCD(0x37); //7
Wr_Data_LCD(0x30); //0
Wr_Data_LCD(0x32); //2
Wr_Data_LCD(0x30); //0
Wr_Data_LCD(0x20); //_
Wr_Data_LCD(0x4C); //L
Wr_Data_LCD(0x43); //C
Wr_Data_LCD(0x44); //D
// Wr_Data_LCD(0x20); //_
Wr_Data_LCD(0x64); //d
Wr_Data_LCD(0x65); //e
Wr_Data_LCD(0x6D); //m
Wr_Data_LCD(0x6F); //o
delay(50000);
delay(50000);
delay(50000);
delay(50000);
}
else
{
Wr_Data_LCD(0x41); //A
Wr_Data_LCD(0x44); //D
Wr_Data_LCD(0x75); //u
Wr_Data_LCD(0x43); //C
Wr_Data_LCD(0x37); //7
Wr_Data_LCD(0x30); //0
Wr_Data_LCD(0x32); //2
Wr_Data_LCD(0x30); //0
Wr_Data_LCD(0x20); //_
Wr_Data_LCD(0x4C); //L
Wr_Data_LCD(0x43); //C
Wr_Data_LCD(0x44); //D
// Wr_Data_LCD(0x20); //_
Wr_Data_LCD(0x64); //d
Wr_Data_LCD(0x65); //e
Wr_Data_LCD(0x6D); //m
Wr_Data_LCD(0x6F); //o
while (1)
{}
}
while (ucAwaiting_IRQ == 0)
{
IRQEN = XIRQ0_BIT; // Enable XIRQ0 in IRQEnable
delay (5000);
}
}
}
/********************************************************************/
/* */
/* Interrupt Service Rountine */
/* */
/********************************************************************/
void IRQ_Handler() __irq
{
GP4DAT ^= 0x00040000; // Complement P4.2
while(GP0DAT & 0x00010){} // wait for XIRQ to be low again
ucFlag ^=0x01;
ucAwaiting_IRQ = 1;
return ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -