C51 COMPILER V9.54   MAIN                                                                  05/19/2022 10:06:24 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/05/04
   4          * IC:     SN8F5835
   5          *____________________________________________________________________________
   6          * REVISION    Date        Author    Description
   7          * 1.0         2022/05/04  SONiX     1. First release
   8          *____________________________________________________________________________
   9          *****************************************************************************/
  10          /*_____ I N C L U D E S _________________________________*/
  11          #define __XRAM_SFR_H__
  12          #include <SN8F5835.h>
  13          #include "i2c.h"
  14          
  15          /*_____ F U N C T I O N S _______________________________*/
  16          
  17          /*_____ D E F I N I T I O N S ___________________________*/
  18          #define I2C_PIN_SEL                 0
  19          
  20          #define I2C_SELF_ADDRESS            0x20
  21          #define I2C_MATE_ADDRESS            0x40
  22          
  23          
  24          /*_____ D E C L A R A T I O N S _________________________*/
  25          uint8_t bI2C_TxDataBuf[10]={0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9};
  26          uint8_t bI2C_RxDataBuf[10];
  27          uint8_t bMN_DataBuf[10];
  28          /*_____ M A C R O S _____________________________________*/
  29          
  30          
  31          /**
  32           *  @Brief    main: ADC Test Demo Function
  33           *  @param    None
  34           *  @retval   None
  35           */
  36          
  37          void main(void)
  38          {
  39   1        /*  Initialize GPIO status  */
  40   1        GPIO_Initialization();                              
  41   1        
  42   1        /*  Initializes and configures the I2C function */
  43   1        I2C_ConfigureRegister(I2C_PIN_SEL, mskI2CCON_I2C_CLOCKDIV_80, I2C_SELF_ADDRESS, I2C_MATE_ADDRESS);
  44   1      
  45   1        /*  Enable global interrupt */
  46   1        EAL = 1;
  47   1        
  48   1          /*  Initializes data buf and start to I2C transmittion  */
  49   1        I2C_InitSlaveTX(I2C_TX_SEL, bI2C_TxDataBuf, sizeof(bI2C_TxDataBuf));
  50   1        
  51   1          /*  Initializes data buf and start to I2C transmittion  */
  52   1        I2C_InitSlaveRX(I2C_RX_SEL, bI2C_RxDataBuf, sizeof(bI2C_RxDataBuf));
  53   1        
  54   1        while(1)
C51 COMPILER V9.54   MAIN                                                                  05/19/2022 10:06:24 PAGE 2   

  55   1        {
  56   2          /*  Check status for new data transmission  and repeat data transmission  */
  57   2          if(I2C_CheckReciDataDone())
  58   2          {
  59   3            bMN_DataBuf[10] = bI2C_RxDataBuf[10];
  60   3            /*  get new data  */
  61   3            I2C_RepeatSlave();
  62   3          }
  63   2          else
  64   2          {
  65   3            /*  Check incomplete tranmission status */
  66   3            if(I2C_CheckReciDataStop())
  67   3            {
  68   4              I2C_RepeatSlave();
  69   4            }
  70   3          }
  71   2          
  72   2          if(I2C_CheckTransDataDone())
  73   2          {
  74   3            I2C_RepeatSlave();
  75   3          }
  76   2          else
  77   2          {
  78   3            /*  Check incomplete tranmission status */
  79   3            if(I2C_CheckTransDataStop())
  80   3            {
  81   4               I2C_RepeatSlave();
  82   4            }
  83   3          }
  84   2        }
  85   1      }
  86          


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


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