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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? original_dos_lcdtest.c

?? T6963LCD屏的驅(qū)動程序
?? C
字號:
/* ---------------------------------------------------------- * 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 <stdio.h>#include <stdlib.h>     // rand()#include <conio.h>      // inp() outp() kbhit()#include <string.h>     // strlen()#include <graph.h>      // _settextposition(row,column) ie, (y,x)#include <math.h>       // cos(),sin()#include <time.h>/* -------------------------------------------------------------- * * ------------------------------------------- *  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) <--> (17) /SEL      3 *  /WR  (5) <--> (16) Init      2 *  /RD  (6) <--> (14) /LF       1 *  /CE  (7) <--> (1)  /Strobe   0 * ----------------------- *  D0  (11) <--> (2)  D0 *  D1  (12) <--> (3)  D1 *  D2  (13) <--> (4)  D2 *  D3  (14) <--> (5)  D3 *  D4  (15) <--> (6)  D4 *  D5  (16) <--> (7)  D5 *  D6  (17) <--> (8)  D6 *  D7  (18) <--> (9)  D7 *  GND (2)  <--> (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) & 0xfe) ) // take PC 1 HI#define CELO outp(pcont, (inp(pcont) | 0x01) ) // take PC 1 LO#define RDHI outp(pcont, (inp(pcont) & 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) & 0xfb) ) // take PC 16 LO#define CDHI outp(pcont, (inp(pcont) & 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) & 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 & Graphics modes. Font selection by FS pin on LCD module:    FS=High: 6x8 font.  FS=Low: 8x8 font.                     *//* ----------------------------------------------------------- */#define sgn(x) ((x)>0?1:-1)#define frand() ((float)rand()/RAND_MAX)#define UI unsigned int#define UL unsigned longvoid delay(UL d);  // delay proportional to "d" valuevoid dput(int byte); // write data byte to LCD moduleint dget(void);      // get data byte from LCD moduleint sget(void);      // check LCD display status pbrtvoid cput(int byte); // write command byte to LCD modulevoid lcd_setup();    // make sure control lines are at correct levelsvoid lcd_init();     // initialize LCD memory and display modesvoid lcd_print(char *string);  // send string of characters to LCDvoid lcd_clear_graph();    // clear graphics memory of LCDvoid lcd_clear_text();     // clear text memory of LCDvoid 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 registerUI pstatus = BASE+1;   // par.port status registerUI pcont = BASE+2;     // par.port control register#define home() dput(T_BASE%256);dput(T_BASE>>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.1415926536void main(){int d1;                 // data from portint s1;                 // status register valueint c1;                 // control register valueint i;                  // generic counterint c;                  // character to write to displayfloat x,y;                // coordinates on graphics screenfloat xinc,yinc;float r,theta;           // polar coords. for point dVfloat theta_inc;unsigned int cc;char string[320];        // string to print to displaychar tmpbuf[128];  // time buffer  _clearscreen(_GCLEARSCREEN);  // Clears PC's display screen, not LCD  printf("LCD control program.  jpb 5/3/97\n");  printf("<esc> 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 & Text ON, cursor blinking   for (c=0;c<10;c++) {    lcd_xy(0,0);        // write text from upper left corner    /*    for (i=0;i<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<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<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>XMAX) {x=XMAX; theta = PI-theta;}     if (y>YMAX) {y=YMAX; theta = -theta;}     if (x<XMIN) {x=XMIN; theta = PI-theta;}     if (y<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>>8); cput(0x24);       // addrptr at address G_BASE for (i=0;i<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>>8); cput(0x24);       // addrptr at address T_BASE for (i=0;i<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<strlen(string);i++) {      c = string[i] - 0x20;     // convert ASCII to LCD char address      if (c<0) c=0;      dput(c);      cput(0xc0);               // write character, increment memory ptr.  } // end for} // end lcd_stringvoid 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>>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>>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<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>>8); cput(0x42);       // set graphics memory to address G_BASE dput(BYTES_PER_ROW%256); dput(BYTES_PER_ROW>>8); cput(0x43);  // n bytes per graphics line dput(T_BASE%256); dput(T_BASE>>8); cput(0x40);       // text memory at address T_BASE dput(BYTES_PER_ROW%256); dput(BYTES_PER_ROW>>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 & 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 & 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 > 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 & 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 & 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, > 80 ns, enables LCD I/O  CEHI;         // disable LCD I/O  WRHI;         // deactivate write mode} // cput()

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人avav影音| 亚洲成人tv网| 亚洲免费视频成人| 日韩av在线播放中文字幕| 精品一区二区三区免费观看| 不卡在线视频中文字幕| 欧美午夜精品久久久久久孕妇| 91麻豆精品国产91久久久更新时间 | 99re这里只有精品6| 欧美日韩mp4| 国产日韩av一区| 亚洲一区二区五区| 国产剧情一区二区三区| 91官网在线观看| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 亚洲欧美视频在线观看视频| 日韩电影在线免费看| 高清不卡一二三区| 欧美日韩精品三区| 国产精品全国免费观看高清| 日韩精品午夜视频| av亚洲精华国产精华精| 日韩一卡二卡三卡四卡| 中文字幕在线一区免费| 免费久久99精品国产| 91看片淫黄大片一级| 欧美v国产在线一区二区三区| 亚洲激情欧美激情| 国产成人免费av在线| 日韩一级成人av| 亚洲另类在线一区| 高清成人在线观看| 日韩欧美国产wwwww| 高清视频一区二区| 欧美日韩精品免费观看视频| 中文字幕在线视频一区| 久久精品国产精品亚洲红杏| 欧美网站一区二区| 日本一区二区电影| 久久国产精品99久久久久久老狼 | 午夜精品福利一区二区蜜股av| 成人v精品蜜桃久久一区| 精品久久人人做人人爰| 日本中文一区二区三区| 欧美网站一区二区| 亚洲精品久久7777| av在线综合网| 国产三级三级三级精品8ⅰ区| 久久激情综合网| 欧美美女黄视频| 亚洲一区二区av在线| 91色porny| 亚洲欧美区自拍先锋| 粉嫩av一区二区三区粉嫩| 精品国产青草久久久久福利| 日韩va亚洲va欧美va久久| 欧美揉bbbbb揉bbbbb| 亚洲乱码中文字幕| 99久久国产综合色|国产精品| 国产欧美va欧美不卡在线| 久久99久久精品| 日韩欧美激情一区| 免费看精品久久片| 日韩欧美国产不卡| 久久99精品国产.久久久久| 欧美一区国产二区| 日韩av一级电影| 91精品国产麻豆国产自产在线 | 日韩欧美电影一二三| 日本aⅴ亚洲精品中文乱码| 欧美剧情电影在线观看完整版免费励志电影| 亚洲精品老司机| 欧美性大战久久| 亚洲不卡av一区二区三区| 制服丝袜激情欧洲亚洲| 日韩电影免费在线观看网站| 91精品国产综合久久国产大片| 亚洲一区二区三区免费视频| 欧美日韩在线精品一区二区三区激情| 一级特黄大欧美久久久| 在线观看国产日韩| 亚洲成人先锋电影| 日韩欧美一区中文| 国产一区二区三区免费| 26uuu亚洲| 国产成人精品三级| 亚洲男同1069视频| 欧美日韩综合色| 久热成人在线视频| 国产欧美日韩精品一区| 99视频国产精品| 亚洲制服欧美中文字幕中文字幕| 欧美日韩国产精选| 免费观看一级欧美片| 久久久www免费人成精品| 国v精品久久久网| 亚洲综合999| 日韩三区在线观看| 高清不卡在线观看| 亚洲综合久久久| 亚洲成人黄色小说| 欧美tickle裸体挠脚心vk| 丁香另类激情小说| 亚洲摸摸操操av| 91麻豆精品国产91久久久更新时间 | 日本韩国一区二区| 婷婷综合五月天| 国产亚洲成av人在线观看导航| 99综合电影在线视频| 午夜欧美视频在线观看 | 成人黄页毛片网站| 一区二区三区丝袜| 欧美精品一区二区三区在线| 岛国一区二区在线观看| 亚洲精品乱码久久久久久| 欧美成人免费网站| 色综合中文字幕国产 | 91官网在线观看| 国产综合色视频| 亚洲日本在线看| 日韩欧美激情一区| 色哟哟精品一区| 国产永久精品大片wwwapp| 亚洲精品v日韩精品| 欧美成人性战久久| 色偷偷88欧美精品久久久 | 国产偷v国产偷v亚洲高清| 在线观看日产精品| 国产制服丝袜一区| 亚洲一区二区三区不卡国产欧美| 亚洲精品在线免费播放| 欧美午夜精品一区二区三区| 国产成人综合自拍| 日韩制服丝袜先锋影音| 国产精品久久久久久久久快鸭| 欧美精品乱码久久久久久| 不卡av电影在线播放| 久久狠狠亚洲综合| 一区二区不卡在线播放 | 91免费视频网址| 精品一区二区日韩| 亚洲国产精品一区二区久久| 欧美高清在线一区| 欧美一级高清片在线观看| 91免费观看在线| 国产精品影音先锋| 日本欧美一区二区三区乱码 | 欧美性欧美巨大黑白大战| 国产精品一二三四区| 日本大胆欧美人术艺术动态 | 91精品国产色综合久久不卡电影 | 亚洲电影视频在线| 综合久久久久久久| 国产精品人人做人人爽人人添| 精品久久久久久久人人人人传媒| 欧美视频中文一区二区三区在线观看| 成人国产免费视频| 国产成人精品亚洲午夜麻豆| 精品一区二区三区免费毛片爱 | 亚洲午夜激情av| 日本一区二区三区在线观看| 日韩女优制服丝袜电影| 欧美日韩免费观看一区三区| 91小视频在线| 9久草视频在线视频精品| 成人黄色软件下载| 国产成人精品三级| 国产成人亚洲综合a∨猫咪| 激情另类小说区图片区视频区| 日本va欧美va欧美va精品| 日韩在线观看一区二区| 亚洲国产综合视频在线观看| 亚洲精品日韩一| 亚洲女人小视频在线观看| 亚洲视频一二区| 亚洲欧美日韩小说| 一区二区三区中文字幕| 亚洲人成精品久久久久| 亚洲人成精品久久久久久| 亚洲美女屁股眼交3| 亚洲免费观看高清完整版在线| 国产精品理论在线观看| 国产精品剧情在线亚洲| 综合欧美亚洲日本| 一区二区三区影院| 亚洲一区二区3| 天堂资源在线中文精品| 日韩激情视频在线观看| 日产精品久久久久久久性色| 免费久久精品视频| 国内偷窥港台综合视频在线播放| 国产精品一二三四区| 成人avav影音| 欧洲激情一区二区| 欧美一区二区在线看| 精品国产一区二区三区不卡| 久久蜜桃av一区二区天堂| 中文字幕久久午夜不卡| 亚洲色大成网站www久久九九| 亚洲一区二区在线播放相泽|