max5478.lst

来自「maxim(美信)公司生产的MAX5478数字电位器的驱动程序 keil上用c5」· LST 代码 · 共 95 行

LST
95
字号
C51 COMPILER V7.50   MAX5478                                                               09/23/2007 15:36:54 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE MAX5478
OBJECT MODULE PLACED IN MAX5478.OBJ
COMPILER INVOKED BY: C:\Program Files\Keil\C51\BIN\C51.EXE MAX5478.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          /*******************************************************/
   2          /*************     MAX5478 DRIVER     ******************/
   3          /*************     EDITED BY TNXN     ******************/
   4          /*************        2006.9.1        ******************/
   5          /*******************************************************/
   6          #include <REG51.H>
   7          #include <intrins.h>
   8          
   9          #include "IIC.h"
  10          #include "TNXN_test.h"
  11          #include "MAX5478.h"
  12          
  13          void MAX5478_Command_VREG(unsigned char address,bit wiper_a,bit wiper_b,unsigned char udata)
  14          {
  15   1              unsigned char temp_uchar;
  16   1              temp_uchar=0x10;
  17   1              if(wiper_a==1)
  18   1              {
  19   2                      temp_uchar|=0x01;
  20   2              }
  21   1      
  22   1              if(wiper_b==1)
  23   1              {
  24   2                      temp_uchar|=0x02;
  25   2              }
  26   1      
  27   1              MAX5478_WriteChar((address<<1)|0x50,temp_uchar,udata);
  28   1      
  29   1      }
  30          
  31          void main(void)
  32          {
  33   1              unsigned char i;
  34   1              tnxn_delay200ms();
  35   1              tnxn_delay200ms();
  36   1              tnxn_delay200ms();
  37   1      
  38   1              tnxn_shine(4);
  39   1      
  40   1              tnxn_delay200ms();
  41   1              tnxn_delay200ms();
  42   1              tnxn_delay200ms();
  43   1      
  44   1              //MAX5478_Command_VREG(0x00,1,1,0x40);
  45   1      
  46   1              while(1)
  47   1              {
  48   2                      for(i=80;i<120;i++)
  49   2                      {
  50   3                              MAX5478_Command_VREG(0x00,1,1,i);
  51   3                              tnxn_delay100ms();
  52   3                      }
  53   2              
  54   2                      for(i=120;i>80;i--)
  55   2                      {
C51 COMPILER V7.50   MAX5478                                                               09/23/2007 15:36:54 PAGE 2   

  56   3                              MAX5478_Command_VREG(0x00,1,1,i);
  57   3                              tnxn_delay100ms();
  58   3                      }
  59   2              }
  60   1      
  61   1              tnxn_shine(6);
  62   1      
  63   1      
  64   1              for(;;);
  65   1      
  66   1      
  67   1      
  68   1      
  69   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    380    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       8
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----       8
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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