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

📄 44blcd.c.bak

📁 epson1147 是 240*320 黑白(16级灰度)的液晶配合sw44b0综合测试程序(附送液晶字模提取小程序)
💻 BAK
字号:
#include <string.h>
#include "..\inc\option.h"
#include "..\inc\def.h"
#include "..\inc\44b.h"
#include "..\inc\44blib.h"
#include "..\inc\lcd.h"
#include "..\inc\lcdlib.h"
#include "..\inc\44blcd.h"
#include "..\inc\PLMM.h"

#define BPP 8
#define HEIGHT 240
#define WIDTH 320

void displaylcd(char num);
void clrscreen(void);
void Lcd_MonoInit(void);
void Lcd_kb_MonoInit(void);
int mt0cnt=0,picturenum=0;


/*volatile char which_int=0;*/
void LcdInit(void)
{
  unsigned int i=0,count=0;
  U32  Xall=0,Yall=0;
  int j=0, oldy=0,oldx=0;
  int  xmax=0,xmin=0xffff, ymax=0,ymin=0xffff;
  rPCONC = (rPCONC & (~(3<<16))) |1<<16 ; // pcon8 out
  rPDATC = rPDATC |1<<8 ;    // pdatc8 ==1  display on
  Lcd_MonoInit();    //Lcd_kb_MonoInit();
  //Uart_Printf("LCD DISPLAY\n");
  Uart_Printf("Type any key to display !!!\n");
  clrscreen();
  while(!(Uart_GetKey()))
  { ; }
  displaylcd(0);
  Uart_Printf(" Type any key to exit !!! \n");
  while(!(Uart_GetKey()))
  { ; }
  displaylcd(1);
  }





void Lcd_MonoInit(void)
{
 
      //640*480   1bit/1pixel lcd          //160x240 4bit/1pixel LCD
    #define MVAL_USED 1
     if((U32)frameBuffer16==0)
	{
	  if (( frameBuffer16=(unsigned int (*)[SCR_XSIZE/8])malloc(ARRAY_SIZE_G16))==NULL)
	     {
	        Uart_Printf("ERROR !!!!!!!! NO MEMERY !!!!!!! \n");
	      }
	  else
	       {
	         Uart_Printf("ARRAY_SIZE_g16= %d \n", ARRAY_SIZE_G16);
	        }
         }
      	rLCDCON1=(0)|(1<<1)|(0<<5)|(MVAL_USED<<7)|(0x0<<8)|(0x0<<10)|(CLKVAL_MONO<<12); //CLKVAL_MONO
	    // disable,4B_DUAL_SCAN,WDLY=8clk,WLH=8clk,
	rLCDCON2=(LINEVAL)|(HOZVAL<<10)|(10<<21);  //HOZVAL
	    //LINEBLANK=10 (without any calculation) 
	rLCDSADDR1= (0x2<<27) | ( ((U32)frameBuffer16>>22)<<21 ) | M5D((U32)frameBuffer16>>1);
	    // 16-lever gray  mode , LCDBANK, LCDBASEU
	rLCDSADDR2= M5D (((U32)frameBuffer16+(SCR_XSIZE*(LINEVAL+1))/2)>>1) | (MVAL<<21) |(0<<29);//MVAL
          // 4*SCR_XSIZE*LCD_YSIZE/8
	rLCDSADDR3= (LCD_XSIZE/4) | ( ((SCR_XSIZE-LCD_XSIZE)/4)<<9 );

       rLCDCON3 = 0;
	   // refresh is enable ;
	rLCDCON1=(1)|(1<<1)|(0<<5)|(MVAL_USED<<7)|(0x0<<8)|(0x0<<10)|(CLKVAL_MONO<<12);  //CLKVAL_MONO
	    // enable,(fan xiang), 4B_daul_SCAN,WDLY=8clk,WLH=8clk,MVAL_USED
      // rDP1_2=0;
       rDITHMODE = 0x12210;

} 
//


void displaylcd(char num)
{
    unsigned int *pbuffer,temp_data;
     int i,j=0;
    //clrscreen();
    pbuffer =(U32*) frameBuffer16;
    for(i = 0; i< 38400 ;i++)
      {
        temp_data = (plmmBitmap[i*4] << 24) + (plmmBitmap[i*4+1] << 16) + (plmmBitmap[i*4+2] << 8) +(plmmBitmap[i*4+3]);
        pbuffer[i] = ~temp_data;
      }
}

void clrscreen(void)
{
   unsigned int *pbuffer;
     int i=0;
    pbuffer =(U32*) frameBuffer16;
    for(i = 0; i< 38400 ;i++)
      {
        pbuffer[i] = 0;
      }
 }



⌨️ 快捷键说明

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