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

📄 disp_pic.c

📁 current version V0.2 功能:在LCD液晶屏上显示相关信息
💻 C
字号:
#include  "config.h"

// 声明外部图片数据
extern uint8  gImage_xp[];
// extern unsigned short pic_xp[];
/*
extern uint8  gImage_pic1[];
extern uint8  gImage_pic2[];
extern uint8  gImage_pic3[];
extern uint8  gImage_pic4[];
extern uint8  gImage_pic5[];
extern uint8  gImage_pic6[];
extern uint8  gImage_pic7[];
*/
// 显示xp图片
/*
void  DispXP_Pic(void)
{  uint32  x, y;
   uint32  no;
   uint16  dat;
   
   TftSetWindow(20,50, 20+197,50+263);
   TftSetWrite(20,50);
   no = 0;
   for(y=0; y<264; y++)
   {  for(x=0; x<198; x++)
      {  dat = (gImage_xp[no+1]<<8) | gImage_xp[no];
         TftSendDat(dat);
         no++; 
         no++;         
      }
   }
   
   TftSetWindow(0,0, 239,319);
}
*/

/*/
void  DispXP_Pic(void)
{  uint32  x, y;
   uint32  no;
   uint16  dat;
   
   TftSetWindow(20,50, 20+197,50+263);
   TftSetWrite(20,50);
   no = 0;
   for(y=0; y<264; y++)
   {  for(x=0; x<198; x++)
      {  dat =pic_xp[no+1];
         TftSendDat(dat);
         no++; 
      }
   }
   
   TftSetWindow(0,0, 239,319);
}
//*/

/*
// 显示图片1
void  Disp_Pic1(void)
{  uint32  x, y;
   uint32  no;
   uint16  dat;
   
   TftSetWrite(0,0);
   no = 0;
   for(y=0; y<320; y++)
   {  for(x=0; x<240; x++)
      {  dat = (gImage_pic1[no+1]<<8) | gImage_pic1[no];
         TftSendDat(dat);
         no++; 
         no++;         
      }
   }
}

// 显示图片2
void  Disp_Pic2(void)
{  uint32  x, y;
   uint32  no;
   uint16  dat;
   
   TftSetWrite(0,0);
   no = 0;
   for(y=0; y<320; y++)
   {  for(x=0; x<240; x++)
      {  dat = (gImage_pic2[no+1]<<8) | gImage_pic2[no];
         TftSendDat(dat);
         no++; 
         no++;         
      }
   }
}

// 显示图片3
void  Disp_Pic3(void)
{  uint32  x, y;
   uint32  no;
   uint16  dat;
   
   TftSetWrite(0,0);
   no = 0;
   for(y=0; y<320; y++)
   {  for(x=0; x<240; x++)
      {  dat = (gImage_pic3[no+1]<<8) | gImage_pic3[no];
         TftSendDat(dat);
         no++; 
         no++;         
      }
   }
}



// 显示图片4
void  Disp_Pic4(void)
{  uint32  x, y;
   uint32  no;
   uint16  dat;
   
   TftSetWrite(0,0);
   no = 0;
   for(y=0; y<320; y++)
   {  for(x=0; x<240; x++)
      {  dat = (gImage_pic4[no+1]<<8) | gImage_pic4[no];
         TftSendDat(dat);
         no++; 
         no++;         
      }
   }
}

// 显示图片5
void  Disp_Pic5(void)
{  uint32  x, y;
   uint32  no;
   uint16  dat;
   
   TftSetWrite(0,0);
   no = 0;
   for(y=0; y<320; y++)
   {  for(x=0; x<240; x++)
      {  dat = (gImage_pic5[no+1]<<8) | gImage_pic5[no];
         TftSendDat(dat);
         no++; 
         no++;         
      }
   }
}


// 显示图片6
void  Disp_Pic6(void)
{  uint32  x, y;
   uint32  no;
   uint16  dat;
   
   TftSetWrite(0,0);
   no = 0;
   for(y=0; y<320; y++)
   {  for(x=0; x<240; x++)
      {  dat = (gImage_pic6[no+1]<<8) | gImage_pic6[no];
         TftSendDat(dat);
         no++; 
         no++;         
      }
   }
}

// 显示图片7
void  Disp_Pic7(void)
{  uint32  x, y;
   uint32  no;
   uint16  dat;
   
   TftSetWrite(0,0);
   no = 0;
   for(y=0; y<320; y++)
   {  for(x=0; x<240; x++)
      {  dat = (gImage_pic7[no+1]<<8) | gImage_pic7[no];
         TftSendDat(dat);
         no++; 
         no++;         
      }
   }   
}
*/

// 显示全屏背景色
void  Disp_BKColor(void)
{  uint32  x, y;

   // 填充底色
   TftSetWrite(0,0);
   for(y=0; y<320; y++)
   {  for(x=0; x<240; x++)
      {  TftSendDat(1234);
      }
   }
}

⌨️ 快捷键说明

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