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

📄 com.lst

📁 T103的开发程序 能兼容很多屏 可根据需要修改定义
💻 LST
字号:
C51 COMPILER V8.08   COM                                                                   11/23/2007 00:57:19 PAGE 1   


C51 COMPILER V8.08, COMPILATION OF MODULE COM
OBJECT MODULE PLACED IN .\Object\Com.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE SourceFile\Com.c LARGE BROWSE INCDIR(.\IncludeFile;.\IncludeFile\Panel;.\In
                    -cludeFile\Font_Icon) DEFINE(T108) DEBUG OBJECTEXTEND PRINT(.\List\Com.lst) OBJECT(.\Object\Com.obj)

line level    source

   1          /* ##########################################################################
   2             #                      Terawins Inc. Company                             #
   3             #                 Copyright (c) 2005, All rights reserved                #
   4             #                                                                        #
   5             #  All rights reserved. Reproduction in whole or in parts is prohibited  #
   6             #  without the prior written consent.                                    #
   7             ########################################################################## */
   8             
   9          ////////////////////////////////////////////////////////////////////////////////
  10          //                                                                            //
  11          //                          LCD Application Firmware                          //
  12          // ========================================================================== //
  13          //                                                                            //
  14          //  Module   : Com.c                                                          //
  15          //                                                                            //
  16          //  Purpose  : UART communication routine                                     //
  17          //                                                                            //
  18          //  Version  : 1.00                                                           //
  19          //                                                                            //
  20          //  Compiler : Keil 8051 C Compiler v7.0                                      //
  21          //                                                                            //
  22          //  Reference: [1] Keil C51 Compiler User's Guide 09.2001, Keil Software, Inc.//
  23          //                                                                            //
  24          // ========================================================================== //
  25          //                                                                            //
  26          //  Date        Author        Reason (what and why)                           //
  27          //  ----------- ------------- ----------------------------------------------  //
  28          //  2005/12/30  Bruce Cho     Initial Draft                                   //
  29          //                                                                            //
  30          ////////////////////////////////////////////////////////////////////////////////
  31          #define __COM_C__
  32          
  33          #ifdef __COM_C__
  34          #include "Com.h"
  35          #include "reg51.h"
  36          //#define  _Myson8957_
  37          #include "Myson8957.h"
  38          //#include "ICControl.h"
  39          
  40          
  41          // _____________________________________________________________________________
  42          //
  43          // Private module variables (static module global 's_' prefixed for 's'tatic)
  44          //
  45          char code s_moduleInfo[] = __FILE__ " modified " __DATE__ " at " __TIME__;
  46          
  47          // Ring variables.
  48          //static          uCHAR            RING_MEM_SPACE s_rxRing[RX_RING_SIZE];
  49          uCHAR            RING_MEM_SPACE s_txRing[TX_RING_SIZE];
  50          //static          bit          data           s_translateEol;
  51          //static volatile bit          data           s_rxRingEmpty;
  52          bit           s_txRingEmpty;
  53          //static volatile RxRingIndex   data           s_rxWrIdx;
  54          //static volatile RxRingIndex   data           s_rxRdIdx;
C51 COMPILER V8.08   COM                                                                   11/23/2007 00:57:19 PAGE 2   

  55          TxRingIndex             s_txWrIdx;
  56          TxRingIndex             s_txRdIdx;
  57          //static          UartBaudRates data           s_currentBaudRate;
  58          
  59          //extern static volatile int data s_UartTimeOut;
  60          
  61          //=======================================================================
  62          // Function:  initUart
  63          //
  64          // Description:
  65          // ------------
  66          // Sets up the 8051 Serial Port for UART (SCON.SM1 = 1, Mode 1) operation and
  67          // initializes the ring buffers.
  68          //
  69          // Design Notes:
  70          // -------------
  71          // uCHAR framing is 8-N-1.
  72          //=======================================================================
  73          bit UartInit(void)
  74          {
  75   1      //      IC_WritByte(0x00,0x91,0x87);
  76   1      //      IC_WritByte(0x100,0xb8,0x40);
  77   1      //      IC_WritByte(0x00,0x9d,0xff);
  78   1      
  79   1          // For restartability.
  80   1          ES = 0;
  81   1              TR1=0;
  82   1      
  83   1          // Setup the baud rate generator.
  84   1      //    if (setUartBaudRate(baudRate)) return FALSE;
  85   1      
  86   1          // Setup the serial port.
  87   1          SCON = SCON_8N1 | SCON_REN;
  88   1      //      SCON = 0x50;
  89   1              TMOD=T1_MODE ;      // Timer1 in Mode 2
  90   1      
  91   1              // 砞﹚baudrate=19200
  92   1              PCON |=PCON_SMOD;
  93   1              TH1=TH1_VALUE  ;      // 0xfd:baud rate 9600
  94   1              TL1=TH1_VALUE  ;      // 0xfd:baud rate 9600
  95   1              TR1=1 ;          // Timer1 璓

⌨️ 快捷键说明

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