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

📄 screendrv.c

📁 嵌入式开发中触摸屏的显示读写设置,可以显示文字等简单功能
💻 C
📖 第 1 页 / 共 3 页
字号:
	XsPwmDrv_InitPWM0();

   	//enable device power and periphery device
	SET_BIT(BRD_PCR_ADDR, PCR_PER_ON_OFS);
	SET_BIT(BRD_PCR_ADDR, PCR_LCD_ON_OFS);		// lcd power on
	SET_BIT(BRD_PCR_ADDR, PCR_LIGHT_ON_OFS);	// backlight poweron
	
	//--------------需要重新实现------------------
	Util_DelayUs(2000);
    
    //set to almost full duty
    PWM_WRITE_DUTY(0, 1000);	//

	Util_DelayMs(20);
	
	///////////////////////////////
	//finally enable LCD controller
	IOW_REG_FIELD(struct lccr0Bits,&lcdP->lccr0, len, 1);//onlcd
}

int InitLcd(void){
#ifdef debuglcd
	BRD_UartInitDefaultFF();
	BRD_UartInitDefaultBT();
	XsUartDrv_SetDefaultUartDevice(UART_FF);
#endif
	InitVS(0,0,640,480,&VSGLOBAL);
	
	VSGLOBAL.foreColor=(unsigned short)RGB565_COLOR_WHITE;
	VSGLOBAL.backgroundColor=(unsigned short)RGB565_COLOR_BLUE;
	
	InitLcdGraphics();	
#ifdef debuglcd
	PrintfUartDef("buffer at 0x%x-0x%x\r\n",(UINT)FrameBuffer,(UINT)(FrameBuffer+614448));
	PrintfUartDef("VSGlobal at 0x%x\r\n",(UINT)&VSGLOBAL);	
#endif
}
//打点函数
 void printPix(int pixX,int pixY,unsigned short color){
 	pPixel[pixX+pixY*640] = color;
 }
 
 
//拷贝点函数
 void copyPix(int sx,int sy,int dx,int dy){
 	pPixel[dx+dy*640] = pPixel[sx+sy*640];
 }



//清屏
void VSClear(VScreen_T *pVScreen){
	int i,j;
	//clear buffer
	/*for(i=0;i<BUFFER_ROWS;i++)
		for(j=0;j<BUFFER_COLS;j++)
			pVScreen->charBuf[i*BUFFER_COLS+j]=0;*/
	//clear screen		
	for(i=pVScreen->startx;i<pVScreen->endx;i++)
		for(j=pVScreen->starty;j<pVScreen->endy;j++)
			printPix(i,j,pVScreen->backgroundColor);
}


//在rows行上面插入一行,屏幕以上的上滚
int insertLine(int rows,VScreen_T *pVScreen){
	int moveBoundY,i,j;
	if ((rows>pVScreen->rows)||(rows<0)) return 0;
	
	
	moveBoundY=rows*FONTV+FONTV+pVScreen->starty-1;
	if(rows!=0)
		for(j=pVScreen->starty+FONTV;j<=moveBoundY;j++)
			for(i=pVScreen->startx;i<=pVScreen->endx;i++)
				copyPix(i,j,i,j-FONTV);
	for(j=moveBoundY-FONTV+1;j<=moveBoundY;j++)
		for(i=pVScreen->startx;i<=pVScreen->endx;i++)
			printPix(i,j,pVScreen->backgroundColor);
	return 1;
}

//光标调整函数
void AdjCurE(VScreen_T *pVScreen){
	//如果已经到了屏幕的右下角
	if(((pVScreen->cursorx)==(pVScreen->columns))&&((pVScreen->cursory)==(pVScreen->rows))){
		pVScreen->screenOut=1;
		pVScreen->cursorx=0;
	}
		//如果已经到了行尾
		else if((pVScreen->cursorx)==(pVScreen->columns)){
			//置到下一个行首
			pVScreen->cursorx=0;
			pVScreen->cursory=pVScreen->cursory+1;
			
		}
			//否则移到下一个位置
			else{
				pVScreen->cursorx+=1;
				
			}
			
			
}

//nextline,使用缓冲区拷贝
void NextLine(VScreen_T *pVScreen){
	if((pVScreen->cursory)==(pVScreen->rows)){
		//insertLine(pVScreen->rows,pVScreen);
		lineUp(pVScreen);
		pVScreen->cursorx=0;
		pVScreen->cursory=pVScreen->rows;
		pVScreen->screenOut=0;
	}else{
		pVScreen->cursorx=0;
		pVScreen->cursory+=1;
	}
	
	
	
}

//在一个虚拟屏幕上面写一个字符
int VSP(unsigned char c,VScreen_T *pVScreen){
	unsigned char localFont[128][16]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
//0x10
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
//0x20
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x40,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x48,0x48,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x24,0x24,0x7e,0x24,0x24,0x24,0x7e,0x24,0x24,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x10,0x38,0x54,0x50,0x30,0x18,0x14,0x54,0x38,0x10,0x00,0x00,0x00,0x00},
{0x00,0x00,0x30,0x49,0x32,0x04,0x08,0x10,0x26,0x49,0x06,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x20,0x50,0x50,0x20,0x20,0x54,0x48,0x48,0x34,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x20,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x20,0x00,0x00,0x00},
{0x00,0x00,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x00,0x00,0x00},
{0x00,0x00,0x00,0x50,0x20,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x7c,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x40,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x08,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x00,0x00,0x00,0x00,0x00},
//0x30
{0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x38,0x44,0x04,0x04,0x08,0x10,0x20,0x40,0x7c,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x38,0x44,0x04,0x04,0x18,0x04,0x04,0x44,0x38,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x08,0x18,0x18,0x28,0x28,0x48,0x7c,0x08,0x08,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x7c,0x40,0x40,0x78,0x44,0x04,0x04,0x44,0x38,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x38,0x44,0x40,0x40,0x78,0x44,0x44,0x44,0x38,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x7c,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x38,0x44,0x44,0x44,0x38,0x44,0x44,0x44,0x38,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x38,0x44,0x44,0x44,0x3c,0x04,0x04,0x44,0x38,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x20,0x40,0x00,0x00,0x00,0x00},

{0x00,0x00,0x00,0x00,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x10,0x20,0x40,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x38,0x44,0x04,0x04,0x08,0x10,0x10,0x00,0x10,0x00,0x00,0x00,0x00,0x00},
//0x40
{0x00,0x00,0x0f,0x30,0x20,0x47,0x49,0x49,0x46,0x20,0x30,0x0f,0x00,0x00,0x00,0x00},
{0x00,0x00,0x10,0x10,0x28,0x28,0x44,0x44,0x7c,0x82,0x82,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x78,0x44,0x44,0x44,0x78,0x44,0x44,0x44,0x78,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x3c,0x42,0x40,0x40,0x40,0x40,0x40,0x42,0x3c,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x78,0x44,0x42,0x42,0x42,0x42,0x42,0x44,0x78,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x7c,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7c,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x7c,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x3c,0x42,0x40,0x40,0x4e,0x42,0x42,0x46,0x3a,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x42,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x90,0x90,0x60,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x44,0x48,0x50,0x60,0x60,0x50,0x48,0x44,0x42,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7c,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x41,0x41,0x63,0x63,0x55,0x55,0x49,0x49,0x41,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x42,0x62,0x62,0x52,0x52,0x4a,0x46,0x46,0x42,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c,0x00,0x00,0x00,0x00,0x00},
//0x50
{0x00,0x00,0x7c,0x42,0x42,0x42,0x7c,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x4a,0x46,0x3c,0x02,0x00,0x00,0x00,0x00},
{0x00,0x00,0x7c,0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x38,0x44,0x40,0x40,0x38,0x04,0x04,0x44,0x38,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x7c,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x82,0x82,0x44,0x44,0x44,0x28,0x28,0x10,0x10,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x80,0x80,0x44,0x44,0x44,0x2a,0x2a,0x11,0x11,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x82,0x82,0x44,0x28,0x10,0x28,0x44,0x82,0x82,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x82,0x82,0x44,0x28,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0xfe,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0xfe,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x60,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x60,0x00,0x00,0x00},

{0x00,0x00,0x40,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x60,0x00,0x00,0x00},
{0x00,0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00},
//0x60
{0x00,0x00,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x38,0x04,0x3c,0x44,0x44,0x3c,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x40,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x78,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x40,0x40,0x44,0x38,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x04,0x04,0x04,0x3c,0x44,0x44,0x44,0x44,0x3c,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x7c,0x40,0x44,0x38,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x20,0x40,0x40,0x60,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x3c,0x44,0x44,0x44,0x44,0x3c,0x04,0x78,0x00,0x00,0x00},

{0x00,0x00,0x40,0x40,0x40,0x58,0x64,0x44,0x44,0x44,0x44,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x40,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x40,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00},
{0x00,0x00,0x40,0x40,0x40,0x48,0x50,0x60,0x50,0x48,0x44,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x76,0x49,0x49,0x49,0x49,0x49,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x58,0x64,0x44,0x44,0x44,0x44,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x38,0x00,0x00,0x00,0x00,0x00},
//0x70
{0x00,0x00,0x00,0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x78,0x40,0x40,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x3c,0x44,0x44,0x44,0x44,0x3c,0x04,0x04,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x60,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x30,0x48,0x20,0x10,0x48,0x30,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x00,0x40,0x40,0x60,0x40,0x40,0x40,0x40,0x20,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x4c,0x34,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x44,0x44,0x28,0x28,0x10,0x10,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x49,0x49,0x55,0x55,0x22,0x22,0x00,0x00,0x00,0x00,0x00},

{0x00,0x00,0x00,0x00,0x00,0x48,0x48,0x30,0x30,0x48,0x48,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x48,0x48,0x48,0x48,0x30,0x20,0x20,0xc0,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x78,0x08,0x10,0x20,0x40,0x78,0x00,0x00,0x00,0x00,0x00},
{0x00,0x10,0x20,0x20,0x20,0x20,0x40,0x20,0x20,0x20,0x20,0x10,0x00,0x00,0x00,0x00},

{0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00},
{0x00,0x40,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0x40,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x32,0x4c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
//0x7f
{0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00}

};
	
	//如果屏幕溢出则换行
	if((pVScreen->screenOut)==1){
		pVScreen->screenOut=0;
		//insertLine(pVScreen->rows,pVScreen);
		lineUp(pVScreen);
	}
	VSPrint(pVScreen->cursory,pVScreen->cursorx,localFont[c],pVScreen);
	AdjCurE(pVScreen);
		
}

//在指定位置打印一个点阵字符
int VSPrint(int inty,int intx ,unsigned char *charPix ,VScreen_T *pVScreen){
	int i=0,j=0,offset=0;
	unsigned char mask=0,c=0;
	
	//判断是否超过了虚拟屏幕范围,超出则返回 0
	if((intx>pVScreen->columns)||(inty>pVScreen->rows)||(intx<0||inty<0))
		return 0;
	
	//计算相对位置到intx,inty
	
	intx=intx*FONTH;
	intx+=pVScreen->startx;
	
	inty=inty*FONTV;
	inty+=pVScreen->starty;
	
	//PrintfUartDef("*******startx is %d********\r\n",pVScreen->startx);
	//PrintfUartDef("address of vscreen  is 0x%x\r\n",pVScreen);
	//初始化位选mask,每次选择8位
	mask=0x80;
		
	c=charPix[offset];
	//PrintfUartDef("[%d]c=0x%x\r\n",offset,(int)c);
	for(j=0;j<FONTV;j++){

⌨️ 快捷键说明

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