📄 lcdiof.h
字号:
// ------------------------ Header file for lcdiof.c ---------------------------
// ----------------------- Common I/O functions for LCD ------------------------
#ifndef __LCD_DATA__IO__
#define __LCD_DATA__IO__
// ------------------------ Interface Selection --------------------------------
#define LCD_8BIT // Parallel interface
#define MCU_6800 // 6800 MCU 8-bit Parallel
//#define MCU_8080 // 8080 MCU 8-bit Parallel
//#define LCD_4SPI // 4-wire SPI(A-Type)(S8)
//#define LCD_3SPI // 3-wire SPI(S9)
// --------------------------- Pins Definition ---------------------------------
// Common Pins for all interface(IC Specific!)
//#define __PORT_CONFIG__
#ifdef __PORT_CONFIG__
#define IC_BM1 P3_5 // BM1~BM0: HH[MCU6800],HL[MCU8080],LH[3SPI],LL[4SPI]
#define IC_BM0 P3_6
#endif
#define LCD_DataPort P1
// Special Pins for the specific interface
#ifdef MCU_6800
// 6800 MCU 8-bit Parallel
#define LCD_CS P3_3 // Chip Selection (High Effective)
#define LCD_RST P3_4 // Reset (Low Effective)
#define LCD_A0 P3_0 // Data/Command Register Selection
#define LCD_RW P3_1 // Read/Write
#define LCD_E P3_2 // Enable R/W (High Effective)
#elif defined(MCU_8080)
// 8080 MCU 8-bit Parallel
#define LCD_CS P3_0 // Chip Selection (low Effective)
#define LCD_RST P3_1 // Reset (Low Effective)
#define LCD_A0 P3_2 // Data/Command Register Selection
#define LCD_WR P3_3 // Read/Write
#define LCD_RD P3_4 // Enable R/W (High Effective)
#elif defined(LCD_4SPI)
// 4-wire SPI(A-Type)
#define SPI_SCL P3_3 // Serial Clock
#define SPI_SDA P3_4 // Serial Instructions and data
#define SPI_A0 P3_2 // Data/Command Register Selection
#define SPI_CS P3_0 // Chip Selection (Low Effective)
#define LCD_RST P3_1 // Reset (Low Effectuve)
#include "spi.h"
#elif defined(LCD_3SPI)
// 3-wire SPI
#define SPI_SCL P1_0 // Serial Clock
#define SPI_SDA P1_3 // Serial Instructions and data
#define SPI_CS P3_0 // Chip Selection (Low Effective)
#define LCD_RST P3_1 // Reset (Low Effectuve)
#include "spi.h"
#endif
// -----------------------------------------------------------------------------
// -------------------------- Constants definition -----------------------------
#define iDat 1
#define iCmd 0
// -----------------------------------------------------------------------------
// --------------------------- Functions Declaration ---------------------------
#ifdef __PORT_CONFIG__
// Port configuration of MCU
void PortConfig(void);
#endif
// Reset LCD
void LCD_Reset(void);
// Send a data or command to LCD
void SendByte(bit DatCmd, uint8 dByte);
// -----------------------------------------------------------------------------
#include "lcdiof.c"
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -