How to compile the line drawing function of TFT series bus type liquid crystal display!

by:Kimeery     2021-09-02
Various waveforms and some forms are realized by line segments. This article introduces a faster line drawing program, which is suitable for various TFT series bus-type mobile LCDscreen displays. Users of VTK series smart displays do not need to master the content of this article. /************************************************* **Hardware connection: P00--P07 D0--D7******* /WR /WR ****** /RD /RD * ******* P27 /CS ******** P21 A1 ******** P20 A0 **** * ***********************************************/#include #include #define X_ADDR XBYTE[0x0000] #define Y_ADDR XBYTE[0x0100] #define CMD XBYTE[0x0200] #define DAT XBYTE[0x0300] //Declare the program draw_pixel(unsigned int x, unsigned int y, unsigned char color); //Draw a point draw_line(unsigned int x1,unsigned int y1,unsigned int x2,unsigned int y2, unsigned char color); //Draw a line//******** *****************draw line start**********************//Draw line start draw_line(unsigned int x1,unsigned int y1,unsigned int x2,unsigned int y2, unsigned char color) {unsigned int i1,j1,k1,l1; int n1u003d0; unsigned char tempu003d0; if(y2x2) (i1u003dx1; x1u003d x2; x2u003di1;} for (i1u003dx1;i1u003dx1) {tempu003d1; j1u003dx2-x1; } e lse j1u003dx1-x2; i1u003dx1; l1u003dy1; draw_pixel(i1,l1,color); if(tempu0026u0026(k1j1)) while(l1!u003dy2) {j1u003dx2-i1; k1u003dy2-l1; if(n1<0) {i1u003di1+1; l1u003d l1+1; n1u003dn1+k1-j1;} else {l1u003dl1+1; n1u003dn1-j1;} draw_pixel(i1,l1,color);} else if(!tempu0026u0026(k1j1)) while(l1!u003dy2) {j1u003di1-x2; k1 u003dy2-l1; if(n1<0) {i1u003di1-1; l1u003dl1+1; n1u003dn1+k1-j1;} else {l1u003dl1+1; n1u003dn1-j1;} draw_pixel( i1,l1,color);}}} draw_pixel(unsigned int x,unsigned int y, unsigned char color) {unsigned char temp,i; Y_ADDR u003d y%256;//Line low address Y_ADDR u003d y/256;// Row high address X_ADDR u003d x%256;//column low address X_ADDR u003d x/256;//column high address DATu003dcolor;} //end of line drawing//************draw line end********************//Call example main() {draw_line(0,0,150,150,0xe0);//Red(0,0)->( 150,150) }The above information is provided by Shenzhen LCM manufacturer-Xingyuhe Electronics Collect and organize.
Additionally, Kimeery (HK) Industrial Limited has a few new features planned to roll out in the app to provide more convenience, comfort and options to our clients.
If you already use mobile phone lcd display elsewhere or want the ability to offer restricted chat access to certain individuals, mobile phone lcd display cell phone lcd wholesale offers you the most flexibility.
Kimeery (HK) Industrial Limited’s model also predicts (i) a positive effect of management on firm performance; (ii) a positive relationship between product market competition and average management quality (part of which stems from the larger covariance between management with firm size as competition strengthens); and (iii) a rise (fall) in the level (dispersion) of management with firm age.
Custom message
Chat Online 编辑模式下无法使用
Chat Online inputting...
Thank you for your enquiry. We will get back to you ASAP