C51 COMPILER V9.54   MAIN                                                                  06/01/2022 11:07:41 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/19
   4          * AUTHOR:   Eden
   5          * IC:     SN8F5835
   6          *____________________________________________________________________________
   7          * REVISION    Date        User    Description
   8          * 1.0         2022/05/19  Eden    1. First release
   9          *____________________________________________________________________________
  10          *****************************************************************************/
  11          /*_____ I N C L U D E S _________________________________*/
  12          #define __XRAM_SFR_H__
  13          #include <SN8F5835.h>
  14          #include "SPI.h"
  15          
  16          /*_____ F U N C T I O N S _______________________________*/
  17          void DUT_FillIn_SPI_TxData(uint8_t head);
  18          /*_____ D E F I N I T I O N S ___________________________*/
  19          #define SPI_TX_DATA_LEN 7
  20          #define SPI_RX_DATA_LEN 16
  21          /*_____ D E C L A R A T I O N S _________________________*/
  22          
  23          /*_____ M A C R O S _____________________________________*/
  24          xdata uint8_t bSPI_TxData[SPI_TX_DATA_LEN] = {0};
  25          xdata uint8_t bSPI_RxData[SPI_RX_DATA_LEN] = {0};
  26          /**
  27           *  @Brief    main: SPI Master Test Demo Function
  28           *  @param    None
  29           *  @retval   None
  30           */
  31          
  32          void main(void)
  33          {
  34   1        uint8_t i=0,j=0;
  35   1        uint8_t clk_rate=3;     //clkdiv select
  36   1        uint8_t type=1;         //mode select   
  37   1        uint8_t spi_interrupt=0;// 0:disable 1:enalbe SPI interrupt 
  38   1        /*  Initialize GPIO status  */
  39   1        GPIO_Initialization();    
  40   1        /*  Initialize SPI status */
  41   1        SPI_init(clk_rate,type,spi_interrupt);
  42   1      
  43   1          
  44   1        // The transmitted Data and Data are shifted by 0x00.
  45   1        DUT_FillIn_SPI_TxData(0x00);
  46   1        for(i=0;i<SPI_TX_DATA_LEN;i++)
  47   1          {
  48   2            bSPI_RxData[i]=SPI_data(bSPI_TxData[i]);
  49   2          }
  50   1            SET_SSN_HIGH
  51   1            WDTR = 0x5A;
  52   1      }
  53          void DUT_FillIn_SPI_TxData(uint8_t head)
  54          {
C51 COMPILER V9.54   MAIN                                                                  06/01/2022 11:07:41 PAGE 2   

  55   1        uint8_t i;
  56   1        
  57   1        /* Fill in 16 bytes to the tx Data buffer */
  58   1        for (i = 0; i < SPI_TX_DATA_LEN; i++)
  59   1        {
  60   2          bSPI_TxData[i] = head + i;
  61   2        } 
  62   1      
  63   1      }
  64          /**
  65           *  @Brief    Initialize GPIO status
  66           *  @param    None
  67           *  @retval   None
  68           */
  69          void GPIO_Initialization(void)
  70          {
  71   1      /*  Set whole IOs to output low */
  72   1        IO_PORT0_OUTPUT_LOW
  73   1        IO_PORT1_OUTPUT_LOW
  74   1        IO_PORT3_OUTPUT_LOW
  75   1        IO_PORT4_OUTPUT_LOW
  76   1      }


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


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