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

📄 i2c.lst

📁 TMS320VC5402的中断程序和AIC23的音频输出解码程序,还有DSP的HPI自举程序.
💻 LST
字号:
C51 COMPILER V7.06   I2C                          03/16/2008 11:09:04 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE I2C
OBJECT MODULE PLACED IN I2C.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE I2C.c DEBUG OBJECTEXTEND PAGEWIDTH
                    -(79) PAGELENGTH(66)

stmt level    source

   1          #include  <Reg52.h>
   2          
   3          void nop5(void);
   4           
   5          sbit       scl          =P3^0;
   6          sbit       sda          =P3^1;
   7          
   8          
   9          void s(void)
  10          {
  11   1               sda=0;
  12   1           nop5();
  13   1               scl=0;
  14   1           nop5(); 
  15   1      }       
  16          
  17          void e(void)
  18          {
  19   1              sda=0;          
  20   1          nop5();
  21   1              scl=1;
  22   1          nop5();
  23   1              sda=1;
  24   1          nop5();
  25   1      }
  26          
  27          void one_byte_write(unsigned char kk)
  28           {
  29   1        unsigned char i;
  30   1          for (i=0;i<8;i++)
  31   1              {
  32   2            kk=kk<<1; 
  33   2            scl=0;
  34   2            sda=CY;
  35   2            scl=1; 
  36   2            nop5();
  37   2                scl=0;
  38   2      
  39   2            }
  40   1              scl=0;
  41   1      
  42   1          nop5(); 
  43   1              sda=1;
  44   1              while(sda);             //ack here
  45   1      
  46   1              scl=1;
  47   1          nop5();       
  48   1              scl=0;
  49   1          nop5();
  50   1      
  51   1      }
  52          
  53          
  54          void command_write(unsigned char com1,unsigned char com2)
  55          {
  56   1           unsigned char i;
C51 COMPILER V7.06   I2C                          03/16/2008 11:09:04 PAGE 2   

  57   1               s();
  58   1           i=0x34;
  59   1               one_byte_write(i); 
  60   1           i=com1;
  61   1               one_byte_write(i);
  62   1               i=com2;
  63   1               one_byte_write(i);
  64   1      
  65   1               e();
  66   1      
  67   1      }
  68          
  69          
  70          void ini_aic23(void)
  71          {
  72   1        unsigned char i1,i2;
  73   1         
  74   1         i1=0x1e;
  75   1         i2=0x0;                           //reset
  76   1         command_write(i1,i2);
  77   1      
  78   1        
  79   1        
  80   1         i1=0x12;                          //   digital activity 
  81   1         i2=0x1;
  82   1         command_write(i1,i2);
  83   1         
  84   1         i1=0x1;                          // left line 
  85   1         i2=0x10;
  86   1         command_write(i1,i2);
  87   1      
  88   1         i1=0x3;                          // right line
  89   1         i2=0x10;
  90   1         command_write(i1,i2);
  91   1      
  92   1         i1=0x5;                         // left out
  93   1         i2=0x7f;
  94   1         command_write(i1,i2);
  95   1      
  96   1      
  97   1         i1=0x7;                         // right out
  98   1         i2=0x7f;
  99   1         command_write(i1,i2);
 100   1      
 101   1         i1=0x8;                        //  analoge control
 102   1         i2=0x3c;
 103   1         command_write(i1,i2);
 104   1      
 105   1         i1=0xa;                       //  digital control
 106   1         i2=0x0;
 107   1         command_write(i1,i2);
 108   1      
 109   1         i1=0xc;                       //  power down
 110   1         i2=0x0;
 111   1         command_write(i1,i2);
 112   1      
 113   1         i1=0xe;                       //  digital format
 114   1         i2=0x43;
 115   1         command_write(i1,i2);
 116   1      
 117   1         i1=0x10;                       //  sample rate
 118   1         i2=0x0;
 119   1         command_write(i1,i2);
 120   1      
C51 COMPILER V7.06   I2C                          03/16/2008 11:09:04 PAGE 3   

 121   1      
 122   1      }
 123          
 124          
 125          
 126          void nop5(void)
 127          {
 128   1        int i;
 129   1        i=i;
 130   1        i=i;
 131   1      }       
 132          
 133          


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