CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Driver control LCD TFT 320QVT ili9341

 
Post new topic   Reply to topic    CCS Forum Index -> Code Library
View previous topic :: View next topic  
Author Message
huynhhai



Joined: 04 Apr 2015
Posts: 39

View user's profile Send private message

Driver control LCD TFT 320QVT ili9341
PostPosted: Wed Apr 06, 2016 8:09 pm     Reply with quote

I really to say lucky,

I write code driver for LCD TFT 320 QVT 9341 already, anyone need to code, please use code below, my Pic is using

tft320qvt_9341.h
Code:

#ifndef __TFT320QVT_9341_H
#define __TFT320QVT_9341_H
 
#define LCD_W 400   
#define LCD_H 240   

//#define  LCD_DataPortH PORT_B   
//#define  LCD_DataPortL PORT_C   

#define LCD_RS    PIN_A0       //
#define LCD_WR    PIN_A1       //
#define LCD_RD    PIN_A2       //
#define LCD_CS    PIN_A3       //   
#define LCD_REST  PIN_A4       //

extern  int16 BACK_COLOR, POINT_COLOR;

void tft320qvt_9341_init(void);
 
void LCD_Clear(int16 Color);
void Address_set(unsigned int16 x1,unsigned int16 y1,unsigned int16 x2,unsigned int16 y2);
void LCD_WR_DATA8(char VH,char VL);
void LCD_WR_DATA(int16 da);
void LCD_WR_REG(int16 da);

void LCD_DrawPoint(int16 x,int16 y);
void LCD_DrawPoint_big(int16 x,int16 y);
int16 LCD_ReadPoint(int16 x,int16 y);
void Draw_Circle(int16 x0,int16 y0,int8 r);
void LCD_DrawLine(int16 x1, int16 y1, int16 x2, int16 y2);
void LCD_DrawRectangle(int16 x1, int16 y1, int16 x2, int16 y2);         
void LCD_Fill(int16 xsta,int16 ysta,int16 xend,int16 yend,int16 color);

void LCD_ShowChar(int16 x,int16 y,int8 num,int8 mode);
void LCD_ShowNum(int16 x,int16 y,int32 num,int8 len);
void LCD_Show2Num(int16 x,int16 y,int16 num,int8 len);

void LCD_ShowString(int16 x,int16 y,int8 *p); 

#define WHITE             0xFFFF
#define BLACK             0x0000     
#define BLUE              0x001F 
#define BRED              0XF81F
#define GRED              0XFFE0
#define GBLUE             0X07FF
#define RED               0xF800
#define MAGENTA           0xF81F
#define GREEN             0x07E0
#define CYAN              0x7FFF
#define YELLOW            0xFFE0
#define BROWN             0XBC40
#define BRRED             0XFC07
#define GRAY              0X8430
#define DARKBLUE          0X01CF   
#define LIGHTBLUE         0X7D7C   
#define GRAYBLUE          0X5458
#define LIGHTGREEN        0X841F
#define LGRAY             0XC618
#define LGRAYBLUE         0XA651
#define LBBLUE            0X2B12

#endif 

tft320qvt_9341.c
Code:

#include <tft320qvt_9341.h>

/* 
RS-P3^5;    WR-P3^6;   RD-P3^7;   CS-P1^0;   REST-P1^2;
DB0-DB7 P0^0-P0^7;  DB8-DB15 P2^0-P2^7;
T_CLK-P1^7;  T_CS-P1^4;  T_DIN-P3^0;  T_OUT-P3^1;  T_IRQ-P3^4;
*/
int16 BACK_COLOR, POINT_COLOR;
void LCD_Writ_Bus(char VH,char VL) 
{
   output_b(VH); 
   //LCD_DataPortH=VH; 
   output_c(VL);
   //LCD_DataPortL=VL;     
   output_low(LCD_WR);
   output_high(LCD_WR);
}
//-----------------------------------------------------------------------------
void LCD_WR_DATA8(char VH,char VL)
{
    output_high(LCD_RS);
    LCD_Writ_Bus(VH,VL);

//-----------------------------------------------------------------------------
 void LCD_WR_DATA(int16 da)
{
    output_high(LCD_RS);
    LCD_Writ_Bus(da>>8,da);
}     
//-----------------------------------------------------------------------------
void LCD_WR_REG(int16 da)   
{   
   output_low(LCD_RS);
   LCD_Writ_Bus(da>>8,da);
}
//-----------------------------------------------------------------------------
 void LCD_WR_REG_DATA(int16 reg,int16 da)
{
   LCD_WR_REG(reg);
   LCD_WR_DATA(da);
}
//-----------------------------------------------------------------------------
void Address_set(unsigned int16 x1,unsigned int16 y1,unsigned int16 x2,unsigned int16 y2)
{
   LCD_WR_REG(0x2A);
   LCD_WR_DATA(x1>>8);
   LCD_WR_DATA(x1);
   LCD_WR_DATA(x2>>8);
   LCD_WR_DATA(x2);
 
   LCD_WR_REG(0x2B);
   LCD_WR_DATA(y1>>8);
   LCD_WR_DATA(y1);
   LCD_WR_DATA(y2>>8);
   LCD_WR_DATA(y2);   
   LCD_WR_REG(0x2c);                                   
}
//-----------------------------------------------------------------------------
void tft320qvt_9341_Init(void)
{
output_high(LCD_CS);
if(input(LCD_CS)==0)
{
   LCD_WR_REG_DATA(0,0);
   LCD_ShowNum(0,0,0,0);
   LCD_Show2Num(0,0,0,0);
   LCD_DrawPoint_big(0,0);
   LCD_DrawRectangle(0,0,0,0);
   Draw_Circle(0,0,0);
  }     
   output_high(LCD_RD);
   output_high(LCD_WR);
   output_low(LCD_REST);
   delay_ms(20);   
   output_high(LCD_REST);   
   delay_ms(20);   
   output_low(LCD_CS);
//-----------------------------------------------------------------------------
    //************* Start Initial Sequence **********//
   LCD_WR_REG(0xcf);
   LCD_WR_DATA(0x00);
   LCD_WR_DATA(0xc1);
   LCD_WR_DATA(0x30);
   
   LCD_WR_REG(0xed);
   LCD_WR_DATA(0x64);
   LCD_WR_DATA(0x03);
   LCD_WR_DATA(0x12);
   LCD_WR_DATA(0x81);
   
   LCD_WR_REG(0xcb);
   LCD_WR_DATA(0x39);
   LCD_WR_DATA(0x2c);
   LCD_WR_DATA(0x00);
   LCD_WR_DATA(0x34);
   LCD_WR_DATA(0x02);
   
   LCD_WR_REG(0xea);
   LCD_WR_DATA(0x00);
   LCD_WR_DATA(0x00);
   
   LCD_WR_REG(0xe8);
   LCD_WR_DATA(0x85);
   LCD_WR_DATA(0x10);
   LCD_WR_DATA(0x79);
   
   LCD_WR_REG(0xC0); //Power control
   LCD_WR_DATA(0x23); //VRH[5:0]
   
   LCD_WR_REG(0xC1); //Power control
   LCD_WR_DATA(0x11); //SAP[2:0];BT[3:0]
   
   LCD_WR_REG(0xC2);
   LCD_WR_DATA(0x11);
   
   LCD_WR_REG(0xC5); //VCM control
   LCD_WR_DATA(0x3d);
   LCD_WR_DATA(0x30);
   
   LCD_WR_REG(0xc7);
   LCD_WR_DATA(0xaa);
   
   LCD_WR_REG(0x3A);
   LCD_WR_DATA(0x55);
   
   LCD_WR_REG(0x36); // Memory Access Control
   LCD_WR_DATA(0x08);
   
   LCD_WR_REG(0xB1); // Frame Rate Control
   LCD_WR_DATA(0x00);
   LCD_WR_DATA(0x11);
   
   LCD_WR_REG(0xB6); // Display Function Control
   LCD_WR_DATA(0x0a);
   LCD_WR_DATA(0xa2);
   
   LCD_WR_REG(0xF2); // 3Gamma Function Disable
   LCD_WR_DATA(0x00);
   
   LCD_WR_REG(0xF7);
   LCD_WR_DATA(0x20);
   
   LCD_WR_REG(0xF1);
   LCD_WR_DATA(0x01);
   LCD_WR_DATA(0x30);
   
   LCD_WR_REG(0x26); //Gamma curve selected
   LCD_WR_DATA(0x01);
   
   LCD_WR_REG(0xE0); //Set Gamma
   LCD_WR_DATA(0x0f);
   LCD_WR_DATA(0x3f);
   LCD_WR_DATA(0x2f);
   LCD_WR_DATA(0x0c);
   LCD_WR_DATA(0x10);
   LCD_WR_DATA(0x0a);
   LCD_WR_DATA(0x53);
   LCD_WR_DATA(0xd5);
   LCD_WR_DATA(0x40);
   LCD_WR_DATA(0x0a);
   LCD_WR_DATA(0x13);
   LCD_WR_DATA(0x03);
   LCD_WR_DATA(0x08);
   LCD_WR_DATA(0x03);
   LCD_WR_DATA(0x00);
   
   LCD_WR_REG(0xE1); //Set Gamma
   LCD_WR_DATA(0x00);
   LCD_WR_DATA(0x00);
   LCD_WR_DATA(0x10);
   LCD_WR_DATA(0x03);
   LCD_WR_DATA(0x0f);
   LCD_WR_DATA(0x05);
   LCD_WR_DATA(0x2c);
   LCD_WR_DATA(0xa2);
   LCD_WR_DATA(0x3f);
   LCD_WR_DATA(0x05);
   LCD_WR_DATA(0x0e);
   LCD_WR_DATA(0x0c);
   LCD_WR_DATA(0x37);
   LCD_WR_DATA(0x3c);
   LCD_WR_DATA(0x0F);
   LCD_WR_REG(0x11); //Exit Sleep
   delay_ms(80);
   LCD_WR_REG(0x29); //display on
   }
//-----------------------------------------------------------------------------
void LCD_Clear(int16 Color)
{
   int8 VH,VL;
   int16 i,j;
   VH=Color>>8;
   VL=Color;   
   Address_set(0,0,LCD_W-1,LCD_H-1);
    for(i=0;i<LCD_W;i++)
    {
     for (j=0;j<LCD_H;j++)
         {
            LCD_WR_DATA8(VH,VL);
       }

     }
}
//-----------------------------------------------------------------------------
void showhanzi(unsigned int16 x,unsigned int16 y,unsigned char index)   

    unsigned char i,j;
    unsigned char *temp=hanzi;
    Address_set(x,y,x+31,y+31);
   temp+=index*128;   
   for(j=0;j<128;j++)
   {
      for(i=0;i<8;i++)
      {           
          if((*temp&(1<<i))!=0)
         {
            LCD_WR_DATA(POINT_COLOR);
         }
         else
         {
            LCD_WR_DATA(BACK_COLOR);
         }   
      }
      temp++;
    }
}
//-----------------------------------------------------------------------------
//POINT_COLOR:
void LCD_DrawPoint(int16 x,int16 y)
{
   Address_set(x,y,x,y);
   LCD_WR_DATA(POINT_COLOR);       
}   


//-----------------------------------------------------------------------------
//POINT_COLOR:
void LCD_DrawPoint_big(int16 x,int16 y)
{
   LCD_Fill(x-1,y-1,x+1,y+1,POINT_COLOR);
}
//-----------------------------------------------------------------------------
//  (xend-xsta)*(yend-ysta)
void LCD_Fill(int16 xsta,int16 ysta,int16 xend,int16 yend,int16 color)
{         
   int16 i,j;
   Address_set(xsta,ysta,xend,yend);     
   for(i=ysta;i<=yend;i++)
   {                                                 
      for(j=xsta;j<=xend;j++)LCD_WR_DATA(color); 
   }                         

//-----------------------------------------------------------------------------
//x1,y1
//x2,y2
void LCD_DrawLine(int16 x1, int16 y1, int16 x2, int16 y2)
{
   int16 t;
   int16 xerr=0,yerr=0,delta_x,delta_y,distance;
   int16 incx,incy,uRow,uCol;

   delta_x=x2-x1;
   delta_y=y2-y1;
   uRow=x1;
   uCol=y1;
   if(delta_x>0)incx=1;
   else if(delta_x==0)incx=0;
   else {incx=-1;delta_x=-delta_x;}
   if(delta_y>0)incy=1;
   else if(delta_y==0)incy=0;
   else{incy=-1;delta_y=-delta_y;}
   if( delta_x>delta_y)distance=delta_x;
   else distance=delta_y;
   for(t=0;t<=distance+1;t++ )
   { 
      LCD_DrawPoint(uRow,uCol);
      xerr+=delta_x ;
      yerr+=delta_y ;
      if(xerr>distance)
      {
         xerr-=distance;
         uRow+=incx;
      }
      if(yerr>distance)
      {
         yerr-=distance;
         uCol+=incy;
      }
   } 
}   
//-----------------------------------------------------------------------------
void LCD_DrawRectangle(int16 x1, int16 y1, int16 x2, int16 y2)
{
   LCD_DrawLine(x1,y1,x2,y1);
   LCD_DrawLine(x1,y1,x1,y2);
   LCD_DrawLine(x1,y2,x2,y2);
   LCD_DrawLine(x2,y1,x2,y2);
}
//-----------------------------------------------------------------------------
void Draw_Circle(int16 x0,int16 y0,int8 r)
{
   int16 a,b;
   signed int16 di;
   a=0;b=r;     
   di=3-(r<<1);           
   while(a<=b)
   {
      LCD_DrawPoint(x0-b,y0-a);             //3           
      LCD_DrawPoint(x0+b,y0-a);             //0           
      LCD_DrawPoint(x0-a,y0+b);             //1       
      LCD_DrawPoint(x0-b,y0-a);             //7           
      LCD_DrawPoint(x0-a,y0-b);             //2             
      LCD_DrawPoint(x0+b,y0+a);             //4               
      LCD_DrawPoint(x0+a,y0-b);             //5
      LCD_DrawPoint(x0+a,y0+b);             //6
      LCD_DrawPoint(x0-b,y0+a);             
      a++;   
      if(di<0)di +=4*a+6;     
      else
      {
         di+=10+4*(a-b);   
         b--;
      }
      LCD_DrawPoint(x0+a,y0+b);
   }
}
//-----------------------------------------------------------------------------
void LCD_ShowChar(int16 x,int16 y,int8 num,int8 mode)
{
    int8 temp;
    int8 pos,t;
    int16 x0=x;
    int16 colortemp=POINT_COLOR;     
    if(x>LCD_W-16||y>LCD_H-16)return;             
   num=num-' ';
   Address_set(x,y,x+8-1,y+16-1);
   if(!mode)
   {
      for(pos=0;pos<16;pos++)
      {
         temp=asc2_1608[(int16)num*16+pos];   
         for(t=0;t<8;t++)
          {                 
              if(temp&0x01)POINT_COLOR=colortemp;
            else POINT_COLOR=BACK_COLOR;
            LCD_WR_DATA(POINT_COLOR);   
            temp>>=1;
            x++;
          }
         x=x0;
         y++;
      }   
   }else
   {
      for(pos=0;pos<16;pos++)
      {
          temp=asc2_1608[(int16)num*16+pos];       
         for(t=0;t<8;t++)
          {                 
              if(temp&0x01)LCD_DrawPoint(x+t,y+pos); 
              temp>>=1;
          }
      }
   }
   POINT_COLOR=colortemp;                     
}   
//-----------------------------------------------------------------------------
int32 mypow(int8 m,int8 n)
{
   int32 result=1;   
   while(n--)result*=m;   
   return result;
}         
//-----------------------------------------------------------------------------
//num:(0~4294967295);   
void LCD_ShowNum(int16 x,int16 y,int32 num,int8 len)
{           
   int8 t,temp;
   int8 enshow=0;
   num=(int16)num;
   for(t=0;t<len;t++)
   {
      temp=(num/mypow(10,len-t-1))%10;
      if(enshow==0&&t<(len-1))
      {
         if(temp==0)
         {
            LCD_ShowChar(x+8*t,y,' ',0);
            continue;
         }else enshow=1;
           
      }
       LCD_ShowChar(x+8*t,y,temp+48,0);
   }
}
//-----------------------------------------------------------------------------
//num: (0~99);   
void LCD_Show2Num(int16 x,int16 y,int16 num,int8 len)
{           
   int8 t,temp;                     
   for(t=0;t<len;t++)
   {
      temp=(num/mypow(10,len-t-1))%10;
       LCD_ShowChar(x+8*t,y,temp+'0',0);
   }
}
//-----------------------------------------------------------------------------
void LCD_ShowString(int16 x,int16 y,int8 *p)
{         
    while(*p!='\0')
    {       
        if(x>LCD_W-16){x=0;y+=16;}
        if(y>LCD_H-16){y=x=0;LCD_Clear(RED);}
        LCD_ShowChar(x,y,*p,0);
        x+=8;
        p++;
    } 
}
cvargcal



Joined: 17 Feb 2015
Posts: 134

View user's profile Send private message

Re: Driver control LCD TFT 320QVT ili9341
PostPosted: Tue Sep 06, 2016 8:13 am     Reply with quote

huynhhai wrote:
I really to say lucky,

.....
}[/code]


Hi, Can you share someone example, please?
Thanks
huynhhai



Joined: 04 Apr 2015
Posts: 39

View user's profile Send private message

PostPosted: Sat Sep 09, 2017 9:43 am     Reply with quote

Hi everyone,

i used PIC18F4620, hardware as config in software

Code:

main.h  file
//--------------------------------
#include <18F4620.h>
//STATUS = FD8H
#device PASS_STRINGS=IN_RAM
#device ADC=10
#use delay(clock=32MHz,crystal=8MHz)
#bit carry_Flag = 0xFD8.0

/*==> trong file main.c (khai bao phim nhan)
#define key1 PIN_E0    //khai bao lai phim
#define key2 PIN_E1    //khai bao lai phim
#define key3 PIN_E2    //khai bao lai phim
*/

/*==> trong file touch7843.h (khai bao spi cho cam ung)
#define DCLK    PIN_D0 
#define CS      PIN_D1
#define DIN     PIN_D2 
#define DOUT    PIN_D3                                                                     
#define Penirq  PIN_D4
*/

/*==> trong file tft320qvt_9341.h (khai bao giao tiep TFTLCD)
#define  LCD_DataPortH PORT_B   //khai bao lai port 
#define  LCD_DataPortL P0RT_C   //khai bao lai port

#define LCD_RS    PIN_A0       //
#define LCD_WR    PIN_A1       //
#define LCD_RD    PIN_A2       //
#define LCD_CS    PIN_A3       //   
#define LCD_REST  PIN_A4       //
*/

//----------------------------------------
main.c file


Code:

#include <main.h>
#include <tft320qvt_9341.c>
#include <fonts_tft320.h>
#include <touch7843.c>

#define key1 PIN_E0    //khai bao lai phim
#define key2 PIN_E1    //khai bao lai phim
#define key3 PIN_E2    //khai bao lai phim

int16 thermal;
float result_thermal,testthu=10.5;

//-----------------------------------------------------------------------------
int8 jiance()
{
   if (tpstate()==0)
    {
     LCD_Clear(WHITE);
      BACK_COLOR=WHITE;
      POINT_COLOR=RED;
      point();
      return 1;
    }   
   if(input(key1)==0)
      {
      Touch_Adjust();
      return 1;
      }
    if(input(key2)==0)
      {
       LCD_Clear(RED);
       delay_ms(500);
       LCD_Clear(GREEN);
       delay_ms(500);
       LCD_Clear(BLUE);
       delay_ms(500);
       LCD_Clear(YELLOW);
       delay_ms(500);
       LCD_Clear(MAGENTA);
       delay_ms(500);
       LCD_Clear(CYAN );
       delay_ms(500);
       LCD_Clear(BROWN );
       delay_ms(500);
       return 1;
      }
      return 0;
}
//-----------------------------------------------------------------------------
void info()
{   
   int16 lx,ly;
   LCD_Clear(WHITE);
   BACK_COLOR=WHITE;
   POINT_COLOR=RED;   
   LCD_ShowString(10,35,"PIC18F4620 - LCDTFT 320QVT");
   POINT_COLOR=BLUE;   
   LCD_ShowString(10,55,"LCD_W:");   
   LCD_ShowNum(70,55,LCD_W,3);
   LCD_ShowString(110,55,"LCD_H:");
   LCD_ShowNum(160,55,LCD_H,3);
   lx=10;ly=75;   
    POINT_COLOR=MAGENTA ;   
   LCD_ShowString(lx,ly,"VX:");lx+=40;
   LCD_ShowNum(lx,ly,vx,5);
   lx+=60;
   LCD_ShowString(lx,ly,"Vy:");lx+=40;
   LCD_ShowNum(lx,ly,vy,5);
   lx=10;ly=95;
   LCD_ShowString(lx,ly,"CHX:");lx+=40;
   LCD_ShowNum(lx,ly,chx,5);
   lx+=60;
   LCD_ShowString(lx,ly,"CHY:");lx+=40;
   LCD_ShowNum(lx,ly,chy,5);
   lx+=200;
   LCD_ShowString(lx,ly,"Designed by huynhhai");
   
}
//-----------------------------------------------------------------------------
void xianshi()
{   
   int16 lx,ly;
   BACK_COLOR=WHITE;
   POINT_COLOR=RED;   
   //showhanzi(10,0,0);
   //showhanzi(45,0,1);
    LCD_ShowString(10,35,"http://ttmcu.taobao.com");
   LCD_ShowString(10,55,"LCD_W:");   LCD_ShowNum(70,55,thermal,3);
   LCD_ShowString(110,55,"LCD_H:");LCD_ShowNum(160,55,LCD_H,3);   
   lx=10;ly=75;         
   LCD_ShowString(lx,ly,"VX:");lx+=40;LCD_ShowNum(lx,ly,vx,5);               
   lx+=60;
   LCD_ShowString(lx,ly,"Vy:");lx+=40;LCD_ShowNum(lx,ly,vy,5);               
   lx=10;ly=95;
   LCD_ShowString(lx,ly,"CHX:");lx+=40;LCD_ShowNum(lx,ly,chx,5);               
   lx+=60;
   LCD_ShowString(lx,ly,"CHY:");lx+=40;LCD_ShowNum(lx,ly,chy,5);
}
//-----------------------------------------------------------------------------
void showimage() //ÏÔʾ40*40ͼƬ
{
  int16 i,j,k;
   LCD_Clear(WHITE); //ÇåÆÁ 
   for(k=3;k<8;k++)
   {
         for(j=0;j<6;j++)
      {   
         Address_set(40*j,40*k,40*j+39,40*k+39);      //×ø±êÉèÖÃ
          for(i=0;i<1600;i++)
          {         
               LCD_WR_DATA8(image[i*2+1],image[i*2]);    //·¢ËÍÑÕÉ«Êý¾ÝΪÌá¸ßËٶȸß8λµÍ8λ·Ö±ð´«µÝ                       
          }   
       }
   }           
}
//-----------------------------------------------------------------------------
void main()
{
   spistar();
   tft320qvt_9341_Init();
   LCD_Clear(WHITE);
     BACK_COLOR=WHITE;
   POINT_COLOR=RED; 

   while(true)
   {
        if(jiance())
       {   
         showimage();
         delay_ms(5000);
       }
   }
   
}



font for LCD
///---------------------------------
fonts_tft320.h file


Code:

#ifndef __FONTS_TFT320_H
#define __FONTS_TFT320_H

const unsigned char image[]={ /* 0X00,0X10,0X28,0X00,0X28,0X00,0X01,0X1B,*/
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0X7D,0XEF,
0XBA,0XD6,0XB6,0XB5,0XF3,0X9C,0XB2,0X94,0XB3,0X9C,0XB2,0X94,0X34,0XA5,0XF7,0XBD,
0XFB,0XDE,0X7D,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
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X21,0X86,0X29,0X86,0X41,0X04,0X99,
0X40,0XE8,0X41,0XF8,0X86,0XF9,0XCB,0XFA,0X49,0XFA,0X82,0XF8,0X00,0XF8,0X00,0XF0,
0X00,0XE8,0X41,0XD8,0X41,0XD0,0X41,0XC0,0X41,0XC0,0X41,0XC0,0X41,0XC0,0X41,0XC8,
0X00,0XD0,0X00,0XE0,0X00,0XE0,0X00,0XD8,0X00,0XD0,0X00,0XB8,0X00,0XA8,0X41,0X88,
0X82,0X48,0X82,0X10,0X82,0X10,0X00,0X00,0X45,0X29,0X79,0XCE,0XFF,0XFF,0XFF,0XFF,
0XBE,0XF7,0XF3,0X9C,0X82,0X10,0XC3,0X18,0X45,0X29,0X86,0X31,0XC7,0X31,0X30,0X7C,
0XF3,0XDC,0X86,0XE1,0X00,0XF0,0X00,0XF8,0X41,0XF8,0X41,0XF8,0X00,0XF8,0X00,0XF8,
0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,
0X00,0XE8,0X00,0XE0,0X00,0XE0,0X00,0XD8,0X00,0XC8,0X41,0XA0,0X8A,0X9A,0X0C,0X63,
0X04,0X11,0X82,0X10,0X82,0X10,0X41,0X08,0X00,0X00,0X4D,0X6B,0X7D,0XEF,0XFF,0XFF,
0XFB,0XDE,0X08,0X42,0X42,0X10,0X45,0X29,0X86,0X31,0X86,0X31,0X49,0X4A,0X38,0XBE,
0XFF,0XFF,0X38,0XD6,0X86,0XA9,0X00,0XC8,0X00,0XE0,0X00,0XF0,0X00,0XF8,0X00,0XF8,
0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF8,0X00,0XF0,0X00,0XF0,
0X00,0XE8,0X00,0XE0,0X00,0XD0,0XC3,0X98,0X8A,0X8A,0XB2,0XA4,0XBA,0XC6,0XF7,0XB5,
0X08,0X42,0X41,0X08,0X82,0X10,0X41,0X08,0X00,0X00,0X45,0X29,0X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F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X3C,0XDF,0X38,0XBE,
0X75,0XB5,0X33,0XA5,0X33,0XA5,0XF3,0X9C,0XF3,0X9C,0XF3,0X9C,0XF3,0X94,0XF3,0X9C,
0X35,0XA5,0XF8,0XBD,0XFB,0XDE,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X7E,0XEF,
0XBB,0XD6,0XF8,0XBD,0XB6,0XAD,0X75,0XAD,0X34,0XA5,0X33,0X9D,0X34,0X9D,0X35,0XA5,
0XB7,0XAD,0X79,0XC6,0X3C,0XE7,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF
};
//-----------------------------------------------------------------------------
const char hanzi[]={           
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0xFE,0xFF,0x01,
0x00,0xFE,0xFF,0x01,0x00,0x06,0xC0,0x00,0x00,0x06,0xC0,0x00,0x00,0x06,0xC0,0x00,
0x00,0xFE,0xFF,0x00,0x00,0x06,0xC0,0x00,0x00,0x06,0xC0,0x00,0x00,0x06,0xC0,0x00,
0x00,0xFE,0xFF,0x00,0x00,0x06,0xC0,0x00,0x00,0x06,0xC0,0x00,0x00,0x02,0x00,0x00,
0x30,0x30,0x0C,0x1C,0xF0,0x7F,0xFC,0x3F,0x30,0x30,0x0C,0x1C,0x30,0x30,0x0C,0x1C,
0x30,0x30,0x0C,0x1C,0x30,0x30,0x0C,0x1C,0xF0,0x3F,0xFC,0x1F,0x30,0x30,0x0C,0x1C,
0x30,0x30,0x0C,0x1C,0x30,0x30,0x0C,0x1C,0x30,0x30,0x0C,0x1C,0xF0,0x3F,0xFC,0x1F,
0xF0,0x3F,0xFC,0x1F,0x30,0x30,0x0C,0x1C,0x30,0x10,0x04,0x0C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x08,0x08,0xC0,0xF1,0xFF,0x1F,
0xC0,0xF0,0xFF,0x1F,0xC0,0x48,0x4C,0x1C,0xC4,0xDC,0xCC,0x1D,0xCC,0xDC,0x8D,0x1D,
0xDC,0x8E,0x8D,0x1D,0xD8,0x06,0x0E,0x1F,0xF8,0xC3,0xEF,0x1D,0xF8,0xF1,0xEC,0x1C,
0xD0,0x60,0x1D,0x1C,0xC0,0x1C,0x77,0x0C,0xFE,0x9F,0xE7,0x00,0x34,0x83,0xE3,0x0C,
0x30,0xC3,0xFF,0x1F,0x30,0xC3,0x61,0x00,0x30,0xE3,0x61,0x00,0x30,0xE3,0x61,0x06,
0x30,0xF3,0xFF,0x0F,0x30,0xDB,0x61,0x00,0x30,0xFB,0x61,0x04,0x38,0xDB,0x61,0x0E,
0x18,0xCF,0xFF,0x0F,0x18,0xC7,0x61,0x00,0x98,0xC7,0x61,0x00,0x0C,0xC3,0x61,0x38,
0x04,0xC2,0xFF,0x3F,0x06,0xC0,0x01,0x00,0x02,0xC0,0x01,0x00,0x00,0x00,0x00,0x00
};

//-----------------------------------------------------------------------------
const unsigned char  asc2_1608[1520]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x18,0x18,0x00,0x00,
0x00,0x48,0x6C,0x24,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x24,0x24,0x24,0x7F,0x12,0x12,0x12,0x7F,0x12,0x12,0x12,0x00,0x00,
0x00,0x00,0x08,0x1C,0x2A,0x2A,0x0A,0x0C,0x18,0x28,0x28,0x2A,0x2A,0x1C,0x08,0x08,
0x00,0x00,0x00,0x22,0x25,0x15,0x15,0x15,0x2A,0x58,0x54,0x54,0x54,0x22,0x00,0x00,
0x00,0x00,0x00,0x0C,0x12,0x12,0x12,0x0A,0x76,0x25,0x29,0x11,0x91,0x6E,0x00,0x00,
0x00,0x06,0x06,0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x40,0x20,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x10,0x20,0x40,0x00,
0x00,0x02,0x04,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x08,0x04,0x02,0x00,
0x00,0x00,0x00,0x00,0x08,0x08,0x6B,0x1C,0x1C,0x6B,0x08,0x08,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x7F,0x08,0x08,0x08,0x08,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x06,0x04,0x03,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x06,0x00,0x00,
0x00,0x00,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x02,0x02,0x00,
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00,
0x00,0x00,0x00,0x08,0x0E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00,
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x20,0x20,0x10,0x08,0x04,0x42,0x7E,0x00,0x00,
0x00,0x00,0x00,0x3C,0x42,0x42,0x20,0x18,0x20,0x40,0x40,0x42,0x22,0x1C,0x00,0x00,
0x00,0x00,0x00,0x20,0x30,0x28,0x24,0x24,0x22,0x22,0x7E,0x20,0x20,0x78,0x00,0x00,
0x00,0x00,0x00,0x7E,0x02,0x02,0x02,0x1A,0x26,0x40,0x40,0x42,0x22,0x1C,0x00,0x00,
0x00,0x00,0x00,0x38,0x24,0x02,0x02,0x1A,0x26,0x42,0x42,0x42,0x24,0x18,0x00,0x00,
0x00,0x00,0x00,0x7E,0x22,0x22,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x3C,0x00,0x00,
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x64,0x58,0x40,0x40,0x24,0x1C,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x04,
0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x20,0x40,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x02,0x00,0x00,
0x00,0x00,0x00,0x3C,0x42,0x42,0x46,0x40,0x20,0x10,0x10,0x00,0x18,0x18,0x00,0x00,
0x00,0x00,0x00,0x1C,0x22,0x5A,0x55,0x55,0x55,0x55,0x2D,0x42,0x22,0x1C,0x00,0x00,
0x00,0x00,0x00,0x08,0x08,0x18,0x14,0x14,0x24,0x3C,0x22,0x42,0x42,0xE7,0x00,0x00,
0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x1E,0x22,0x42,0x42,0x42,0x22,0x1F,0x00,0x00,
0x00,0x00,0x00,0x7C,0x42,0x42,0x01,0x01,0x01,0x01,0x01,0x42,0x22,0x1C,0x00,0x00,
0x00,0x00,0x00,0x1F,0x22,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x22,0x1F,0x00,0x00,
0x00,0x00,0x00,0x3F,0x42,0x12,0x12,0x1E,0x12,0x12,0x02,0x42,0x42,0x3F,0x00,0x00,
0x00,0x00,0x00,0x3F,0x42,0x12,0x12,0x1E,0x12,0x12,0x02,0x02,0x02,0x07,0x00,0x00,
0x00,0x00,0x00,0x3C,0x22,0x22,0x01,0x01,0x01,0x71,0x21,0x22,0x22,0x1C,0x00,0x00,
0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0xE7,0x00,0x00,
0x00,0x00,0x00,0x3E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00,
0x00,0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x11,0x0F,
0x00,0x00,0x00,0x77,0x22,0x12,0x0A,0x0E,0x0A,0x12,0x12,0x22,0x22,0x77,0x00,0x00,
0x00,0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x42,0x7F,0x00,0x00,
0x00,0x00,0x00,0x77,0x36,0x36,0x36,0x36,0x2A,0x2A,0x2A,0x2A,0x2A,0x6B,0x00,0x00,
0x00,0x00,0x00,0xE3,0x46,0x46,0x4A,0x4A,0x52,0x52,0x52,0x62,0x62,0x47,0x00,0x00,
0x00,0x00,0x00,0x1C,0x22,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x22,0x1C,0x00,0x00,
0x00,0x00,0x00,0x3F,0x42,0x42,0x42,0x42,0x3E,0x02,0x02,0x02,0x02,0x07,0x00,0x00,
0x00,0x00,0x00,0x1C,0x22,0x41,0x41,0x41,0x41,0x41,0x4D,0x53,0x32,0x1C,0x60,0x00,
0x00,0x00,0x00,0x3F,0x42,0x42,0x42,0x3E,0x12,0x12,0x22,0x22,0x42,0xC7,0x00,0x00,
0x00,0x00,0x00,0x7C,0x42,0x42,0x02,0x04,0x18,0x20,0x40,0x42,0x42,0x3E,0x00,0x00,
0x00,0x00,0x00,0x7F,0x49,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,
0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,
0x00,0x00,0x00,0xE7,0x42,0x42,0x22,0x24,0x24,0x14,0x14,0x18,0x08,0x08,0x00,0x00,
0x00,0x00,0x00,0x6B,0x49,0x49,0x49,0x49,0x55,0x55,0x36,0x22,0x22,0x22,0x00,0x00,
0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x18,0x18,0x18,0x24,0x24,0x42,0xE7,0x00,0x00,
0x00,0x00,0x00,0x77,0x22,0x22,0x14,0x14,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,
0x00,0x00,0x00,0x7E,0x21,0x20,0x10,0x10,0x08,0x04,0x04,0x42,0x42,0x3F,0x00,0x00,
0x00,0x78,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x78,0x00,
0x00,0x00,0x02,0x02,0x04,0x04,0x08,0x08,0x08,0x10,0x10,0x20,0x20,0x20,0x40,0x40,
0x00,0x1E,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1E,0x00,
0x00,0x38,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,
0x00,0x06,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x78,0x44,0x42,0x42,0xFC,0x00,0x00,
0x00,0x00,0x00,0x03,0x02,0x02,0x02,0x1A,0x26,0x42,0x42,0x42,0x26,0x1A,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x02,0x02,0x02,0x44,0x38,0x00,0x00,
0x00,0x00,0x00,0x60,0x40,0x40,0x40,0x78,0x44,0x42,0x42,0x42,0x64,0xD8,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x7E,0x02,0x02,0x42,0x3C,0x00,0x00,
0x00,0x00,0x00,0xF0,0x88,0x08,0x08,0x7E,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x22,0x22,0x1C,0x02,0x3C,0x42,0x42,0x3C,
0x00,0x00,0x00,0x03,0x02,0x02,0x02,0x3A,0x46,0x42,0x42,0x42,0x42,0xE7,0x00,0x00,
0x00,0x00,0x00,0x0C,0x0C,0x00,0x00,0x0E,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00,
0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x22,0x1E,
0x00,0x00,0x00,0x03,0x02,0x02,0x02,0x72,0x12,0x0A,0x16,0x12,0x22,0x77,0x00,0x00,
0x00,0x00,0x00,0x0E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x92,0x92,0x92,0x92,0x92,0xB7,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3B,0x46,0x42,0x42,0x42,0x42,0xE7,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0x26,0x42,0x42,0x42,0x22,0x1E,0x02,0x07,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x44,0x42,0x42,0x42,0x44,0x78,0x40,0xE0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x4C,0x04,0x04,0x04,0x04,0x1F,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x02,0x3C,0x40,0x42,0x3E,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x3E,0x08,0x08,0x08,0x08,0x08,0x30,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x42,0x42,0x42,0x42,0x62,0xDC,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x14,0x08,0x08,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEB,0x49,0x49,0x55,0x55,0x22,0x22,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x24,0x18,0x18,0x18,0x24,0x6E,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x14,0x18,0x08,0x08,0x07,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x22,0x10,0x08,0x08,0x44,0x7E,0x00,0x00,
0x00,0xC0,0x20,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0x20,0x20,0xC0,0x00,
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
0x00,0x06,0x08,0x08,0x08,0x08,0x08,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x06,0x00,
0x0C,0x32,0xC2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};

                       
#endif 


fonts_tft320.c file
//------------------------

Code:

#include <fonts_tft320.h>



GOOD LUCK
Code:


Last edited by huynhhai on Sat Sep 09, 2017 9:52 am; edited 1 time in total
huynhhai



Joined: 04 Apr 2015
Posts: 39

View user's profile Send private message

PostPosted: Sat Sep 09, 2017 9:48 am     Reply with quote

touch7843.c file


Code:

#include <touch7843.h>
#include <tft320qvt_9341.h>

int16 vx=15489,vy=11106;
int16 chx=199,chy=3871;

struct tp_pix_  tp_pixad,tp_pixlcd;

int8 tpstate(void)
{
   return    Penirq;
}
//-----------------------------------------------------------------------------
void spistar(void)                                   
{
output_high(CS);
output_high(DCLK);
output_high(DIN);
output_high(DCLK);
}
//*----------------------------------------------------------------------------
void WriteCharTo7843(unsigned char num)       
{
unsigned char count=0;
output_low(DCLK);
for(count=0;count<8;count++)
{
   num<<=1;
   //DIN=CY;
   if(carry_flag==1){output_high(DIN);}
   if(carry_flag==0){output_low(DIN);}
   output_low(DCLK);
   delay_cycles(3);
   output_high(DCLK);
   delay_cycles(3);
   }
}
//-----------------------------------------------------------------------------
int16 ReadFromCharFrom7843()             
{
   int8 count=0;
   int16 Num=0;
   for(count=0;count<12;count++)
   {
      Num<<=1;     
      output_high(DCLK);
      delay_cycles(3);
      output_low(DCLK);
      delay_cycles(3);
      if(input(DOUT))
      {
         Num|=1;
      }
   }

return(Num);
}   
//-----------------------------------------------------------------------------
//7846/7843/XPT2046/UH7843/UH7846    0x90=y   0xd0-x
int16 ADS_Read_AD(unsigned char CMD)         
{
int16 l;
output_low(CS);
WriteCharTo7843(CMD);       
output_high(DCLK);
delay_cycles(4);
output_low(DCLK);
delay_cycles(4);
l=ReadFromCharFrom7843();
output_high(CS);
return l;
}         
//-----------------------------------------------------------------------------
#define READ_TIMES 15
#define LOST_VAL 5   
int16 ADS_Read_XY(int8 xy)
{
   int16 i, j;
   int16 buf[READ_TIMES];
   int16 sum=0;
   int16 temp;
   for(i=0;i<READ_TIMES;i++)
   {             
      buf[i]=ADS_Read_AD(xy);       
   }               
   for(i=0;i<READ_TIMES-1; i++)
   {
      for(j=i+1;j<READ_TIMES;j++)
      {
         if(buf[i]>buf[j])
         {
            temp=buf[i];
            buf[i]=buf[j];
            buf[j]=temp;
         }
      }
   }     
   sum=0;
   for(i=LOST_VAL;i<READ_TIMES-LOST_VAL;i++)sum+=buf[i];
   temp=sum/(READ_TIMES-2*LOST_VAL);
   return temp;   
}
//-----------------------------------------------------------------------------
int8 Read_ADS(int16 *x,int16 *y)
{
   int16 xtemp,ytemp;                     
   xtemp=ADS_Read_XY(CMD_RDX);
   ytemp=ADS_Read_XY(CMD_RDY);                                 
   if(xtemp<100||ytemp<100)return 0;
   *x=xtemp;
   *y=ytemp;
   return 1;
}
//-----------------------------------------------------------------------------
#define ERR_RANGE 20
int8 Read_ADS2(int16 *x,int16 *y)
{
    int16 x1,y1;
    int16 x2,y2;
    int8 flag;   
    flag=Read_ADS(&x1,&y1);   
    if(flag==0)return(0);
    flag=Read_ADS(&x2,&y2);   
    if(flag==0)return(0);   
    if(((x2<=x1&&x1<x2+ERR_RANGE)||(x1<=x2&&x2<x1+ERR_RANGE))
    &&((y2<=y1&&y1<y2+ERR_RANGE)||(y1<=y2&&y2<y1+ERR_RANGE)))
    {
        *x=(x1+x2)>>1;
        *y=(y1+y2)>>1;     
        return 1;
    }else return 0;     
}
//----------------------------------------------------------------------------   
int8 Read_TP_Once(void)
{
   int8 re=0;
   int16 x1,y1;
   while(re==0)
   {
      while(!Read_ADS2(&tp_pixad.x,&tp_pixad.y));
      delay_ms(10);
      while(!Read_ADS2(&x1,&y1));
      if(tp_pixad.x==x1&&tp_pixad.y==y1)
      {
         re=1;
      }
   }
   return re;
}
//-----------------------------------------------------------------------------
void Drow_Touch_Point(int16 x,int16 y)
{
   LCD_DrawLine(x-12,y,x+13,y);
   LCD_DrawLine(x,y-12,x,y+13);
   LCD_DrawPoint(x+1,y+1);
   LCD_DrawPoint(x-1,y+1);
   LCD_DrawPoint(x+1,y-1);
   LCD_DrawPoint(x-1,y-1);
   //Draw_Circle(x,y,6);
}     
//-----------------------------------------------------------------------------
int32 Convert_Pos(void)                    //---> defaut int64
{           
   int8 l=0;
   if(Read_ADS2(&tp_pixad.x,&tp_pixad.y))
   {
      l=1;
      tp_pixlcd.x=tp_pixad.x>chx?((int32)tp_pixad.x-(int32)chx)*1000/vx:((int32)chx-(int32)tp_pixad.x)*1000/vx;
      tp_pixlcd.y=tp_pixad.y>chy?((int32)tp_pixad.y-(int32)chy)*1000/vy:((int32)chy-(int32)tp_pixad.y)*1000/vy;
   }
   return l;
}
//-----------------------------------------------------------------------------
#define tp_pianyi 50   
#define tp_xiaozhun 1000 
void Touch_Adjust(void)
{   
   float32 vx1,vx2,vy1,vy2;
   int16 chx1,chx2,chy1,chy2;
   int16 lx,ly;             
   struct tp_pixu32_ p[4];
   int8  cnt=0;   
   cnt=0;           
   POINT_COLOR=BLUE;
   BACK_COLOR =WHITE;
   LCD_Clear(WHITE); 
   POINT_COLOR=RED;
   LCD_Clear(WHITE);
   Drow_Touch_Point(tp_pianyi,tp_pianyi);
   
   while(true)
   {
      if(input(Penirq)==0)
      {
         if(Read_TP_Once())
         {                             
            p[cnt].x=tp_pixad.x;
            p[cnt].y=tp_pixad.y;
            cnt++;
         }         
         switch(cnt)
         {           
            case 1:
               LCD_Clear(WHITE);
               while(!input(Penirq))
               {
               }
               Drow_Touch_Point(LCD_W-tp_pianyi-1,tp_pianyi);
               break;
            case 2:
               LCD_Clear(WHITE);
               while(!input(Penirq))
               {
               }
               Drow_Touch_Point(tp_pianyi,LCD_H-tp_pianyi-1);
               break;
            case 3:
               LCD_Clear(WHITE);
               while(!input(Penirq))
               {
               }
               Drow_Touch_Point(LCD_W-tp_pianyi-1,LCD_H-tp_pianyi-1);
               break;
            case 4:   
                   LCD_Clear(WHITE);
                  while(!input(Penirq))
               {
               }
               vx1=p[1].x>p[0].x?(p[1].x-p[0].x+1)*1000/(LCD_W-tp_pianyi-tp_pianyi):(p[0].x-p[1].x-1)*1000/(LCD_W-tp_pianyi-tp_pianyi);
               chx1=p[1].x>p[0].x?p[0].x-(vx1*tp_pianyi)/1000:p[0].x+(vx1*tp_pianyi)/1000;
               vy1=p[2].y>p[0].y?(p[2].y-p[0].y-1)*1000/(LCD_H-tp_pianyi-tp_pianyi):(p[0].y-p[2].y-1)*1000/(LCD_H-tp_pianyi-tp_pianyi);
               chy1=p[2].y>p[0].y?p[0].y-(vy1*tp_pianyi)/1000:p[0].y+(vy1*tp_pianyi)/1000;
               
               vx2=p[3].x>p[2].x?(p[3].x-p[2].x+1)*1000/(LCD_W-tp_pianyi-tp_pianyi):(p[2].x-p[3].x-1)*1000/(LCD_W-tp_pianyi-tp_pianyi);
               chx2=p[3].x>p[2].x?p[2].x-(vx2*tp_pianyi)/1000:p[2].x+(vx2*tp_pianyi)/1000;
                vy2=p[3].y>p[1].y?(p[3].y-p[1].y-1)*1000/(LCD_H-tp_pianyi-tp_pianyi):(p[1].y-p[3].y-1)*1000/(LCD_H-tp_pianyi-tp_pianyi);
               chy2=p[3].y>p[1].y?p[1].y-(vy2*tp_pianyi)/1000:p[1].y+(vy2*tp_pianyi)/1000;

               if((vx1>vx2&&vx1>vx2+tp_xiaozhun)||(vx1<vx2&&vx1<vx2-tp_xiaozhun)||(vy1>vy2&&vy1>vy2+tp_xiaozhun)||(vy1<vy2&&vy1<vy2-tp_xiaozhun))
               {
                  cnt=0;
                  LCD_Clear(WHITE);
                  Drow_Touch_Point(tp_pianyi,tp_pianyi);
                  continue;
               }
               vx=(vx1+vx2)/2;
               vy=(vy1+vy2)/2;
               chx=(chx1+chx2)/2;
               chy=(chy1+chy2)/2;
                                               
               LCD_Clear(WHITE);
               POINT_COLOR=BLUE;
               BACK_COLOR=WHITE;   
         
               lx=0;ly=50;         
               LCD_ShowString(lx,ly,"VX1:");
               lx+=40;
               LCD_ShowNum(lx,ly,vx1,4);
               lx=0;ly+=20;
               LCD_ShowString(lx,ly,"Vy1:");
               lx+=40;LCD_ShowNum(lx,ly,vy1,4);
               lx=0;ly+=20;
               LCD_ShowString(lx,ly,"CHX1:");
               lx+=40;LCD_ShowNum(lx,ly,chx1,4);
               lx=0;ly+=20;
               LCD_ShowString(lx,ly,"CHY1:");
               lx+=40;LCD_ShowNum(lx,ly,chy1,4);

               lx=100;ly=50;         
               LCD_ShowString(lx,ly,"VX2:");lx+=40;
               LCD_ShowNum(lx,ly,vx2,4);
               lx=100;ly+=20;
               LCD_ShowString(lx,ly,"Vy2:");lx+=40;
               LCD_ShowNum(lx,ly,vy2,4);
               lx=100;ly+=20;
               LCD_ShowString(lx,ly,"CHX2:");lx+=40;
               LCD_ShowNum(lx,ly,chx2,4);
               lx=100;ly+=20;
               LCD_ShowString(lx,ly,"CHY2:");lx+=40;
               LCD_ShowNum(lx,ly,chy2,4);
           
               lx=50;ly=150;         
               LCD_ShowString(lx,ly,"VX:");lx+=40;
               LCD_ShowNum(lx,ly,vx,4);
               lx=50;ly+=20;
               LCD_ShowString(lx,ly,"Vy:");lx+=40;
               LCD_ShowNum(lx,ly,vy,4);
               lx=50;ly+=20;
               LCD_ShowString(lx,ly,"CHX:");lx+=40;
               LCD_ShowNum(lx,ly,chx,4);
               lx=50;ly+=20;
               LCD_ShowString(lx,ly,"CHY:");lx+=40;
               LCD_ShowNum(lx,ly,chy,4);

               lx=30;ly+=30;
               LCD_ShowString(lx,ly,"Adjust OK!  Touch Anywhere To Continue");                               
               Read_TP_Once();
               LCD_Clear(WHITE);
               return;           
         }
      }
   }
}
//-----------------------------------------------------------------------------
void point(void)
{
   int32 t=0;  // double t=0;
   
    while(true)
   {     
      if(input(Penirq)==0)
      {
         t=0;
         if(Convert_Pos())
         {
            //LCD_ShowString(10,250,"X:");LCD_ShowNum(30,250,(u32)tp_pixad.x,6);   
            //LCD_ShowString(180,250,"Y:");LCD_ShowNum(200,250,(u32)tp_pixad.y,6);   
            LCD_ShowString(10,250,"X:");
            LCD_ShowNum(30,250,tp_pixad.x,4);
            LCD_ShowString(180,250,"Y:");
            LCD_ShowNum(200,250,tp_pixad.y,4);
            LCD_DrawPoint_big(tp_pixlcd.x,tp_pixlcd.y);   
          }
         
      }
      else
      {   
         t++;     
         if(t>65000)
         {
            return;
         }
      }     

   }
}         



//-------------------------
touch7843.h file


Code:

#ifndef __TOUCH7843_H
#define __TOUCH7843_H

/* touch panel interface define */
#define  CMD_RDX  0xD0         //
#define  CMD_RDY  0x90

//khai bao spi giao tiep - dung software
#define DCLK    PIN_D0 
#define CS      PIN_D1
#define DIN     PIN_D2 
#define DOUT    PIN_D3                                                                   
#define Penirq  PIN_D4 

struct tp_pix_
{
   int16 x;
   int16 y;
};
struct tp_pixu32_
{
   int32 x;
   int32 y;
};
extern struct tp_pix_; // tp_pixad,tp_pixlcd
extern int16 vx,vy; 
extern int16 chx,chy;
int8 tpstate(void);
void spistar(void); 
void Touch_Adjust(void);
void point(void);
int16 ReadFromCharFrom7843();

#endif 
   
   

[/code]
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> Code Library All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group