亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? t6963clcdtest_c.htm

?? 含多種常用液晶驅動芯片和點陣驅動程序樣例,有很好的參考價值,本人特意會集上傳
?? HTM
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0050)http://beale.best.vwh.net/measure/source/lcdtest.c -->
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2627" name=GENERATOR></HEAD>
<BODY><PRE>/* ----------------------------------------------------------
 * Program to control a T6963C-based 240x64 pixel LCD display
 * using the PC's Parallel Port (LPT1:) in bidirectional mode
 * written in Microsoft Quick C
 *
 * Written by John P. Beale May 3-4, 1997  beale@best.com
 *
 *  Based on information from Steve Lawther,
 *  "Writing Software for T6963C based Graphic LCDs", 1997 which is at
 *  http://ourworld.compuserve.com/homepages/steve_lawther/t6963c.pdf
 *
 *  and the Toshiba T6963C data sheet, also on Steve's WWW page
 *
 *  and info at: http://www.citilink.com/~jsampson/lcdindex.htm
 *               http://www.cs.colostate.edu/~hirsch/LCD.html
 *               http://www.hantronix.com/
 *
 *  See also: http://members1.chello.nl/r.schotsman/LCDFrame.htm
 * ----------------------------------------------------------
 */

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;     // rand()
#include &lt;conio.h&gt;      // inp() outp() kbhit()
#include &lt;string.h&gt;     // strlen()
#include &lt;graph.h&gt;      // _settextposition(row,column) ie, (y,x)
#include &lt;math.h&gt;       // cos(),sin()
#include &lt;time.h&gt;

/* --------------------------------------------------------------
 *
 * -------------------------------------------
 *  20-pin header on TOSHIBA TLX-711A module *
 *  (viewed from top-note pin numbering)     *
 * -------------------------------------------
   *  19--FS    X1--20    *
   *  17--D6    D7--18    *
   *  15--D4    D5--16    *
   *  13--D2    D3--14    *
   *  11--D0    D1--12    *
   *   9--XX  /RST--10    *
   *   7--/CE   CD--8     *
   *   5--/WR  /RD--6     *  
   *   3--Vdd   Vl--4     *
   *   1--Fgnd  Vss-2     *
 * ------------------------
 *
 * Connecting LCD module TLX-711A-E0 (uses T6963C controller)
 * to the PC parallel port: pin connections needed are below.
 *
 * "PC Port pin" numbers refer to pins on PC's DB25 parallel port.
 * Recall that SEL (pin 17), LF (14), and STROBE (1) control ouputs
 * are inverted, but Init (16) is true.
 *
 *  LCD Pin ----- PC Port Pin  Status Reg. bit
 * ------------------------------------------
 *  C/D  (8) &lt;--&gt; (17) /SEL      3
 *  /WR  (5) &lt;--&gt; (16) Init      2
 *  /RD  (6) &lt;--&gt; (14) /LF       1
 *  /CE  (7) &lt;--&gt; (1)  /Strobe   0
 * -----------------------
 *  D0  (11) &lt;--&gt; (2)  D0
 *  D1  (12) &lt;--&gt; (3)  D1
 *  D2  (13) &lt;--&gt; (4)  D2
 *  D3  (14) &lt;--&gt; (5)  D3
 *  D4  (15) &lt;--&gt; (6)  D4
 *  D5  (16) &lt;--&gt; (7)  D5
 *  D6  (17) &lt;--&gt; (8)  D6
 *  D7  (18) &lt;--&gt; (9)  D7
 *  GND (2)  &lt;--&gt; (25) GND
 * --------------------------------------------------------------
 *  FG    (1)  frame ground
 *  +5V   (3)  LCD logic supply
 *  -7.8V (4)  LCD display contrast
 *  FS    (19) font select
 *  RST   (10) active low
 */

#define CEHI outp(pcont, (inp(pcont) &amp; 0xfe) ) // take PC 1 HI
#define CELO outp(pcont, (inp(pcont) | 0x01) ) // take PC 1 LO

#define RDHI outp(pcont, (inp(pcont) &amp; 0xfd) ) // take PC 14 HI
#define RDLO outp(pcont, (inp(pcont) | 0x02) ) // take PC 14 LO

#define WRHI outp(pcont, (inp(pcont) | 0x04) ) // take PC 16 HI
#define WRLO outp(pcont, (inp(pcont) &amp; 0xfb) ) // take PC 16 LO

#define CDHI outp(pcont, (inp(pcont) &amp; 0xf7) ) // take PC 17 HI
#define CDLO outp(pcont, (inp(pcont) | 0x08) ) // take PC 17 LO

#define DATAIN  outp(pcont, (inp(pcont) | 0x20) ) // 8bit Data input
#define DATAOUT outp(pcont, (inp(pcont) &amp; 0xdf) ) // 8bit Data output

/* ----- Definitions concerning LCD internal memory  ------ */

#define G_BASE 0x0200            // base address of graphics memory
#define T_BASE 0x0000            // base address of text memory
#define BYTES_PER_ROW 40         // how many bytes per row on screen

 /* This will be 30 with 8x8 font, 40 with 6x8 font, for both
    Text &amp; Graphics modes. Font selection by FS pin on LCD module:
    FS=High: 6x8 font.  FS=Low: 8x8 font.                     */

/* ----------------------------------------------------------- */

#define sgn(x) ((x)&gt;0?1:-1)
#define frand() ((float)rand()/RAND_MAX)

#define UI unsigned int
#define UL unsigned long

void delay(UL d);  // delay proportional to "d" value

void dput(int byte); // write data byte to LCD module
int dget(void);      // get data byte from LCD module
int sget(void);      // check LCD display status pbrt
void cput(int byte); // write command byte to LCD module
void lcd_setup();    // make sure control lines are at correct levels
void lcd_init();     // initialize LCD memory and display modes
void lcd_print(char *string);  // send string of characters to LCD
void lcd_clear_graph();    // clear graphics memory of LCD
void lcd_clear_text();     // clear text memory of LCD
void lcd_xy(int x, int y); // set memory pointer to (x,y) position (text)
void lcd_setpixel(int column, int row);  // set single pixel in 240x64 array

#define BASE 0x378     // base address for parallel port LPT1:
UI pdata = BASE;       // par.port data register
UI pstatus = BASE+1;   // par.port status register
UI pcont = BASE+2;     // par.port control register

#define home() dput(T_BASE%256);dput(T_BASE&gt;&gt;8);cput(0x24); // upper-left


#define XMAX 239        // limits of (x,y) LCD graphics drawing
#define XMIN 0
#define YMAX 63
#define YMIN 0

#define PI 3.1415926536

void main()
{
int d1;                 // data from port
int s1;                 // status register value
int c1;                 // control register value
int i;                  // generic counter
int c;                  // character to write to display
float x,y;                // coordinates on graphics screen
float xinc,yinc;
float r,theta;           // polar coords. for point dV
float theta_inc;
unsigned int cc;
char string[320];        // string to print to display
char tmpbuf[128];  // time buffer

  _clearscreen(_GCLEARSCREEN);  // Clears PC's display screen, not LCD

  printf("LCD control program.  jpb 5/3/97\n");
  printf("&lt;esc&gt; to quit.\n");
  lcd_setup();  // make sure control lines are at correct levels
  printf("Setup lcd sucessfully.\n");
  lcd_init();   // initialize LCD memory and display modes
  printf("Initialized lcd sucessfully.\n");

  do {  // outer loop: keypress exits

  /* --- display characters available from LCD's ROM CharGen ------ */

   lcd_clear_text();
   cput(0x97);  // Graphics &amp; Text ON, cursor blinking
   for (c=0;c&lt;10;c++) {
    lcd_xy(0,0);        // write text from upper left corner
    /*
    for (i=0;i&lt;320;i++) {
      cc = (unsigned int) (c+i)%0x7f;     // display all characters
      dput(cc); cput(0xc0);               // write char, inc ptr.
    }
    */
    strcpy(string, "Hello world.");
    lcd_print(string);
    lcd_xy(0,1);        // first character, second line
    lcd_print("This is the second line.");
    lcd_xy(5,2);
    lcd_print("Here is the third line...");
    lcd_xy(0,3);
    lcd_print("...and so on and so forth.");
    lcd_xy(10,5);
    lcd_print("Press any key to exit.");
    lcd_xy(0,7);
    lcd_print("Display by John Beale ");

    /* Set time zone from TZ environment variable. If TZ is not set,
     * PST8PDT is used (Pacific standard time, daylight savings).
     */
    tzset();

    /* Display DOS-style date and time, in refresh loop */
    for (i=0;i&lt;500;i++) {
      lcd_xy(22,0);
      _strtime( tmpbuf );
      lcd_print( tmpbuf );  // DOS-style time
      lcd_print(" ");       // intervening space
      _strdate( tmpbuf );
      lcd_print( tmpbuf );           // DOS-style date

      if (kbhit()) break;
    }
    // delay(400000);       // about 0.5 sec on 75 MHz Pentium
   }
   if (kbhit()) break;

  /* ------ bouncing line graphics "screensaver" demo ---------- */

   lcd_clear_graph();        // fill graphics memory with 0x00
   cput(0x98);  // Graphics ON, Text OFF

   x=(XMAX-XMIN)/2;
   y=(YMAX-YMIN)/2;
   r=0.3; theta = 2*PI*frand();
   theta_inc = (0.01 * frand()) - 0.005;
   for (c=0;c&lt;12000;c++) {
     lcd_setpixel((int)x,(int)y);       // draw pixel on LCD screen
     xinc = r*cos(theta);
     yinc = r*sin(theta);
     theta += theta_inc;
     x += xinc;
     y += yinc;
     if (x&gt;XMAX) {x=XMAX; theta = PI-theta;}
     if (y&gt;YMAX) {y=YMAX; theta = -theta;}
     if (x&lt;XMIN) {x=XMIN; theta = PI-theta;}
     if (y&lt;YMIN) {y=YMIN; theta = -theta;}
     if (kbhit()) break;
     // delay(1000);       // delay calibrated on 75 MHz Pentium
     } // end for(c)
  if (kbhit()) getch();

  } while (!kbhit());

 /* --------------------------------------------------------- */

} // end main

/* Block writes would, I think, run faster if you used the DATA AUTO
   mode, eg command 0xB0. I didn't bother.
 */
void lcd_clear_graph()    // clear graphics memory of LCD
{
int i;

 dput(G_BASE%256);
 dput(G_BASE&gt;&gt;8);
 cput(0x24);       // addrptr at address G_BASE

 for (i=0;i&lt;2560;i++) {
      dput(0); cput(0xc0);               // write data, inc ptr.
 } // end for(i)
} // end lcd_clear_graph()

void lcd_clear_text()
{
 int i;

 dput(T_BASE%256);
 dput(T_BASE&gt;&gt;8);
 cput(0x24);       // addrptr at address T_BASE

 for (i=0;i&lt;320;i++) {
      dput(0); cput(0xc0);               // write data, inc ptr.
 } // end for(i)

} // lcd_clear_text()



void lcd_print(char *string)  // send string of characters to LCD
{
int i;
int c;

  for (i=0;i&lt;strlen(string);i++) {
      c = string[i] - 0x20;     // convert ASCII to LCD char address
      if (c&lt;0) c=0;
      dput(c);
      cput(0xc0);               // write character, increment memory ptr.
  } // end for

} // end lcd_string

void lcd_setpixel(int column, int row)  // set single pixel in 240x64 array
{

int addr;       // memory address of byte containing pixel to write

  addr =  G_BASE + (row*BYTES_PER_ROW)  + (column/6);
  dput(addr%256); dput(addr&gt;&gt;8); cput(0x24);  // set LCD addr. pointer
  cput(0xf8 | (5-(column%6)) );  // set bit-within-byte command

} // end lcd_setpixel()

void lcd_xy(int x, int y)  // set memory pointer to (x,y) position (text)
{
int addr;

  addr = T_BASE + (y * BYTES_PER_ROW) + x;
  dput(addr%256); dput(addr&gt;&gt;8); cput(0x24);  // set LCD addr. pointer

} // lcd_xy()

void delay(UL d)  // delay proportional to "d" value
{
UL i;
double a;

 a = 1.000;
 for (i=0;i&lt;d;i++) {
   a = a / 1.001;
 }

} // end delay()

/* ==============================================================
 * Low-level I/O routines to interface to LCD display
 * based on four routines:
 *
 *          dput(): write data byte
 *          cput(): write control byte
 *          dget(): read data byte         (UNTESTED)
 *          sget(): read status
 * ==============================================================
 */

void lcd_setup()  // make sure control lines are at correct levels
{
 CEHI;  // disable chip
 RDHI;  // disable reading from LCD
 WRHI;  // disable writing to LCD
 CDHI;  // command/status mode
 DATAOUT; // make 8-bit parallel port an output port
} // end lcd_setup()

void lcd_init()  // initialize LCD memory and display modes
{
 dput(G_BASE%256);
 dput(G_BASE&gt;&gt;8);
 cput(0x42);       // set graphics memory to address G_BASE

 dput(BYTES_PER_ROW%256);
 dput(BYTES_PER_ROW&gt;&gt;8);
 cput(0x43);  // n bytes per graphics line

 dput(T_BASE%256);
 dput(T_BASE&gt;&gt;8);
 cput(0x40);       // text memory at address T_BASE

 dput(BYTES_PER_ROW%256);
 dput(BYTES_PER_ROW&gt;&gt;8);
 cput(0x41);  // n bytes per text line

 cput(0x80);  // mode set: Graphics OR Text, ROM CGen

 cput(0xa7);  // cursor is 8 lines high
 dput(0x00);
 dput(0x00);
 cput(0x21);  // put cursor at (x,y) location

 cput(0x97);  // Graphics &amp; Text ON, cursor blinking
	      // (For cursor to be visible, need to set up position)

} // end lcd_init()


// ----------------------------------------------------------------
int sget(void)  // get LCD display status byte
{
int lcd_status;

  DATAIN;       // make 8-bit parallel port an input
  CDHI;         // bring LCD C/D line high (read status byte)
  RDLO;         // bring LCD /RD line low (read active)
  CELO;         // bring LCD /CE line low (chip-enable active)
  lcd_status = inp(pdata);      // read LCD status byte
  CEHI;         // bring LCD /CE line high, disabling it
  RDHI;         // deactivate LCD read mode
  DATAOUT; // make 8-bit parallel port an output port

  return(lcd_status);
} // sget()


void dput(int byte) // write data byte to LCD module over par. port
		    // assume PC port in data OUTPUT mode
{
  do {} while ((0x03 &amp; sget()) != 0x03); // wait until display ready
  CDLO;
  WRLO;         // activate LCD's write mode
  outp(pdata, byte);          // write value to data port
  CELO;                       // pulse enable LOW &gt; 80 ns (hah!)
  CEHI;                       // return enable HIGH
  WRHI;                       // restore Write mode to inactive

 // using my P5/75 MHz PC with ISA bus, CE stays low for 2 microseconds

} // end dput()


int dget(void)      // get data byte from LCD module
{
int lcd_byte;

  do {} while ((0x03 &amp; sget()) != 0x03); // wait until display ready
  DATAIN; // make PC's port an input port
  WRHI;   // make sure WRITE mode is inactive
  CDLO;   // data mode
  RDLO;   // activate READ mode
  CELO;   // enable chip, which outputs data
  lcd_byte = inp(pdata);  // read data from LCD
  CEHI;   // disable chip
  RDHI;   // turn off READ mode
  DATAOUT; // make 8-bit parallel port an output port

  return(lcd_byte);
} // dget()

void cput(int byte) // write command byte to LCD module
		    // assumes port is in data OUTPUT mode
{
  do {} while ((0x03 &amp; sget()) != 0x03); // wait until display ready

  outp(pdata, byte);  // present data to LCD on PC's port pins

  CDHI;         // control/status mode
  RDHI;         // make sure LCD read mode is off
  WRLO;         // activate LCD write mode
  CELO;         // pulse ChipEnable LOW, &gt; 80 ns, enables LCD I/O
  CEHI;         // disable LCD I/O
  WRHI;         // deactivate write mode

} // cput()

</PRE></BODY></HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕不卡的av| 亚洲成av人片在线观看无码| 国产精品911| 国产欧美视频一区二区三区| 床上的激情91.| 国产精品免费看片| 91黄色免费观看| 日韩精品免费专区| 亚洲成人手机在线| 免费不卡在线视频| 久久综合狠狠综合久久综合88| 国产成人av电影在线| 成人欧美一区二区三区黑人麻豆| 91国偷自产一区二区开放时间| 日韩成人午夜电影| 国产欧美va欧美不卡在线| 波多野洁衣一区| 偷拍一区二区三区四区| 精品国产一二三区| 波波电影院一区二区三区| 一区二区三区四区视频精品免费 | 奇米在线7777在线精品| 精品国产乱码久久久久久浪潮| 成人黄色777网| 婷婷成人综合网| 国产精品麻豆网站| 欧美高清dvd| 成人精品免费视频| 婷婷国产在线综合| 日本一区二区三区久久久久久久久不| 在线观看日韩一区| 国产剧情在线观看一区二区| 亚洲综合在线电影| 国产亚洲人成网站| 欧美久久久一区| 91小视频在线观看| 经典三级一区二区| 亚洲成人精品影院| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 欧美天堂一区二区三区| 久久精品亚洲精品国产欧美kt∨| 色婷婷av一区二区| 国产高清亚洲一区| 日本91福利区| 亚洲综合色成人| 成人avav影音| 国内外成人在线| 日韩国产在线观看| 亚洲一区在线视频| 国产精品女人毛片| www精品美女久久久tv| 欧美日本乱大交xxxxx| 不卡影院免费观看| 国产一区二区美女| 欧美一区二区三区视频在线观看| 91麻豆国产福利在线观看| 国产精品一二二区| 91免费观看视频在线| 国产一区在线看| 美女诱惑一区二区| 午夜av一区二区三区| 亚洲日本一区二区| 中文字幕在线不卡视频| 国产欧美日韩精品a在线观看| 久久99精品久久久久久国产越南| 天天综合网天天综合色| 夜夜嗨av一区二区三区中文字幕| 国产精品青草综合久久久久99| 精品国产一区二区亚洲人成毛片 | 欧美亚洲丝袜传媒另类| 91蝌蚪porny| 91视频91自| 日本道免费精品一区二区三区| 99精品热视频| 91亚洲精品一区二区乱码| 99久久精品免费观看| 99久久婷婷国产精品综合| 91丝袜美腿高跟国产极品老师| 成人国产精品免费| 99久久久久免费精品国产| 99亚偷拍自图区亚洲| 色国产综合视频| 欧美三级日韩三级国产三级| 欧美老年两性高潮| 日韩一区和二区| 久久久久久久久伊人| 国产精品视频九色porn| 亚洲视频在线一区| 亚洲成人精品影院| 久久精品国产一区二区| 国产一区二区按摩在线观看| 国产伦精品一区二区三区免费迷| 成人高清免费观看| 一本高清dvd不卡在线观看| 欧美色成人综合| 欧美成人激情免费网| 国产女人水真多18毛片18精品视频| 中文字幕成人在线观看| 国产99久久久国产精品潘金| 成人激情小说网站| 在线精品视频一区二区三四| 欧美一区二区在线观看| 国产婷婷色一区二区三区四区| 国产精品久久久久永久免费观看 | 国产不卡高清在线观看视频| 99久久精品情趣| 日韩电影在线一区二区| 国产丶欧美丶日本不卡视频| 97se亚洲国产综合自在线观| 欧美年轻男男videosbes| 国产一区二区久久| 色婷婷激情久久| 欧美电影免费提供在线观看| 国产精品天美传媒| 婷婷开心激情综合| 成人高清在线视频| 日韩一区二区三| 亚洲天堂久久久久久久| 毛片一区二区三区| 色妞www精品视频| 精品国产凹凸成av人网站| 尤物视频一区二区| 国产乱码一区二区三区| 欧美色精品天天在线观看视频| 久久久99久久| 天堂一区二区在线免费观看| 成人少妇影院yyyy| 91精品国产综合久久精品| 国产精品灌醉下药二区| 老司机精品视频线观看86| 色综合久久久久久久久久久| 精品久久久久久综合日本欧美| 综合久久综合久久| 国产成人av自拍| 日韩视频免费直播| 亚洲国产成人porn| 91在线一区二区三区| 国产亚洲1区2区3区| 日本不卡在线视频| 欧美性大战久久| 亚洲黄色性网站| 国产1区2区3区精品美女| 91精品国产乱| 亚洲综合色婷婷| 91网站最新地址| 欧美国产日韩亚洲一区| 日本高清不卡视频| 国产精品久久久久久一区二区三区 | 国内精品免费在线观看| 欧美日本一道本| 亚洲国产精品一区二区久久恐怖片 | 欧美成人乱码一区二区三区| 性欧美疯狂xxxxbbbb| 色94色欧美sute亚洲13| 亚洲三级免费电影| 波多野结衣中文字幕一区| 亚洲国产精品av| 国产精品一区二区久激情瑜伽| 欧美一级爆毛片| 久久精品国产成人一区二区三区 | 欧洲亚洲国产日韩| 亚洲精品视频在线看| 99久久精品99国产精品| 国产精品乱码妇女bbbb| 成人午夜视频在线观看| 欧美国产日韩一二三区| 成人三级伦理片| 国产精品国产成人国产三级| 成人免费观看男女羞羞视频| 国产精品视频一二| av在线免费不卡| 最新国产精品久久精品| 色综合亚洲欧洲| 亚洲图片一区二区| 91精品国产91久久久久久最新毛片 | 日韩精品乱码免费| 日韩欧美色综合网站| 精品一区二区日韩| 国产午夜精品美女毛片视频| 制服丝袜亚洲播放| 日韩极品在线观看| 26uuu另类欧美亚洲曰本| 久久精品人人做人人爽97| 成人深夜在线观看| 一区二区三区成人| 欧美日韩另类一区| 麻豆国产一区二区| 国产成人免费视频网站高清观看视频 | 91国偷自产一区二区三区观看| 亚洲成av人片www| 欧美成人欧美edvon| 国产成人精品午夜视频免费| 综合婷婷亚洲小说| 91精品国产乱| 成人av中文字幕| 亚洲va欧美va天堂v国产综合| 欧美xxxxxxxx| 色综合咪咪久久| 蜜桃在线一区二区三区| 国产精品嫩草影院com|