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

📄 print_method.c

📁 对pxa255内置lcd控制器编程来实现字符及图像的显示
💻 C
字号:
#define LCD_LCCR0  (*(volatile unsigned long *)(0x44000000))
#define LCD_FDADR0 (*(volatile unsigned long *)(0x44000200))
#define LCD_FSADR0 (*(volatile unsigned long *)(0xa0300004))
#define LCD_LCSR   (*(volatile unsigned long *)(0x44000038))


void screen_clean(int color)
{
 
 long int i,fill_color ;
 i = 0x96000/4;
 fill_color = 0x111100*color;
 for(;i>0;i--) 
  (*(volatile unsigned long int *)(0xa0500000 + i*4)) = fill_color; 
}


void disable_lcd(void)
{
  LCD_LCCR0 = LCD_LCCR0 | 0x0400;
 
}


void enable_lcd(void)
{
  ;LCD_FDADR0 = 0xa0300000;
  ;LCD_FSADR0 = 0xa0500000;
  ;LCD_LCSR = 0;
  LCD_LCCR0 = 0x003008f8;
  LCD_LCCR0 = LCD_LCCR0 | 0x01;
  
}



void lcd_put_pixel(int x,int y,unsigned char c)
{
       long int base_addr;
       base_addr = 0xa0500000; 
    if(x<1280 && y<480)
  		(*((unsigned char *)(base_addr+y*1280+x))) = c;
}





void print_pic(char *pic)
{
 int x,y;
     for(y=0;y<480;y++)
   		for(x=0;x<1280;x++)
    		lcd_put_pixel(x,y,*(pic+y*1280+x));
}    		
 

⌨️ 快捷键说明

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