📄 lcd_portconfig.h
字号:
#ifndef __LCD_PORTCONFIG_h__
#define __LCD_PORTCONFIG_h__
// write your header here
// this file for MCU I/O port or the orther`s hardware config
// for LCD Display
#include "msp430x16x.h"
#define COM_R_ADDR (unsigned char xdata *)0x8000
#define COM_W_ADDR (unsigned char xdata *)0x8000
#define DAT_R_ADDR (unsigned char xdata *)0xA000
#define DAT_W_ADDR (unsigned char xdata *)0xA000
//sbit LCD_CS = P3^2;
//sbit LCD_RS = P3^3;
//sbit LCD_WR = P3^4;
//sbit LCD_RD = P3^5;
//sbit LCD_Reset = P3^0;
//sbit LCD_ON = P1^6; //LCD背光灯控制开关
#define _nop_() _NOP()
#define LCD_PORT_CTL P5OUT
#define LCD_PORT_CTL_DIR P5DIR
#define LCD_PORT_DATA_IN P4IN
#define LCD_PORT_DATA_OUT P4OUT
#define LCD_PORT_DATA_DIR P4DIR
#define LCD_CS BIT0
#define LCD_Reset BIT1
#define LCD_RS BIT2
#define LCD_WR BIT3
#define LCD_RD BIT4
#define LCD_ON BIT5
#define SETBIT(PORT,bit) PORT|=bit //bit必须为只有一位为1的字节数据:0x01、0x02、0x04、0x08等
#define CLRBIT(PORT,bit) PORT&=~bit
#define SETBIT_LCDCTL(bit) SETBIT(LCD_PORT_CTL,bit)
#define CLRBIT_LCDCTL(bit) CLRBIT(LCD_PORT_CTL,bit)
/*
//Define the MCU Register
// IO port control registers
#define P_IOA_Data (volatile unsigned int *)0x7000
#define P_IOA_Buffer (volatile unsigned int *)0x7001
#define P_IOA_Dir (volatile unsigned int *)0x7002
#define P_IOA_Attrib (volatile unsigned int *)0x7003
#define P_IOA_Latch (volatile unsigned int *)0x7004
#define P_IOB_Data (volatile unsigned int *)0x7005
#define P_IOB_Buffer (volatile unsigned int *)0x7006
#define P_IOB_Dir (volatile unsigned int *)0x7007
#define P_IOB_Attrib (volatile unsigned int *)0x7008
// Define for the port use by LCD Driver
#define LCD_Reset 0x1000
#define LCD_CS 0x0800
#define LCD_RS 0x0400
#define LCD_Write 0x0200
#define LCD_Read 0x0100
#define LCD_CMD_Dir P_IOB_Dir
#define LCD_CMD_Attrib P_IOB_Attrib
#define LCD_CMD_Buffer P_IOB_Buffer
#define LCD_Data_BUS_Out P_IOB_Buffer
#define LCD_Data_BUS_In P_IOB_Data
#define LCD_Data_BUS_Dir P_IOB_Dir
#define LCD_Data_BUS_Attrib P_IOB_Attrib
#define LCD_Data_BUS_Byte 0//1
*/
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -