⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 glcd.c

📁 采用AVR单片机制作的低成本LCD示波器资料和源码
💻 C
字号:


/* As graphic LCD used the DEM128064A model (128x64 pixels).

   Created by Serasidis Vassilis and finished at 03.Aug.2007
   Home: http://www.serasidis.gr
   e-mail: info@serasidis.gr and avrsite@yahoo.gr

   This code is ditributed under GPL licence.
*/

#include "glcd.h"

void glcdInit (void)
{		 
		data_port_pins = 0;		//DATA Port Low
		data_port_ddr = 0xff;	//Make DATA port output

		ctrl_port = 0;			//CONTROL Port Low
		ctrl_port_ddr = 0xff;	//Make CONTROL port outputs

		ctrl_port |= (1<<lcdrst);
		ctrl_port |= (1<<lcdcs1);		 //Enable the CS1 of the display 
        ctrl_port |= (1<<lcdcs2);		 //Enable the CS2 of the display
        ctrl_port &= ~(1<<lcdrs);        //Clear RS  \_
        ctrl_port &= ~(1<<lcdrw);        //Clear RW  /  Command mode

		delayTime(10000);
		data_port = 0b11000000;		 //Display start line = 0 (0-63)
        eStrobe();
	 

		delayTime(10000);
        data_port = 0b01000000;		 //Set address = 0 (0-63)
        eStrobe();

		delayTime(10000);
        data_port = 0b10111000;		 //Set page = 0 (0-7)
        eStrobe();

		delayTime(10000);
        data_port = 0b00111111;		 //Display ON 
        eStrobe();

        ctrl_port &= ~(1<<lcdcs1);	 //Disable the CS1 of display 
        ctrl_port &= ~(1<<lcdcs2);	 //Disable the CS2 of display

		createRaster(); // 溺扉稞胥珞

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -