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

📄 asc0.lst

📁 开发环境为keil166
💻 LST
📖 第 1 页 / 共 2 页
字号:
  182  1        // USER CODE BEGIN (ASC0_Function,3)
  183  1      
  184  1        // USER CODE END
  185  1      
  186  1        ASC0_CON      |=  0x8000;      // enable baud rate generator
  187  1      
  188  1      
  189  1      } //  End of function ASC0_vInit
  190         
  191         
  192         //****************************************************************************
  193         // @Function      void ASC0_vSendData(uword uwData) 
  194         //
  195         //----------------------------------------------------------------------------
  196         // @Description   This function writes a send data initialization word into 
  197         //                the transmit buffer register.
  198         //                
  199         //                Note: 
  200         //                In a multiprocessor system the master with this function 
  201         //                has the possibility to send data to the selected slave. To 
  202         //                achieve this, the 9th bit must set on zero.
  203         //
  204         //----------------------------------------------------------------------------
  205         // @Returnvalue   None
  206         //
  207         //----------------------------------------------------------------------------
  208         // @Parameters    uwData: 
  209         //                Data to be send
  210         //
  211         //----------------------------------------------------------------------------
  212         // @Date          2009-4-4
  213         //
  214         //****************************************************************************
  215         
  216         // USER CODE BEGIN (SendData,1)
  217         
  218         // USER CODE END
  219         
  220         void ASC0_vSendData(uword uwData)
  221         {
  222  1        ASC0_TBIC_IR = 0;        //  reset transmit buffer interrupt request 
  223  1        ASC0_TBUF    = uwData;   //  load transmit buffer register
  224  1      
  225  1      } //  End of function ASC0_vSendData
  226         
  227         
  228         //****************************************************************************
  229         // @Function      uword ASC0_uwGetData(void) 
  230         //
  231         //----------------------------------------------------------------------------
  232         // @Description   This function reads out the content of the receive buffer 
  233         //                register which contains the received data.
  234         //
  235         //----------------------------------------------------------------------------
  236         // @Returnvalue   data that has been received
  237         //
  238         //----------------------------------------------------------------------------
  239         // @Parameters    None
  240         //
  241         //----------------------------------------------------------------------------
C166 COMPILER V6.04, ASC0                                                                  04/06/2009 22:15:29 PAGE 5   

  242         // @Date          2009-4-4
  243         //
  244         //****************************************************************************
  245         
  246         // USER CODE BEGIN (GetData,1)
  247         
  248         // USER CODE END
  249         
  250         uword ASC0_uwGetData(void)
  251         {
  252  1        return(ASC0_RBUF);     // return receive buffer register
  253  1      
  254  1      } //  End of function ASC0_uwGetData
  255         
  256         
  257         //****************************************************************************
  258         // @Function      void ASC0_viRx(void) 
  259         //
  260         //----------------------------------------------------------------------------
  261         // @Description   This is the receive interrupt service routine for the ASC0. 
  262         //                It is called if the data has been received. 
  263         //                Please note that you have to add application specific code 
  264         //                to this function.
  265         //
  266         //----------------------------------------------------------------------------
  267         // @Returnvalue   None
  268         //
  269         //----------------------------------------------------------------------------
  270         // @Parameters    None
  271         //
  272         //----------------------------------------------------------------------------
  273         // @Date          2009-4-4
  274         //
  275         //****************************************************************************
  276         
  277         // USER CODE BEGIN (Rx,1)
  278         unsigned char i=0;
  279         // USER CODE END
  280         
  281         void ASC0_viRx(void) interrupt ASC0_RINT
  282         {
  283  1      
  284  1        // USER CODE BEGIN (Rx,2)
  285  1        
  286  1        unsigned char rec;
  287  1        rec = ASC0_uwGetData();                         //rec_data[1,2]-->radius;recdata[3,4]-->vehicle velocity
*** WARNING C192 IN LINE 287 OF ASC0.C: '=': value truncated
  288  1        if (rec == 0xaf)
  289  1            i=0;
  290  1        rec_data[i]=rec;
  291  1        i++;
  292  1        if ((rec == 0xbf)&&(i == 6))
  293  1           { i=0;
  294  2                 asc0_rec=1;
  295  2                }
  296  1      
  297  1        // USER CODE END
  298  1      
  299  1      } //  End of function ASC0_viRx
  300         
  301         
  302         //****************************************************************************
C166 COMPILER V6.04, ASC0                                                                  04/06/2009 22:15:29 PAGE 6   

  303         // @Function      ubyte ASC0_ubTxDataReady(void) 
  304         //
  305         //----------------------------------------------------------------------------
  306         // @Description   This function can be used for checking up the status of the 
  307         //                ASC0 transmit interrupt flags. This shows when the sending 
  308         //                of data has terminated. By continuously polling this flag 
  309         //                after the function ASC0_vSendData has been called, it is 
  310         //                possible to establish when the ASC0 has terminated its task.
  311         //
  312         //----------------------------------------------------------------------------
  313         // @Returnvalue   0 if transmitter is busy, else 1
  314         //
  315         //----------------------------------------------------------------------------
  316         // @Parameters    None
  317         //
  318         //----------------------------------------------------------------------------
  319         // @Date          2009-4-4
  320         //
  321         //****************************************************************************
  322         
  323         // USER CODE BEGIN (TxDataReady,1)
  324         
  325         // USER CODE END
  326         
  327         ubyte ASC0_ubTxDataReady(void)
  328         {
  329  1        ubyte ubReturnValue;
  330  1      
  331  1        ubReturnValue = 0;
  332  1      
  333  1        if(ASC0_TIC_IR)               // if sending of data is terminated
  334  1        {
  335  2          ubReturnValue = 1;
  336  2          ASC0_TIC_IR   = 0;
  337  2        }
  338  1        return(ubReturnValue);         // return receive buffer register
  339  1      
  340  1      } //  End of function ASC0_ubTxDataReady
  341         
  342         
  343         
  344         
  345         // USER CODE BEGIN (ASC0_General,10)
  346         
  347         // USER CODE END
  348         


MODULE INFORMATION:   INITIALIZED  UNINITIALIZED
  CODE SIZE        =         158     --------
  NEAR-CONST SIZE  =    --------     --------
  FAR-CONST SIZE   =    --------     --------
  HUGE-CONST SIZE  =    --------     --------
  XHUGE-CONST SIZE =    --------     --------
  NEAR-DATA SIZE   =           1     --------
  FAR-DATA SIZE    =    --------     --------
  XHUGE-DATA SIZE  =    --------     --------
  IDATA-DATA SIZE  =    --------     --------
  SDATA-DATA SIZE  =    --------     --------
  BDATA-DATA SIZE  =    --------     --------
  HUGE-DATA SIZE   =    --------     --------
  BIT SIZE         =    --------     --------
C166 COMPILER V6.04, ASC0                                                                  04/06/2009 22:15:29 PAGE 7   

  INIT'L SIZE      =           6     --------
END OF MODULE INFORMATION.


C166 COMPILATION COMPLETE.  1 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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