1.8寸和2.4寸彩屏TFT-SD例程及资料大全


1.8寸和2.4寸彩屏TFT-SD例程及资料大全 带图片和汉字取模软件
资源截图
代码片段和文件信息
/**********************************************************
*                      *
*    彩屏驱动程序   *
*   *
**********************************************************/

#include 
#include “Lcd.h“
#include “char.h“
#include “chinese.h“

uint colors[]=
{
  0xf8000x07e00x001f0xffe00x00000x07ff0xf81f0xffff
};

/**********************************************************

 延时子函数

**********************************************************/
void delay_ms(uint ms)
{
  unsigned char k;

  while (ms--)
  {
    for (k = 0; k < 228; k++)
      ;
  }
}

/**********************************************************

 写命令与数据子函数

**********************************************************/
void LCD_Write(uchar type uint value)  
{
LCD_CS = 0;
LCD_RS  = type;     // 0: command    1: data

LCD_WR  = 0;
DATA  = (uchar)value;;
LCD_WR  = 1;
LCD_CS = 1;
}

/**********************************************************

 写8位数据子函数

**********************************************************/
/*void LCD_Write_Data8(uchar value)    // color data
{
LCD_CS = 0;
LCD_RS  = 1;
LCD_WR  = 0;
DATA  = value;
LCD_WR  = 1;
    LCD_CS = 1;
}*/


/**********************************************************

 写16位数据子函数

**********************************************************/
void LCD_Wirte_Data16(uint value)    // color data
{
LCD_CS = 0;
    LCD_RS  = 1;
LCD_WR  = 0;
DATA  = (uchar)value;
LCD_WR  = 1;
LCD_WR  = 0;
DATA  = (uchar)(value>>8) ;
LCD_WR  = 1;
LCD_CS = 1;
}

/*********************************************************

 写寄存器子函数

**********************************************************/
void Reg_Write(uint reguint value) 
{
   LCD_Write(TYPE_LCD_COMMANDreg);
   LCD_Write(TYPE_LCD_DATAvalue);
}


/**********************************************************

设置显示窗口子函数

**********************************************************/
void LCD_SetRamAddr(uint xStart uint xEnd uint yStart uint yEnd) 
{
   uint VerPosHorPosStartAddr;

   HorPos    = (uint)(xStart | (xEnd<<8));
   VerPos    = (uint)(yStart | (yEnd<<8));
   StartAddr = (uint)(xStart | (yStart<<8));



    Reg_Write(0x09 xStart);
    Reg_Write(0x10yStart);
    Reg_Write(0x11xEnd);
    Reg_Write(0x12yEnd);

    Reg_Write(0x18 xStart); 
Reg_Write(0x19 yStart); 
    LCD_Write(TYPE_LCD_COMMAND0x22); // 0x22
}


/**********************************************************/
void LCD_init(void)
{ uint num;
Reg_Write(0x00010x0002);  //MODE_SEL1
Reg_Write(0x00020x0012);   //MODE_SEL2
Reg_Write(0x00030x0000);   //MODE_SEL3
Reg_Write(0x00040x0010); //MODE_SEL3
LCD_SetRamAddr(0127 0159); 
for(num=20480;num>0;num--)
    LCD_Wirte_Data16(0xffff);
   
Reg_Write(0x00050x0008);   //VCO_MODE
Reg_Write(0x00070x007f); //VCOMHT_CTRL
Reg_Write(0x00080x0017);   //VCOMLT_CTRL    
Reg_Write(0x00090x0000);   //write S

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    .......      8842  2010-08-29 17:05  温度-时钟综合显示char.h

    .......      9640  2011-02-20 14:23  温度-时钟综合显示chinese.h

    .......     37448  2011-02-20 19:10  温度-时钟综合显示DS1302-DS18B20

    .......      1026  2011-02-20 17:15  温度-时钟综合显示DS1302-DS18B20-TFT.Opt

    .......      2154  2011-02-20 17:06  温度-时钟综合显示DS1302-DS18B20-TFT.Uv2

    .......      1018  2011-02-20 17:13  温度-时钟综合显示DS1302-DS18B20-TFT_Opt.Bak

    .......     16610  2011-02-20 19:10  温度-时钟综合显示DS1302-DS18B20.hex

    .......       106  2011-02-20 19:10  温度-时钟综合显示DS1302-DS18B20.lnp

    .......     38317  2011-02-20 19:10  温度-时钟综合显示DS1302-DS18B20.M51

    .......       168  2011-02-20 19:13  温度-时钟综合显示DS1302-DS18B20.plg

    .......      4345  2011-02-20 16:05  温度-时钟综合显示ds1302.c

    .......      8303  2011-02-20 19:10  温度-时钟综合显示ds1302.LST

    .......      6526  2011-02-20 19:10  温度-时钟综合显示ds1302.OBJ

    .......     37436  2011-02-20 17:05  温度-时钟综合显示IR-TFT

    .......     16610  2011-02-20 17:05  温度-时钟综合显示IR-TFT.hex

    .......        98  2011-02-20 17:05  温度-时钟综合显示IR-TFT.lnp

    .......     38283  2011-02-20 17:05  温度-时钟综合显示IR-TFT.M51

    .......      2249  2011-02-20 17:13  温度-时钟综合显示IR-TFT.Opt

    .......     52500  2011-02-20 17:05  温度-时钟综合显示IR-TFT.plg

    .......      2249  2011-02-20 17:06  温度-时钟综合显示IR-TFT_Opt.Bak

    .......      2130  2010-12-28 22:20  温度-时钟综合显示IR-TFT_Uv2.Bak

    .......      3334  2010-09-02 23:43  温度-时钟综合显示IR.C

    .......        52  2010-09-02 23:01  温度-时钟综合显示IR.H

    .......      6235  2010-09-03 08:00  温度-时钟综合显示IR.LST

    .......      5088  2010-09-03 08:00  温度-时钟综合显示IR.OBJ

    .......      6320  2010-10-01 19:14  温度-时钟综合显示Lcd.c

    .......      1351  2010-08-29 18:03  温度-时钟综合显示Lcd.h

    .......     12246  2011-02-20 19:10  温度-时钟综合显示Lcd.LST

    .......     18678  2011-02-20 19:10  温度-时钟综合显示Lcd.OBJ

    .......      4170  2011-02-20 17:15  温度-时钟综合显示main.c

............此处省略13个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)