C51 COMPILER V9.60.0.0   APP                                                               03/02/2021 17:25:35 PAGE 1   


C51 COMPILER V9.60.0.0, COMPILATION OF MODULE APP
OBJECT MODULE PLACED IN .\Out_Files\app.obj
COMPILER INVOKED BY: D:\keilc51\C51\BIN\C51.EXE APP\app.c COMPACT OMF2 OPTIMIZE(8,SIZE) BROWSE MOD517(NOAU) INCDIR(.\APP
                    -;.\Common;.\UM800x\driver;.\UM800x\system) DEBUG PRINT(.\Out_Files\app.lst) OBJECT(.\Out_Files\app.obj)

line level    source

   1          /***********************************************************************
   2           * Copyright (c)  2017 - 2020, Unicmicro Co.,Ltd .
   3           * All rights reserved.
   4           * Filename    : app.c
   5           * Description : app driver source file
   6           * Author(s)   : wanyi
   7           * version     : V1.0
   8           * Modify date : 2020-07-27
   9           ***********************************************************************/
  10          #include  "system_um800x.h"
  11          #include  "app.h"
  12          #include  "config.h"
  13          #include  "common.h"
  14          #include  "uart0.h"
  15          #include  "i2c.h"
  16          
  17          volatile uint8_t rx_flag ;
  18          volatile uint8_t uart0_rx_buf[32];
  19          volatile uint8_t uart0_tx_buf[32];
  20          volatile uint16_t rx_count = 0;
  21          volatile uint16_t tx_count = 0;
  22          /************************************************************************
  23           * function   : uart0_rec_pro
  24           * Description: uart0_rec_pro 串口接收处理回调函数
  25           * input : none
  26           * return: none
  27           ************************************************************************/
  28          void uart0_rec_pro(void)
  29          {
  30   1              uart0_rx_buf[rx_count++]= uart0_recv_byte();
  31   1              rx_flag = 1;    
  32   1      }
  33          /************************************************************************
  34           * function   : uart0_send_pro
  35           * Description: uart0_send_pro 串口发送处理回调函数
  36           * input : none
  37           * return: none
  38           ************************************************************************/
  39          void uart0_send_pro(void)
  40          {
  41   1              tx_flag = 1;
  42   1      }
  43          
  44          /************************************************************************
  45           * function   : uart_init
  46           * Description: uart_init 串口初始化
  47           * input : none
  48           * return: none
  49           ************************************************************************/
  50          void uart_init(void)
  51          {
  52   1              rx_flag = 0;
  53   1              uart0_init(UART0_BAUD_RATE);
  54   1          uart0_irq_init(UART0_IRQ_ENABLE,uart0_rec_pro,uart0_send_pro);
C51 COMPILER V9.60.0.0   APP                                                               03/02/2021 17:25:35 PAGE 2   

  55   1      }
  56          
  57          void i2c_test(void)
  58          {
  59   1              i2c_master_test();
  60   1      
  61   1      }
  62                  
  63          
  64          void i2c_master_test(void)
  65          {       
  66   1              i2c_master_send_test();
  67   1      //      i2c_master_recv_test();
  68   1      }
  69          
  70          void i2c_master_send_test(void)
  71          {
  72   1              uint8_t xdata status;
  73   1              uint8_t xdata i;
  74   1              uint8_t xdata i2c_send_data[10];
  75   1              for(i=0 ; i<8; i++)
  76   1              {
  77   2                      i2c_send_data[i] = i+0x10;
  78   2              
  79   2              }
  80   1              printfS("i2c master send start\r\n");
  81   1              
  82   1              i2c_master_init(MASTER_I2C_SPEED_100K);                 
  83   1              status = i2c_master_write(I2C_SLAVE_ADDR,0x00,i2c_send_data,8);
  84   1      
  85   1              printfS("status = 0x%bx\r\n",status);
  86   1              printfS("i2c master send end\r\n");
  87   1      
  88   1      }
  89          
  90          void i2c_master_recv_test(void)
  91          {
  92   1              uint8_t xdata status;
  93   1              uint8_t xdata i2c_recv_data[10];
  94   1              printfS("i2c master recv start\r\n");
  95   1              
  96   1              i2c_master_init(MASTER_I2C_SPEED_100K);                 
  97   1              status = i2c_master_read(I2C_SLAVE_ADDR,0x00,i2c_recv_data,8);
  98   1                      
  99   1              printfS("status = 0x%bx\r\n",status);
 100   1              printfS("i2c master recv end\r\n");
 101   1              printfB8(i2c_recv_data,8);
 102   1      
 103   1      }
 104                  


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    271    ----
   CONSTANT SIZE    =    109    ----
   XDATA SIZE       =   ----      23
   PDATA SIZE       =     69    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
   EDATA SIZE       =   ----    ----
   HDATA SIZE       =   ----    ----
C51 COMPILER V9.60.0.0   APP                                                               03/02/2021 17:25:35 PAGE 3   

   XDATA CONST SIZE =   ----    ----
   FAR CONST SIZE   =   ----    ----
END OF MODULE INFORMATION.


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