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

📄 demo.c

📁 MSC-51驱动SYB240128AZK
💻 C
字号:
/*******************************************************************************
*                                                                            
*	Filename:	Demo.c
* 
*   	Author:		Duke Chang
*   	Company:    	RAiO Technology Inc.
*	Case:		240x128 
*	Device:		MXIC MX10E8050IQC at 18.432MHz
*   	Date:       	2005/10/12
*	Modifier:	Duke Chang
*	Modify Date:    2005/10/12
*   	Visions:   	1.0
*   	Compiled Using Keil C v7.50
*	
*******************************************************************************/

#include "Demo.h"

/******************************************************************************/
/*Main program area		  													  */
/******************************************************************************/
void main(void)
{
	uchar state;
	
	P0 = 0xff;
	P1 = 0xff;
	P2 = 0xff;

#ifdef Parallel_8080
	P3 = 0xff;
#endif

#ifdef Parallel_6800
	P3 = 0x77;
#endif
	
	AUXR = B0000_0011;	//Enable MOVX for external interface

	LCD_Reset();
	LCD_Initial();
	state = 0;

	while(1)	
	{		
		switch(state)
		{
			case 0:
				Test_Font();
				break;	
			case 1:
				Test_Pattern();
				break;	
		}	
		state++;
		if(state==2) state=0;						
	}				
}

/******************************************************************************/
/*Sub program area		  													  */
/******************************************************************************/

//==============================================================================
//Subroutine:	Test_Pattern
//Function:		
//==============================================================================
void Test_Pattern(void)
{
	uchar x, y;
	uchar pat, temp, count;

	LCD_ON();
	LCD_Graphic();

	for(pat=0; pat<10; pat++)	
	{			
		switch(pat)
		{
			case 0:	temp = 0xff;
				break;	
			case 1:	temp = 0x00;
				break;
			case 2:	temp = 0x55;
				break;
			case 3:	temp = 0xaa;
				break;	
			case 4:	temp = 0xcc;
				break;	
			case 5:	temp = 0x33;
				break;	
			case 6:	temp = 0xF0;
				break;	
			case 7:	temp = 0x0F;
				break;
			case 8:	temp = 0x0F;
				break;
			case 9:	temp = 0xFF;
				break;				
		}								
		count = 0;
		LCD_GotoXY(0, 0);
		Delay100us(1);
		for(y=0 ; y<cYSize ; y++)
		{ 
			for(x=0 ; x<cXSize/2 ; x++)
			{
				LCD_DataWrite(temp);
				if(pat==9)	LCD_DataWrite(~temp);
				else LCD_DataWrite(temp);
			}
			count++;
			if((pat==8)&&(count==4))
			{	temp = ~temp;
				count=0;
			}

			else if((pat==9)&&(count==8))
			{	temp = ~temp;
				count=0;
			} 
		}
		Delay100ms(10);
	}
}

//==============================================================================
//Subroutine:	Test_Font, 8x18, 8x16m 16x16, Bold
//Function:		
//==============================================================================
void Test_Font(void)
{
	LCD_ON();
	LCD_Clear();
	LCD_Text();
	LCD_AlignOff();
	LCD_LineDis(0x00);

	LCD_GotoXY(0, 0);
	LCD_PrintStr(sRAiO1, cXSize);
	Delay100ms(10);

	LCD_PrintStr(sRAiO2, cXSize);
	Delay100ms(10);

	LCD_Inv();
	LCD_Cur();
	LCD_PrintStr(sRAiO3, cXSize);
	Delay100ms(10);

	LCD_NoInv();
	LCD_PrintStrD100ms(sRAiO4, cXSize, 4);
	Delay100ms(10);
	LCD_NoCur();
	Delay100ms(20);
		
}


⌨️ 快捷键说明

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