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

📄 lcd.c

📁 nios 环境下12864液晶驱动程序
💻 C
📖 第 1 页 / 共 2 页
字号:
#include "system.h"
#include "altera_avalon_pio_regs.h"
#include "alt_types.h"
#include <stdio.h>

#include "lcd.h"

#define     LCD_DATA    1
#define     LCD_COMM    0
#define     LCD_TIME   60

alt_u8 Bmp_Blank[1024] =
{
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};

alt_u8 Bmp_World[1024] =
{
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x07,0xFB,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x1F,0xF3,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0xFF,0xE7,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x07,0xFF,0xDF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x3F,0xFF,0x9F,0xFF,0xFC,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0xFF,0xFF,0x1F,0xFF,0xFC,0x00,0x00,0x00,0x3C,0x01,0xFC,0x00,0x00,
      0x00,0x00,0x01,0xFF,0xFF,0x01,0xFF,0xFC,0x00,0x00,0x00,0x60,0x07,0xFC,0x00,0x00,
      0x00,0x00,0x01,0xFF,0xFF,0xC0,0xFF,0xF8,0x00,0x00,0x00,0xC2,0x3F,0xE0,0x01,0x80,
      0x00,0x10,0x00,0xFF,0xFF,0xE0,0xFF,0xF8,0x00,0x00,0x00,0xC7,0xFF,0xFF,0xFB,0xC0,
      0x00,0x7F,0xF8,0x7F,0xFF,0xF8,0xFF,0xF0,0x00,0x1F,0x80,0x6F,0xFF,0xFF,0xFF,0xFE,
      0xF0,0xFF,0xFF,0xFF,0xFE,0xFC,0x7F,0xE0,0x00,0x7F,0xF3,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFC,0xFF,0xFF,0xFF,0xFE,0xFE,0x7F,0xC3,0x00,0x7F,0xEF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFE,0xFF,0xFF,0xFF,0xFE,0xFC,0x7E,0x0F,0x00,0xF7,0x9F,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xC0,0xFF,0xFF,0xFF,0xF6,0x18,0x3C,0x07,0x01,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xC0,0xFF,0xFF,0xFF,0xE0,0xE0,0x1C,0x00,0x03,0xCD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0x00,0x7E,0xFF,0xFF,0xE0,0xFC,0x00,0x00,0x03,0xE1,0xFF,0xFF,0xFF,0xFF,0xFF,0xF9,
      0x00,0x38,0x1F,0xFF,0xF8,0xFE,0x00,0x00,0x20,0x6F,0xFF,0xFF,0xFF,0xFF,0xFF,0x03,
      0x00,0x70,0x0F,0xFF,0xFC,0xFE,0x00,0x00,0x31,0x0F,0xFF,0xFF,0xFF,0xFF,0xFC,0x07,
      0x00,0x80,0x0F,0xFF,0xFE,0xFF,0x00,0x00,0xD9,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x06,
      0x00,0x00,0x07,0xFF,0xFF,0xFF,0x80,0x00,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x04,
      0x00,0x00,0x03,0xFF,0xFF,0xFE,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,
      0x00,0x00,0x01,0xFF,0xFF,0xF8,0x00,0x00,0x0F,0xFF,0xBF,0xFF,0xFF,0xFF,0xFE,0x38,
      0x00,0x00,0x01,0xFF,0xFF,0xF0,0x00,0x00,0x0F,0xDE,0x1E,0x5F,0xFF,0xFF,0xFC,0x00,
      0x00,0x00,0x01,0xFF,0xFF,0xF0,0x00,0x00,0x7C,0x4E,0xCE,0xCF,0xFF,0xFF,0xF9,0xC0,
      0x00,0x00,0x01,0xFF,0xFF,0xC0,0x00,0x00,0x30,0x2F,0xFE,0xFF,0xFF,0xFF,0xE1,0x80,
      0x00,0x00,0x00,0xFF,0xFF,0xC0,0x00,0x00,0x27,0x0D,0xFE,0x7F,0xFF,0xFF,0xB3,0x00,
      0x00,0x00,0x00,0x7F,0xFF,0x80,0x00,0x00,0x1F,0x80,0x7F,0xFF,0xFF,0xFF,0x2F,0x00,
      0x00,0x00,0x00,0x7F,0xFF,0x00,0x00,0x00,0x3F,0xD8,0x7F,0xFF,0xFF,0xFF,0x8C,0x00,
      0x18,0x00,0x00,0x3F,0xE3,0x00,0x00,0x00,0x7F,0xFF,0xBF,0xFF,0xFF,0xFF,0x81,0x00,
      0x10,0x00,0x00,0x1F,0xC1,0x40,0x00,0x00,0xFF,0xFF,0x9E,0x3F,0xFF,0xFF,0x00,0x80,
      0x03,0x80,0x00,0x0F,0x80,0x00,0x00,0x01,0xFF,0xFF,0xDE,0x83,0xFB,0xFE,0x80,0x80,
      0x01,0xF8,0x00,0x03,0xCB,0x80,0x00,0x01,0xFF,0xFF,0xCF,0xC3,0xFB,0xFC,0x00,0x00,
      0x00,0x08,0x00,0x01,0xF8,0x18,0x00,0x01,0xFF,0xFF,0xEF,0xC1,0xE3,0xE1,0x00,0x00,
      0x00,0x00,0x00,0x00,0x7C,0x06,0x00,0x01,0xFF,0xFF,0xE7,0x01,0xC1,0xF0,0x00,0x00,
      0x00,0x00,0x00,0x00,0x1C,0x30,0x00,0x01,0xFF,0xFF,0xF0,0x01,0xC1,0xB8,0x00,0x00,
      0x00,0x00,0x00,0x00,0x07,0xFF,0x00,0x00,0xFF,0xFF,0xFE,0x00,0x80,0xA0,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x7F,0xFF,0xFE,0x00,0x00,0xC2,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x03,0xFF,0xFC,0x00,0x01,0xE7,0x00,0x00,
      0x00,0x00,0x00,0x00,0x01,0xFF,0xC0,0x00,0x00,0xFF,0xF8,0x00,0x00,0xC7,0x40,0x00,
      0x00,0x00,0x00,0x00,0x01,0xFF,0xF8,0x00,0x01,0xFF,0xF0,0x00,0x00,0x6F,0x4E,0x00,
      0x00,0x00,0x00,0x00,0x01,0xFF,0xFE,0x00,0x00,0xFF,0xF0,0x00,0x00,0x30,0xCF,0xC0,
      0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x7F,0xE0,0x00,0x00,0x1C,0x07,0xE0,
      0x00,0x00,0x00,0x00,0x00,0xFF,0xFE,0x00,0x00,0x7F,0xF0,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x00,0x00,0x7F,0xF2,0x00,0x00,0x00,0x1C,0x80,
      0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x00,0x00,0x7F,0xF6,0x00,0x00,0x00,0x3E,0xC0,
      0x00,0x00,0x20,0x00,0x00,0x1F,0xFE,0x00,0x00,0x7F,0xCE,0x00,0x00,0x00,0xFF,0xE0,
      0x00,0x00,0x30,0x00,0x00,0x1F,0xFC,0x00,0x00,0x7F,0xCC,0x00,0x00,0x03,0xFF,0xF0,
      0x00,0x00,0x04,0x00,0x00,0x1F,0xF8,0x00,0x00,0x7F,0xC4,0x00,0x00,0x07,0xFF,0xF0,
      0x00,0x00,0x04,0x00,0x00,0x1F,0xF0,0x00,0x00,0x3F,0x80,0x00,0x00,0x03,0xFF,0xF0,
      0x00,0x00,0x00,0x00,0x00,0x3F,0xE0,0x00,0x00,0x3F,0x00,0x00,0x00,0x03,0xFF,0xF0,
      0x00,0x00,0x00,0x00,0x00,0x3F,0xC0,0x00,0x00,0x1E,0x00,0x00,0x00,0x01,0xEF,0xF0,
      0x00,0x00,0x00,0x00,0x00,0x3F,0x80,0x00,0x00,0x0E,0x00,0x00,0x00,0x03,0xC7,0xE0,
      0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xE0,
      0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};

unsigned char Lcd_Char_Add[32] = {
        0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
        0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F  };
        
unsigned char Lcd_Num_Code[11] = { 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xAE };

alt_u8 Lcd_Bmp_Common[64][16]; // 普通页面
alt_u8 Lcd_Bmp_Circle[64][16]; // 循环显示页面

// 公共函数

void Lcd_Init( void ) // LCD初始化
{
    alt_u8 i,j;
    
    for( i=0; i<64; i++ )
        for( j=0; j<16; j++ )
            Lcd_Bmp_Common[i][j] = 0x00,
            Lcd_Bmp_Circle[i][j] = 0x00;   
    
    IOWR_ALTERA_AVALON_PIO_DATA( LCD_RST_BASE, 0xff );
    IOWR_ALTERA_AVALON_PIO_DIRECTION( LCD_DATA_BASE, 0xFF );
    Lcd_Command( LCD_COMM, 0x30 );
    Lcd_Command( LCD_COMM, 0x01 );
    Lcd_Delay();
    Lcd_Command( LCD_COMM, 0x06 );
    Lcd_Command( LCD_COMM, 0x0C );
}

void Lcd_Cn( unsigned char *cn ) // LCD显示页面
{
    unsigned char i;
    Lcd_Command( LCD_COMM, 0x30 );
    Lcd_Command( LCD_COMM, 0x80 ); 
    for( i=0; i<16; i++ )
        Lcd_Command( LCD_DATA, cn[0+i] );
    
    Lcd_Command( LCD_COMM, 0x30 );
    Lcd_Command( LCD_COMM, 0x90 ); 
    for( i=0; i<16; i++ )
        Lcd_Command( LCD_DATA, cn[16+i] );
    
    Lcd_Command( LCD_COMM, 0x30 );
    Lcd_Command( LCD_COMM, 0x88 );
    for( i=0; i<16; i++ )
        Lcd_Command( LCD_DATA, cn[32+i] );
    
    Lcd_Command( LCD_COMM, 0x30 );
    Lcd_Command( LCD_COMM, 0x98 );
    for( i=0; i<16; i++ )
        Lcd_Command( LCD_DATA, cn[48+i] );
}

void Lcd_Bmp( unsigned char *img ) // 显示图形页面
{
    unsigned char i,j;
    unsigned char x1 = 0x80, x2 = 0x88, y = 0x80;
    for( j=0; j<32; j++ ) 
        for( i=0; i<8; i++ ) {
            Lcd_Command( LCD_COMM, 0x34 );
            Lcd_Command( LCD_COMM, y+j );
            Lcd_Command( LCD_COMM, x1+i );
            Lcd_Command( LCD_COMM, 0x30 );
            Lcd_Command( LCD_DATA, img[j*16+i*2] ); 
            Lcd_Command( LCD_DATA, img[j*16+i*2+1] );
    }
    for( j=32; j<64; j++ )
        for( i=0; i<8; i++ ) {
            Lcd_Command( LCD_COMM, 0x34 );
            Lcd_Command( LCD_COMM, y+j-32 );
            Lcd_Command( LCD_COMM, x2+i );
            Lcd_Command( LCD_COMM, 0x30 );
            Lcd_Command( LCD_DATA, img[j*16+i*2] );
            Lcd_Command( LCD_DATA, img[j*16+i*2+1] );
    }
    Lcd_Command( LCD_COMM, 0x36 );
}

void Lcd_Xy_Num( unsigned char x, unsigned char y, unsigned char z ) // LCD在XY显示键值
{

⌨️ 快捷键说明

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