main.c

来自「西红柿的驱动」· C语言 代码 · 共 62 行

C
62
字号
// Use TL0324 for EG128032
#include <AT89X52.h>
#include "inc/datatype.h"
#include "inc/delay.h"
#include "inc/tl0324.h"
#include "inc/graphics.h"
#include "inc/imgXldz128016.c"

// Special display function for EG128032P/Q/R
void disp_downleft(uint8 code *ptrImage, uint8 width, uint8 height);

void main(void)
{
	//uint8 i;
	LCD_Initial();
	while(1)
	{
		// Standard Test Graphics
		LCD_Test();
		
		// Draw two rectangle
		LineH(0,0,128);
		LineH(0,15,128);
		LineV(0,0,16);
		LineV(127,0,16);
		
		LineH(0,16,128);
		LineH(0,31,128);
		LineV(0,16,16);
		LineV(127,16,16);		
		delay1s();
		Clear();
		
		// Display XinLinDianZi in a fullscreen rectangle
		disp_upleft(imgXldz128016, 128, 16);
		disp_downleft(imgXldz128016, 128, 16);
		delay1s();
		Clear();
	}
}

void disp_downleft(uint8 code *ptrImage, uint8 width, uint8 height)
{
	// width <= LCD_CMAX, height <= LCD_PMAX
	uint8 i,k;
	uint8 PageHold;
	
	if (height%8 != 0)
		PageHold = height/8 + 1;
	else
		PageHold = height/8;

	for (k = 2; k > 2 - PageHold; k--)
	{
		SetPA(k - 1);
		SetCA(0);
		for (i = 0; i < width; i++)
		{
			SendByte(iDat, *ptrImage++);
		}
	}
}

⌨️ 快捷键说明

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