📄 44bmon-1.c
字号:
void display16samlogo(void)
{
union uni temp;
int i,j,i16,j16,dr,dr1,gray16buff,col;
unsigned int color,re_color;
for (col=15;col>0;col--)
{
color=(col<<28);
re_color=color; //漠扼甫 犁厘傈窍扁困秦
i=3;
j=60;
Delay(6000);
for (dr1=0;dr1<4;dr1++)
{
j16=j;
for (dr=0;dr<64;dr++) //gray16buff俊绰 dot8俺俊 措茄 漠扼 data啊 甸绢啊霸 等促.
{
i16=i*4;
color=re_color;
temp.L32Bbit=frameBuffer[j++][i]; //8档飘父 钎矫
if (temp.L1Bbit.S1Bbit0==0) gray16buff=color; else gray16buff=0x0f0000000;color>>=4;//big endian捞扁 锭巩俊 惑困何磐 钎矫
if (temp.L1Bbit.S1Bbit1==0) gray16buff|=color;else gray16buff|=0x0f000000;color>>=4;
if (temp.L1Bbit.S1Bbit2==0) gray16buff|=color;else gray16buff|=0x00f00000;color>>=4;
if (temp.L1Bbit.S1Bbit3==0) gray16buff|=color;else gray16buff|=0x000f0000;color>>=4;
if (temp.L1Bbit.S1Bbit4==0) gray16buff|=color;else gray16buff|=0x0000f000;color>>=4;
if (temp.L1Bbit.S1Bbit5==0) gray16buff|=color;else gray16buff|=0x00000f00;color>>=4;
if (temp.L1Bbit.S1Bbit6==0) gray16buff|=color;else gray16buff|=0x000000f0;color>>=4;
if (temp.L1Bbit.S1Bbit7==0) gray16buff|=color;else gray16buff|=0x0000000f;
frameBuffer16[j16][i16++]=gray16buff;
gray16buff=0;
color=re_color;
//~16档飘
if (temp.L1Bbit.S1Bbit8==0) gray16buff=color; else gray16buff=0x0f0000000;color>>=4;
if (temp.L1Bbit.S1Bbit9==0) gray16buff|=color; else gray16buff|=0x0f000000;color>>=4;
if (temp.L1Bbit.S1Bbit10==0) gray16buff|=color;else gray16buff|=0x00f00000;color>>=4;
if (temp.L1Bbit.S1Bbit11==0) gray16buff|=color;else gray16buff|=0x000f0000;color>>=4;
if (temp.L1Bbit.S1Bbit12==0) gray16buff|=color;else gray16buff|=0x0000f000;color>>=4;
if (temp.L1Bbit.S1Bbit13==0) gray16buff|=color;else gray16buff|=0x00000f00;color>>=4;
if (temp.L1Bbit.S1Bbit14==0) gray16buff|=color;else gray16buff|=0x000000f0;color>>=4;
if (temp.L1Bbit.S1Bbit15==0) gray16buff|=color;else gray16buff|=0x0000000f;
frameBuffer16[j16][i16++]=gray16buff;
gray16buff=0;
color=re_color;
//~24档飘
if (temp.L1Bbit.S1Bbit16==0) gray16buff=color; else gray16buff=0x0f0000000;color>>=4;
if (temp.L1Bbit.S1Bbit17==0) gray16buff|=color;else gray16buff|=0x0f000000;color>>=4;
if (temp.L1Bbit.S1Bbit18==0) gray16buff|=color;else gray16buff|=0x00f00000;color>>=4;
if (temp.L1Bbit.S1Bbit19==0) gray16buff|=color;else gray16buff|=0x000f0000;color>>=4;
if (temp.L1Bbit.S1Bbit20==0) gray16buff|=color;else gray16buff|=0x0000f000;color>>=4;
if (temp.L1Bbit.S1Bbit21==0) gray16buff|=color;else gray16buff|=0x00000f00;color>>=4;
if (temp.L1Bbit.S1Bbit22==0) gray16buff|=color;else gray16buff|=0x000000f0;color>>=4;
if (temp.L1Bbit.S1Bbit23==0) gray16buff|=color;else gray16buff|=0x0000000f;
frameBuffer16[j16][i16++]=gray16buff;
gray16buff=0;
color=re_color;
//~32档飘
if (temp.L1Bbit.S1Bbit24==0) gray16buff=color; else gray16buff =0x0f0000000;color>>=4;
if (temp.L1Bbit.S1Bbit25==0) gray16buff|=color; else gray16buff|=0x0f000000;color>>=4;
if (temp.L1Bbit.S1Bbit26==0) gray16buff|=color; else gray16buff|=0x00f00000;color>>=4;
if (temp.L1Bbit.S1Bbit27==0) gray16buff|=color; else gray16buff|=0x000f0000;color>>=4;
if (temp.L1Bbit.S1Bbit28==0) gray16buff|=color; else gray16buff|=0x0000f000;color>>=4;
if (temp.L1Bbit.S1Bbit29==0) gray16buff|=color; else gray16buff|=0x00000f00;color>>=4;
if (temp.L1Bbit.S1Bbit30==0) gray16buff|=color; else gray16buff|=0x000000f0;color>>=4;
if (temp.L1Bbit.S1Bbit31==0) gray16buff|=color; else gray16buff|=0x0000000f;
frameBuffer16[j16++][i16]=gray16buff;
gray16buff=0;
}
++i;j-=64;
}
}
//葛畴绰 啊肺10俺 16弊饭捞绰 40俺狼 滚欺
}
void clr16gray(void)
{
int i,j;
for(i=0;i<40;i++)
for(j=0;j<240;j++)
frameBuffer16[j][i]=0;//ffffffff;
}
void Lcd_MonoInit(void)
{
//320x240 1bit/1pixel LCD
int i,j;
if((U32)frameBuffer1==0)
{
frameBuffer1=(unsigned int (*)[SCR_XSIZE/32])malloc(ARRAY_SIZE_MONO);
}
rLCDCON1=(0)|(1<<5)|(MVAL_USED<<7)|(0x3<<8)|(0x3<<10)|(CLKVAL_MONO<<12);
// disable,4B_SNGL_SCAN,WDLY=8clk,WLH=8clk,
rLCDCON2=(LINEVAL)|(HOZVAL<<10)|(10<<21);
//LINEBLANK=10 (without any calculation)
rLCDSADDR1= (0x0<<27) | ( ((U32)frameBuffer1>>22)<<21 ) | M5D((U32)frameBuffer1>>1);
// monochrome, LCDBANK, LCDBASEU
rLCDSADDR2= M5D( (((U32)frameBuffer1+(SCR_XSIZE*LCD_YSIZE/8))>>1) ) | (MVAL<<21);
rLCDSADDR3= (LCD_XSIZE/16) | ( ((SCR_XSIZE-LCD_XSIZE)/16)<<9 );
rLCDCON1=(1)|(1<<5)|(MVAL_USED<<7)|(0x3<<8)|(0x3<<10)|(CLKVAL_MONO<<12);
// enable,4B_SNGL_SCAN,WDLY=8clk,WLH=8clk,
}
void Lcd_16Init(void)
{
if((U32)frameBuffer16==0)
{
frameBuffer16=(unsigned int (*)[SCR_XSIZE/8])malloc(ARRAY_SIZE_G16);
}
rLCDCON1=(0)|(1<<5)|(MVAL_USED<<7)|(0x3<<8)|(0x3<<10)|(CLKVAL_G16<<12);
// disable,4B_SNGL_SCAN,WDLY=8clk,WLH=8clk,
rLCDCON2=(LINEVAL)|(HOZVAL<<10)|(10<<21);
//LINEBLANK=10 (without any calculation)
rLCDSADDR1= (0x2<<27) | ( ((U32)frameBuffer16>>22)<<21 ) | M5D((U32)frameBuffer16>>1);
// 16-gray, LCDBANK, LCDBASEU
rLCDSADDR2= M5D((((U32)frameBuffer16+(SCR_XSIZE*LCD_YSIZE/2))>>1)) | (MVAL<<21);
rLCDSADDR3= (LCD_XSIZE/4) | ( ((SCR_XSIZE-LCD_XSIZE)/4)<<9 );
//The following value has to be changed for better display.
rDITHMODE=0x0;
rDP1_2 =0xa5a5;
rDP4_7 =0xba5da65;
rDP3_5 =0xa5a5f;
rDP2_3 =0xd6b;
rDP5_7 =0xeb7b5ed;
rDP3_4 =0x7dbe;
rDP4_5 =0x7ebdf;
rDP6_7 =0x7fdfbfe;
rLCDCON1=(1)|(1<<5)|(MVAL_USED<<7)|(0x3<<8)|(0x3<<10)|(CLKVAL_G16<<12);
// enable,4B_SNGL_SCAN,WDLY=8clk,WLH=8clk,
}
void displaylcd(void)
{
clrscreen();
print_logo(3,60);
//messageprint Y(0~15):(240)ADDRESS , X(0~9):(320)-ADDRESS
// 技肺 啊肺鉴辑
messageprint("ASCII MODE",1,0);
//messageprint("E-MAIL:",9,1);
//messageprint("punaamu@hitel.net",10,1);
messageprint(" MERITECH HOMEPAGE:",10,0);
messageprint(" www.meritech.co.kr",11,0);
}
void messageprint(char *pmessage,unsigned int j,unsigned int i)
{
char togle=0;
unsigned int framebuff[15],dr;
unsigned short *Startadd;
j*=16;
while (*pmessage!='\0')
{
togle=~togle;
Startadd=(unsigned short*)(START_ASCII_ADDRESS+0x20*(*pmessage++-' '));
if (togle){
for (dr=0;dr<16;dr++) framebuff[dr] = *Startadd++;
}
else{
for (dr=0;dr<16;dr++){
framebuff[dr] |= ((*Startadd++)<<16);
frameBuffer1[j++][i]= ToLittle(framebuff[dr]);
}
j-=16;
i++;
}
}
if (togle){
for (dr=0;dr<16;dr++)frameBuffer1[j++][i]= ToLittle(framebuff[dr]);
}
}
//伙己肺绊 免仿 风凭
void print_logo(int i,int j)//肺绊 免仿 矫累 函荐 i,j
{
int dr,dr1;
unsigned int *plogo;
plogo=(unsigned int*)START_LOGO_ADDRESS;
for (dr1=0;dr1<4;dr1++)
{
for (dr=0;dr<64;dr++)
{
frameBuffer1[j++][i]=ToLittle(*plogo);
plogo+=2;
}
++i;j-=64;
if(dr1%2)plogo--;
else plogo-=64*2-1;
}
}
unsigned ToLittle(unsigned temp1)
{
union uni temp;
unsigned logo;
temp.L32Bbit= temp1;
logo=(temp.L1Bbit.S1Bbit28 << 07 ) | (temp.L1Bbit.S1Bbit29 << 06 ) | (temp.L1Bbit.S1Bbit30 << 05 ) | (temp.L1Bbit.S1Bbit31 << 04 );
logo|=(temp.L1Bbit.S1Bbit24 << 03 ) | (temp.L1Bbit.S1Bbit25 << 02 ) | (temp.L1Bbit.S1Bbit26 << 01 ) | (temp.L1Bbit.S1Bbit27 << 00 );
logo|=(temp.L1Bbit.S1Bbit20 << 15 ) | (temp.L1Bbit.S1Bbit21 << 14 ) | (temp.L1Bbit.S1Bbit22 << 13 ) | (temp.L1Bbit.S1Bbit23 << 12 );
logo|=(temp.L1Bbit.S1Bbit16 << 11 ) | (temp.L1Bbit.S1Bbit17 << 10 ) | (temp.L1Bbit.S1Bbit18 << 9 ) | (temp.L1Bbit.S1Bbit19 << 8 );
logo|=(temp.L1Bbit.S1Bbit12 << 23 ) | (temp.L1Bbit.S1Bbit13 << 22 ) | (temp.L1Bbit.S1Bbit14 << 21 ) | (temp.L1Bbit.S1Bbit15 << 20 );
logo|=(temp.L1Bbit.S1Bbit8 << 19 ) | (temp.L1Bbit.S1Bbit9 << 18 ) | (temp.L1Bbit.S1Bbit10 << 17 ) | (temp.L1Bbit.S1Bbit11 << 16 );
logo|=(temp.L1Bbit.S1Bbit4 << 31 ) | (temp.L1Bbit.S1Bbit5 << 30 ) | (temp.L1Bbit.S1Bbit6 << 29 ) | (temp.L1Bbit.S1Bbit7 << 28 );
logo|=(temp.L1Bbit.S1Bbit0 << 27 ) | (temp.L1Bbit.S1Bbit1 << 26 ) | (temp.L1Bbit.S1Bbit2 << 25 ) | (temp.L1Bbit.S1Bbit3 << 24 );
return (logo);
}
void clrscreen(void)
{
int i,j;
for (i=0;i<10;i++)
for (j=0;j<320;j++)
{
frameBuffer1[j][i]=0;//(0x0FFFFFFFF);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -