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

📄 hz_disp.lst

📁 SCM中LCM的汉字显示技巧,可以2*6=12共计个字符.
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V8.02   HZ_DISP                                                               04/09/2008 21:44:53 PAGE 1   


C51 COMPILER V8.02, COMPILATION OF MODULE HZ_DISP
OBJECT MODULE PLACED IN hz_disp.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE hz_disp.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include <REGX51.H>
   2          #include <absacc.h> //解析XBYTE 宏定义
   3          #define GLCD_OFF         62      //03eh
   4          #define GLCD_ON          63      //03fh
   5          #define GLCD_START_LINE_0 192 //0c0h means display on lcm from 0 sites.
   6          #define SET_PAGE 184         //0b8h means page numbers are set as000 (x is),so,all operation on lcm armed 
             -this page.
   7          #define SET_Y_ADDRESS_0  64  //040h
   8          #define CLEAR   0
   9          #define ENABLE 1
  10          #define DISABLE 0
  11          #define READ 1
  12          #define WRITE 0
  13          #define COMMAND 0
  14          #define DATA 1
  15          #define GLCD_RESET P2_2
  16          #define GLCD_CS2 P2_3
  17          #define GLCD_CS1 P2_4
  18          #define GLCD_D_I P2_5
  19          #define GLCD_R_W P2_6
  20          #define GLCD_ENABLE P2_7
  21          typedef struct{
  22             char hour;
  23             char minute;
  24             char second;
  25             } time;
  26          typedef struct{
  27             char year;
  28             char month;
  29             char day;
  30             } date;
  31          time now;
  32          date today;
  33          unsigned char gx,gy;
  34          static unsigned timer0_tick;
  35          char code int2char[]="0123456789";
  36          char code monthday[]={31,28,31,30,31,30,31,31,30,31,30,31};
  37          char code weekday[7][4]={"MON","TUE","WED","THU","FRI","SAT","SUN"};
  38          unsigned char code digit[10][4][8]=                     
  39           //0
  40          {{
  41          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
  42          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
  43          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
  44          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
  45           //1
  46          {
  47          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
  48          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
  49          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
  50          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
  51           //2
  52          {
  53          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
  54          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
C51 COMPILER V8.02   HZ_DISP                                                               04/09/2008 21:44:53 PAGE 2   

  55          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
  56          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
  57           //3
  58          {
  59          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
  60          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
  61          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
  62          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
  63           //4
  64          {
  65          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
  66          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
  67          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
  68          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
  69           //5
  70          {
  71          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
  72          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
  73          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
  74          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
  75           //6
  76          {
  77          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
  78          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
  79          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
  80          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
  81           //7
  82          {
  83          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
  84          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
  85          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
  86          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
  87           //8
  88          {
  89          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
  90          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
  91          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
  92          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
  93           //9
  94          {
  95          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
  96          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
  97          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
  98          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}}};
  99          unsigned char code slash[4][8]=                 
 100          {
 101          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 102          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 103          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 104          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}};
 105          unsigned char code comma[4][8]=                 
 106          {
 107          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 108          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 109          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 110          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}};
 111          unsigned char code space[4][8]=                 
 112          {
 113          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 114          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 115          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 116          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}};
C51 COMPILER V8.02   HZ_DISP                                                               04/09/2008 21:44:53 PAGE 3   

 117           //年
 118          unsigned char code yearp[4][8]=                 
 119          {
 120          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 121          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 122          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 123          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}};
 124           //星
 125          unsigned char code weekp[2][4][8]=                      
 126          {{
 127          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 128          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 129          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 130          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
 131           //期
 132          {
 133          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 134          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 135          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 136          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}}};
 137          unsigned char code weekdayp[7][4][8]=                   
 138          {{
 139          //一
 140          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 141          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 142          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 143          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
 144          //二
 145          {
 146          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 147          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 148          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 149          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
 150          //三
 151          {
 152          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 153          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 154          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 155          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
 156          //四
 157          {
 158          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 159          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 160          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 161          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
 162          //五
 163          {
 164          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 165          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 166          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 167          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
 168          //六
 169          {
 170          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 171          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 172          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 173          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
 174          //日
 175          {
 176          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 177          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 178          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
C51 COMPILER V8.02   HZ_DISP                                                               04/09/2008 21:44:53 PAGE 4   

 179          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}}};
 180          //月
 181          unsigned char code monthp[4][8]=                        
 182          {
 183          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 184          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 185          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 186          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}};
 187          unsigned char code token[7][4][8]=                      
 188          {{
 189          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 190          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 191          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 192          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
 193          //现
 194          {
 195          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},
 196          {0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80},
 197          {0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80},
 198          {0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}},
 199          //在
 200          {
 201          {0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80},

⌨️ 快捷键说明

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