C51 COMPILER V9.54   MAIN                                                                  05/16/2022 17:12:18 PAGE 1   


C51 COMPILER V9.54, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN .\Objects\main.obj
COMPILER INVOKED BY: C:\Keil_v5\C51\BIN\C51.EXE source\main.c OPTIMIZE(8,SPEED) BROWSE DEBUG OBJECTEXTEND PRINT(.\Listin
                    -gs\main.lst) TABS(2) OBJECT(.\Objects\main.obj)

line level    source

   1          /******************** (C) COPYRIGHT 2022 SONiX *******************************
   2          * COMPANY:  SONiX
   3          * DATE:   2022/04/21
   4          * IC:     SN8F5835
   5          *____________________________________________________________________________
   6          * REVISION    Date        Author    Description
   7          * 1.0         2022/04/21   Eden     1. First release
   8          *____________________________________________________________________________
   9          *****************************************************************************/
  10          /*_____ I N C L U D E S _________________________________*/
  11          #define __XRAM_SFR_H__
  12          #include <SN8F5835.h>
  13          
  14          /*_____ F U N C T I O N S _______________________________*/
  15          void GPIO_Initialization(void);
  16          
  17          /*_____ D E F I N I T I O N S ___________________________*/
  18          #define GPIO_PORT_DIRECTION       P0M
  19          #define GPIO_PORT_DATA            P0
  20          #define GPIO_PORT_PULLUP          P0UR
  21          
  22          #define BIT_0                     (0x01U<<0)
  23          #define BIT_1                     (0x01U<<1)
  24          #define BIT_2                     (0x01U<<2)
  25          #define BIT_3                     (0x01U<<3)
  26          #define BIT_4                     (0x01U<<4)
  27          #define BIT_5                     (0x01U<<5)
  28          #define BIT_6                     (0x01U<<6)
  29          #define BIT_7                     (0x01U<<7)
  30          
  31          /*_____ D E C L A R A T I O N S _________________________*/
  32          uint8_t bGPIO_ReadDataBuf;
  33          
  34          /*_____ M A C R O S _____________________________________*/
  35          #define IO_PORT0_OUTPUT_LOW   P0M |= 0xFF;  P0 &= 0x00;
  36          #define IO_PORT1_OUTPUT_LOW   P1M |= 0xFF;  P1 &= 0x00;
  37          #define IO_PORT3_OUTPUT_LOW   P3M |= 0xFF;  P3 &= 0x00;
  38          #define IO_PORT4_OUTPUT_LOW   P4M |= 0xFF;  P4 &= 0x00;
  39          
  40          /**
  41           *  @Brief    main: GPIO Test Demo Function
  42           *  @param    None
  43           *  @retval   None
  44           */
  45          
  46          void main(void)
  47          {
  48   1        /*  Initialize GPIO status  */
  49   1        GPIO_Initialization();                              
  50   1        
  51   1        /*  GPIO input mode example */
  52   1        /*  (1) Set port the whole pins to input mode
  53   1            (2) Enable Pn0~Pn3 pull-up circuit
  54   1            (3) Capture port IO status  on input mode, bit0-bit3 = "1"  */
C51 COMPILER V9.54   MAIN                                                                  05/16/2022 17:12:18 PAGE 2   

  55   1        //  GPIO_PORT_DIRECTION &= ~(BIT_0|BIT_1|BIT_2|BIT_3|BIT_4|BIT_5|BIT_6|BIT_7);        /*  (1) */
  56   1      
  57   1        //  GPIO_PORT_PULLUP |= (BIT_0|BIT_1|BIT_2|BIT_3);                                    /*  (2) */
  58   1        
  59   1      //    bGPIO_ReadDataBuf = GPIO_PORT_DATA;                                               /*  (3) */
  60   1        
  61   1        /*  GPIO output mode example  */
  62   1        /*  (1) Set port the whole pins to output mode, default output low
  63   1            (2) Set Pn0~Pn3 to output high, Pn4~Pn7 output low  */
  64   1        
  65   1      
  66   1          GPIO_PORT_DIRECTION |= (BIT_0|BIT_1|BIT_2|BIT_3|BIT_4|BIT_5|BIT_6|BIT_7);         /*  (1) */
  67   1          GPIO_PORT_DATA = (BIT_0|BIT_1|BIT_2|BIT_3);                                       /*  (2) */
  68   1          while(1);
  69   1      }
  70          
  71          
  72          /**
  73           *  @Brief    Initialize GPIO status
  74           *  @param    None
  75           *  @retval   None
  76           */
  77          void GPIO_Initialization(void)
  78          {
  79   1        /*  Set whole IOs to output low */
  80   1        IO_PORT0_OUTPUT_LOW
  81   1        IO_PORT1_OUTPUT_LOW
  82   1        IO_PORT3_OUTPUT_LOW
  83   1        IO_PORT4_OUTPUT_LOW
  84   1      }


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


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