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

📄 lcd_key.lst

📁 时间触发嵌入式系统设计模式:使用8051系列微控制器开发可靠应用
💻 LST
字号:
C51 COMPILER V6.10  LCD_KEY                                                                04/18/2001 16:29:12 PAGE 1   


C51 COMPILER V6.10, COMPILATION OF MODULE LCD_KEY
OBJECT MODULE PLACED IN .\LCD_KEY.OBJ
COMPILER INVOKED BY: C:\KEIL\C51\BIN\C51.EXE .\LCD_KEY.C OPTIMIZE(6,SIZE) BROWSE NOINTPROMOTE DEBUG OBJECTEXTEND

stmt level    source

   1          /*------------------------------------------------------------------*-
   2          
   3             LCD_Key.C (v1.00)
   4          
   5            ------------------------------------------------------------------
   6          
   7             Simple demonstration function for transferring keypad inputs 
   8             to an LCD display. 
   9          
  10          
  11             COPYRIGHT
  12             ---------
  13          
  14             This code is from the book:
  15          
  16             PATTERNS FOR TIME-TRIGGERED EMBEDDED SYSTEMS by Michael J. Pont 
  17             [Pearson Education, 2001; ISBN: 0-201-33138-1].
  18          
  19             This code is copyright (c) 2001 by Michael J. Pont.
  20           
  21             See book for copyright details and other information.
  22          
  23          -*------------------------------------------------------------------*/
  24          
  25          #include "Main.h"
  26          #include "Keypad.h"
  27          #include "LCD_Key.h"
  28          #include "LCD_A.h"
  29          
  30          // ------ Private variables ----------------------------------------
  31          
  32          static tByte Char_G;
  33          
  34          // ------ Public variable declarations -----------------------------
  35          
  36          extern char LCD_data_G[LCD_LINES][LCD_CHARACTERS+1];
  37          
  38          /*------------------------------------------------------------------*-
  39          
  40            LCD_KEY_Init()
  41          
  42            Init function for simple keypad - LCD library.
  43          
  44          -*------------------------------------------------------------------*/
  45          void LCD_KEY_Init(void)
  46             {
  47   1         tByte c;
  48   1         char* pPrompt = "Type on the keypad:      ";
  49   1      
  50   1         // Clear the keypad buffer
  51   1         KEYPAD_Clear_Buffer();
  52   1         
  53   1         // Prepare the display
  54   1         for (c = 0; c < LCD_CHARACTERS; c++)
  55   1             {
C51 COMPILER V6.10  LCD_KEY                                                                04/18/2001 16:29:12 PAGE 2   

  56   2             LCD_data_G[0][c] = pPrompt[c];
  57   2             LCD_data_G[1][c] = '*';
  58   2             }
  59   1      
  60   1         Char_G = 0;
  61   1         }
  62          
  63          
  64          /*------------------------------------------------------------------*-
  65          
  66            LCD_KEY_Update()
  67          
  68            Function for displaying keypad inputs on LCD display.
  69          
  70          -*------------------------------------------------------------------*/
  71          void LCD_KEY_Update(void)     
  72             {
  73   1         char Key, FnKey;
  74   1      
  75   1         KEYPAD_Update();
  76   1         
  77   1         if (KEYPAD_Get_Data_From_Buffer(&Key, &FnKey) == 0)
  78   1            {
  79   2            // Buffer is empty
  80   2            return;
  81   2            }
  82   1      
  83   1         // Function key has been pressed (with another key)
  84   1         if (FnKey)
  85   1            {
  86   2            LCD_data_G[1][Char_G] = FnKey;
  87   2      
  88   2            if (++Char_G == LCD_CHARACTERS) 
  89   2               {
  90   3               Char_G = 0;
  91   3               }
  92   2            } 
  93   1      
  94   1         LCD_data_G[1][Char_G] = Key;
  95   1            
  96   1         if (++Char_G == LCD_CHARACTERS) 
  97   1            {
  98   2            Char_G = 0;
  99   2            }
 100   1         }
 101          
 102          /*------------------------------------------------------------------*-
 103            ---- END OF FILE -------------------------------------------------
 104          -*------------------------------------------------------------------*/ 


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    111    ----
   CONSTANT SIZE    =     26    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =      1       5
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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