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

📄 slave.lst

📁 是关于KeilC下串口Baudrat设定的。
💻 LST
字号:
C51 COMPILER V7.50   SLAVE                                                                 12/13/2005 13:14:02 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE SLAVE
OBJECT MODULE PLACED IN .\OBJ\slave.obj
COMPILER INVOKED BY: c:\Program Files\C51\BIN\C51.EXE C\slave.c BROWSE DEBUG OBJECTEXTEND PRINT(.\LST\slave.lst) OBJECT(
                    -.\OBJ\slave.obj)

line level    source

   1          /*------------------------------------------------------------------------------
   2          ;  This file is part of the RLC instruction
   3          ;  Copyright (c)
   4          ;  Version: 1.0 
   5          ;-------------------------------------------------------------------------------
   6          ;  Filename:
   7          ;  main.c
   8          ;  Function:   
   9          ;
  10          ;  Author:
  11          ;  pirate
  12          ;     
  13          ;  Writedate:
  14          ;  Oct.15 2005
  15          ;  Moddate(latest):
  16          ;  Oct.15 2005
  17          ;-------------------------------------------------------------------------------
  18          */
  19          
  20          //--------------------------------------
  21          // Included files
  22          //--------------------------------------
  23          #include <reg51.h>
  24          #include ".\HEAD\dtype.h"
  25          #include ".\HEAD\externf.h"
  26          #include ".\HEAD\sdefine.h"
  27          
  28          //--------------------------------------
  29          // Local Definitions and Types
  30          //--------------------------------------
  31          
  32          //! the table data
  33          const uchar sequence[] =
  34          {
  35              0x81, 0x55,
  36                  0x42, 0xC3
  37          };
  38          
  39          
  40          // struct data
  41          struct date {
  42              uint year;
  43                  uchar month, day;
  44          };
  45          
  46          /*******************************************************************************
  47          /*   
  48          //   Function:    char shift control
  49          //
  50          //!  Description: 
  51          //!               - After a reset and power cycle the crystal is given time to
  52          //!               settle and then it comes out of reset and then the radio is
  53          //!               configured
  54          //!
C51 COMPILER V7.50   SLAVE                                                                 12/13/2005 13:14:02 PAGE 2   

  55          //!  Inputs:      None
  56          //!
  57          //!  Returns:     newdata
  58          /*
  59          /*******************************************************************************
  60          /*/
  61          void shiftchar()
  62          {
  63   1          
  64   1          uchar i, j;
  65   1          uchar xdata *p = 0x0020;
  66   1              uchar data *x = 0x20;
  67   1              uchar v;
  68   1      
  69   1      //      nop();
  70   1              // define a struct var
  71   1          struct date Bursday = {1979, 01, 05};
  72   1              
  73   1          for(i = 0; 4 > i; ++i)
  74   1              {
  75   2                 *p = sequence[i];
  76   2                 ++p;
  77   2              }
  78   1      
  79   1              Nop(1);
  80   1      
  81   1              *x = 0x33;
  82   1              // shift the value of ACC
  83   1              ACC = Bursday.month;
  84   1              ACC = 0xFF;
  85   1              v = ACC;
  86   1              for(j = 0; 8 > j; ++j)
  87   1              {
  88   2                v = v & PARAM;
  89   2                *x = v;
  90   2                v = v << 1;
  91   2                ++x;
  92   2              }
  93   1              *x = 0x99;
  94   1      }
  95          
  96          /*******************************************************************************
  97          /*   
  98          //   Function:    test time of the C instruction
  99          //
 100          //!  Description: 
 101          //!               - After a reset and power cycle the crystal is given time to
 102          //!               settle and then it comes out of reset and then the radio is
 103          //!               configured
 104          //!
 105          //!  Inputs:      x
 106          //!
 107          //!  Returns:     newdata
 108          /*
 109          /*******************************************************************************
 110          /*/
 111          void test()
 112          {
 113   1          TEST_PIN = ~TEST_PIN;
 114   1      }
 115          
 116          /*******************************************************************************
C51 COMPILER V7.50   SLAVE                                                                 12/13/2005 13:14:02 PAGE 3   

 117          /*   
 118          //   Function:    read & write SPI interface
 119          //
 120          //!  Description: 
 121          //!               - After a reset and power cycle the crystal is given time to
 122          //!               settle and then it comes out of reset and then the radio is
 123          //!               configured
 124          //!
 125          //!  Inputs:      dev, address, data
 126          //!
 127          //!  Returns:     newdata
 128          /*
 129          /*******************************************************************************
 130          /*/
 131          
 132          /*
 133          uchar spi_access(SPI_DEVICE dev, uchar address, uchar data)
 134          {
 135          #ifdef RADIO_NON_BLOCKING_CALLS
 136              uchar isr_state = GPIO_ISR_RADIO_IE_PORT;
 137          
 138              RADIO_ISR_DISABLE();
 139          #endif // RADIO_NON_BLOCKING_CALLS
 140          
 141              // Turn high-z back on for MISO
 142              PRT1DM1 = PORT_1_DRIVE_1;
 143          
 144                  // assert the slave select
 145              if( dev == SPI_RADIO )
 146              {
 147                  RADIO_PORT &= ~N_SS;
 148              }
 149              else
 150              {
 151                          return(0x00);
 152              }
 153                  
 154              // write the select address
 155                  SPIM_TX_BUFFER_REG = address;
 156          
 157              while(!(SPIM_CONTROL_REG & SPIM_SPI_COMPLETE));
 158                  
 159              // read the data
 160                  SPIM_TX_BUFFER_REG = data;
 161          
 162              while(!(SPIM_CONTROL_REG & SPIM_SPI_COMPLETE));
 163          
 164                  // deassert the slave select
 165              if( dev == SPI_RADIO )
 166              {
 167                  RADIO_PORT |= N_SS;
 168              }
 169              else
 170              {
 171                          return(0x00);
 172              }
 173          
 174              // Turn on pull up for MISO to reduce current
 175              PRT1DM1 = PORT_1_DRIVE_1 & ~MISO_MASK;
 176          
 177              data = SPIM_RX_BUFFER_REG;
 178          
C51 COMPILER V7.50   SLAVE                                                                 12/13/2005 13:14:02 PAGE 4   

 179          #ifdef RADIO_NON_BLOCKING_CALLS
 180              if( isr_state & GPIO_ISR_RADIO_INT )
 181              {
 182                  RADIO_ISR_ENABLE();
 183                  }
 184          #endif // RADIO_NON_BLOCKING_CALLS
 185          
 186                  return data;
 187          }
 188          
 189          
 190          */


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    108    ----
   CONSTANT SIZE    =      4    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =      4       7
   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 + -