C51 COMPILER V9.54   SYSTEM                                                                12/03/2024 14:58:48 PAGE 1   


C51 COMPILER V9.54, COMPILATION OF MODULE SYSTEM
OBJECT MODULE PLACED IN .\Objects\system.obj
COMPILER INVOKED BY: C:\Keil_v5\C51\BIN\C51.EXE public\system.c OPTIMIZE(8,SPEED) BROWSE INCDIR(.\public) DEBUG OBJECTEX
                    -TEND PRINT(.\Listings\system.lst) OBJECT(.\Objects\system.obj)

line level    source

   1          #include "system.h"
   2          void system_clk_div(uint8_t clk_div)
   3          {
   4   1          SYSCON &= 0x3F;
   5   1          SYSCON |= (clk_div << 6);
   6   1      }
   7          
   8          void clk_enable(uint8_t clk_source)
   9          {
  10   1          if(clk_source == SUBCLK)
  11   1              SYSCON |= 0x02;
  12   1          else if(clk_source == IHRC)
  13   1              SYSCON |= 0x01;
  14   1          else
  15   1              while(1);
  16   1      }
  17          
  18          void clk_disable(uint8_t clk_source)
  19          {
  20   1          if(clk_source == SUBCLK)
  21   1              SYSCON &= 0xFD;
  22   1          else if(clk_source == IHRC)
  23   1              SYSCON &= 0xFE;
  24   1          else
  25   1              while(1);
  26   1      }
  27          
  28          void main_clk_sel(uint8_t clk_source)
  29          {
  30   1          if(clk_source == SUBCLK)
  31   1              CLKCFG |= 0x80;
  32   1          else if(clk_source == IHRC)
  33   1              SYSCON &= 0x7F;
  34   1          else
  35   1              while(1);    
  36   1      }
  37          
  38          void sub_clk_sel(uint8_t subclk_source)
  39          {
  40   1          if(subclk_source == XTAL)
  41   1              CLKCFG |= 0x40;
  42   1          else if(subclk_source == ILRC)
  43   1              SYSCON &= 0xBF;
  44   1          else
  45   1              while(1);     
  46   1      }
  47          
  48          void cpu_idle(void)
  49          {
  50   1          PCON |= 0x01;
  51   1      }
  52          
  53          void cpu_stop(void)
  54          {
C51 COMPILER V9.54   SYSTEM                                                                12/03/2024 14:58:48 PAGE 2   

  55   1          NOP;
  56   1          NOP;
  57   1          NOP;
  58   1          NOP;    
  59   1          PCON |= 0x02;
  60   1          NOP;
  61   1          NOP;
  62   1          NOP;
  63   1          NOP;
  64   1      }
  65          
  66          void clko_output(uint8_t clko_sel)
  67          {
  68   1          P2CR |= 0x08;//P23 OUTPUT
  69   1          ALFSEL1 |= 0x04;//P23 is buz or clko
  70   1          REMAP = 0x02;//P23 choose clko
  71   1          CLKCFG &= 0xF8;
  72   1          CLKCFG |= clko_sel;
  73   1      }


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


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