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

📄 config.h.bak

📁 TG12864A引脚资料
💻 BAK
字号:

#ifndef __CONFIG_H__
#define __CONFIG_H__ 1

#include <avr/io.h>

#define LCD_DATA_PIN  PINC
#define LCD_DATA_DDR DDRC
#define LCD_DATA PORTC
#define LCD_DI    7
#define LCD_RW  6
#define LCD_E     5
#define LCD_CS1 4
#define LCD_CS2 3
#define LCD_RST  2

#define set_bit(sfr,bit)  sfr |= _BV(bit)
#define clr_bit(sfr,bit)   sfr &= ~_BV(bit)

#define set_LCD_DI  set_bit(PORTD,LCD_DI)
#define clr_LCD_DI  clr_bit(PORTD,LCD_DI)

#define set_LCD_RW  set_bit(PORTD,LCD_RW)
#define clr_LCD_RW  clr_bit(PORTD,LCD_RW)

#define set_LCD_E  set_bit(PORTD,LCD_E)
#define clr_LCD_E  clr_bit(PORTD,LCD_E)

#define set_LCD_CS1  set_bit(PORTD,LCD_CS1)
#define clr_LCD_CS1  clr_bit(PORTD,LCD_CS1)

#define set_LCD_CS2  set_bit(PORTD,LCD_CS2)
#define clr_LCD_CS2  clr_bit(PORTD,LCD_CS2)

#define set_LCD_RST  set_bit(PORTD,LCD_RST)
#define clr_LCD_RST  clr_bit(PORTD,LCD_RST)

#define SELECT_LEFT {set_LCD_CS1;clr_LCD_CS2;}
#define SELECT_RIGHT {set_LCD_CS2;clr_LCD_CS1;}
#define SELECT_ALL {set_LCD_CS1; set_LCD_CS2;}

#define IO_init() {PORTC = 0xff;\
                            PORTD = 0xdf;\
                            DDRC = 0xff;\
                            DDRD = 0xff;}

#endif

⌨️ 快捷键说明

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