; generated by Component: ARM Compiler 5.06 update 6 (build 750) Tool: ArmCC [4d3637]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave --gnu -o.\objects\app_tp_transfer.o --asm_dir=.\Listings\ --list_dir=.\Listings\ --depend=.\objects\app_tp_transfer.d --cpu=Cortex-M0 --apcs=interwork -O3 --diag_suppress=9931 -I..\..\src -I..\..\src\board -I..\..\src\common -I..\..\src\sdk\include -I..\..\src\app\demo -I..\..\src\sdk\include\M0 -I..\..\src\app -I..\CVWL568 -I.\RTE\_ISP_568 -IC:\Keil_v5\ARM\PACK\ARM\CMSIS\5.5.1\CMSIS\Core\Include -IC:\Keil_v5\ARM\PACK\ARM\CMSIS\5.5.1\Device\ARM\ARMCM0\Include -D__MICROLIB -D__UVISION_VERSION=528 -D_RTE_ -DARMCM0 -DISP_568 --omf_browse=.\objects\app_tp_transfer.crf ..\..\src\app\demo\app_tp_transfer.c]
                          THUMB

                          AREA ||i.ap_tp_st_touch_get_status||, CODE, READONLY, ALIGN=2

                  ap_tp_st_touch_get_status PROC
;;;470    
;;;471    void ap_tp_st_touch_get_status(void)
000000  b510              PUSH     {r4,lr}
;;;472    {
;;;473        app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
000002  4806              LDR      r0,|L1.28|
000004  2308              MOVS     r3,#8
000006  6800              LDR      r0,[r0,#0]  ; screen_reg_int_data
000008  4a05              LDR      r2,|L1.32|
00000a  2101              MOVS     r1,#1
00000c  f7fffffe          BL       app_tp_m_read
                  |L1.16|
;;;474    	while(!hal_i2c_m_transfer_complate());
000010  f7fffffe          BL       hal_i2c_m_transfer_complate
000014  2800              CMP      r0,#0
000016  d0fb              BEQ      |L1.16|
;;;475    	
;;;476    }
000018  bd10              POP      {r4,pc}
;;;477    
                          ENDP

00001a  0000              DCW      0x0000
                  |L1.28|
                          DCD      screen_reg_int_data
                  |L1.32|
                          DCD      ||.bss||

                          AREA ||i.app_tp_I2C_init||, CODE, READONLY, ALIGN=2

                  app_tp_I2C_init PROC
;;;134    
;;;135    void app_tp_I2C_init(void)
000000  b510              PUSH     {r4,lr}
;;;136    {
;;;137        hal_i2c_s_init(CHIP_I2C_ADDRESS, CHIP_I2C_ADDR_BITS);
000002  2107              MOVS     r1,#7
000004  2048              MOVS     r0,#0x48
000006  f7fffffe          BL       hal_i2c_s_init
;;;138        hal_i2c_s_set_transfer(app_tp_i2cs_callback);
00000a  4804              LDR      r0,|L2.28|
00000c  f7fffffe          BL       hal_i2c_s_set_transfer
;;;139        hal_i2c_s_nonblocking_read(s_phone_read_buffer, BUFFER_SIZE_MAX); //�����ý��� buffer
000010  21fa              MOVS     r1,#0xfa
000012  4803              LDR      r0,|L2.32|
000014  f7fffffe          BL       hal_i2c_s_nonblocking_read
;;;140    }
000018  bd10              POP      {r4,pc}
;;;141    
                          ENDP

00001a  0000              DCW      0x0000
                  |L2.28|
                          DCD      app_tp_i2cs_callback
                  |L2.32|
                          DCD      ||.bss||+0xfa

                          AREA ||i.app_tp_i2cs_callback||, CODE, READONLY, ALIGN=2

                  app_tp_i2cs_callback PROC
;;;307    #if PHONE_SLAVE_TRANSFER_I2C                //消除warning
;;;308    static void app_tp_i2cs_callback(e_i2c_s_int_status int_status, size_t recieve_num)
000000  b570              PUSH     {r4-r6,lr}
;;;309    {
;;;310        static bool i2cs_transfer = true;       //确保一次通信只解析一次
;;;311        if (i2cs_transfer)
000002  4c0f              LDR      r4,|L3.64|
000004  4605              MOV      r5,r0                 ;309
000006  7960              LDRB     r0,[r4,#5]  ; i2cs_transfer
000008  2800              CMP      r0,#0
00000a  d00d              BEQ      |L3.40|
;;;312        {
;;;313            i2cs_transfer = false;
00000c  2000              MOVS     r0,#0
00000e  7160              STRB     r0,[r4,#5]
000010  2900              CMP      r1,#0
000012  d005              BEQ      |L3.32|
000014  4623              MOV      r3,r4
000016  330c              ADDS     r3,r3,#0xc
000018  1f1a              SUBS     r2,r3,#4
00001a  480a              LDR      r0,|L3.68|
00001c  f7fffffe          BL       app_tp_phone_analysis_data
                  |L3.32|
000020  21fa              MOVS     r1,#0xfa
000022  4808              LDR      r0,|L3.68|
000024  f7fffffe          BL       app_tp_s_read
                  |L3.40|
;;;314            app_tp_transfer_phone(recieve_num);
;;;315        }
;;;316        if (int_status == I2C_S_INT_READ)
000028  2d00              CMP      r5,#0
00002a  d004              BEQ      |L3.54|
;;;317        {
;;;318            app_tp_s_write(s_slave_txbuffer, s_slave_txbuffer_size);
;;;319        }
;;;320        else if (int_status == I2C_S_INT_STOP)
00002c  2d02              CMP      r5,#2
00002e  d101              BNE      |L3.52|
;;;321        {
;;;322            i2cs_transfer = true;
000030  2001              MOVS     r0,#1
000032  7160              STRB     r0,[r4,#5]
                  |L3.52|
;;;323        }
;;;324    }
000034  bd70              POP      {r4-r6,pc}
                  |L3.54|
000036  68e1              LDR      r1,[r4,#0xc]          ;318  ; s_slave_txbuffer_size
000038  68a0              LDR      r0,[r4,#8]            ;318  ; s_slave_txbuffer
00003a  f7fffffe          BL       app_tp_s_write
00003e  bd70              POP      {r4-r6,pc}
;;;325    #endif
                          ENDP

                  |L3.64|
                          DCD      ||.data||
                  |L3.68|
                          DCD      ||.bss||+0xfa

                          AREA ||i.app_tp_init||, CODE, READONLY, ALIGN=2

                  app_tp_init PROC
;;;148    **************************************************************************/
;;;149    void app_tp_init(void)
000000  b510              PUSH     {r4,lr}
000002  4c10              LDR      r4,|L4.68|
000004  2100              MOVS     r1,#0
000006  7820              LDRB     r0,[r4,#0]  ; g_screen_input_int_pad
000008  f7fffffe          BL       hal_gpio_ctrl_eint
00000c  2200              MOVS     r2,#0
00000e  2101              MOVS     r1,#1
000010  7820              LDRB     r0,[r4,#0]  ; g_screen_input_int_pad
000012  f7fffffe          BL       hal_gpio_set_pull_state
000016  2103              MOVS     r1,#3
000018  7820              LDRB     r0,[r4,#0]  ; g_screen_input_int_pad
00001a  f7fffffe          BL       hal_gpio_init_eint
00001e  490a              LDR      r1,|L4.72|
000020  7820              LDRB     r0,[r4,#0]  ; g_screen_input_int_pad
000022  f7fffffe          BL       hal_gpio_reg_eint_cb
000026  2101              MOVS     r1,#1
000028  7820              LDRB     r0,[r4,#0]  ; g_screen_input_int_pad
00002a  f7fffffe          BL       hal_gpio_ctrl_eint
;;;150    {
;;;151    //    app_tp_phone_reset_init();                                        //初始化手机复位的IO口
;;;152        app_tp_screen_int_init();                                         //配置screen中断输入引脚
;;;153        hal_gpio_init_output(g_phone_output_int_pad, IO_LVL_HIGH);        //配置phone报点输出中断IO口
00002e  4807              LDR      r0,|L4.76|
000030  2101              MOVS     r1,#1
000032  7800              LDRB     r0,[r0,#0]  ; g_phone_output_int_pad
000034  f7fffffe          BL       hal_gpio_init_output
;;;154    
;;;155    #if SCREEN_MASTER_TRANSFER_I2C
;;;156        hal_i2c_m_dma_init(SCREEN_I2C_ADDRESS, SCREEN_I2C_ADDR_BITS, I2C_MASTER_SPEED);
000038  4a05              LDR      r2,|L4.80|
00003a  2107              MOVS     r1,#7
00003c  2049              MOVS     r0,#0x49
00003e  f7fffffe          BL       hal_i2c_m_dma_init
;;;157    #elif SCREEN_MASTER_TRANSFER_SPI
;;;158        hal_spi_m_dma_init(SPI_MASTER_SPEED, SCREEN_SPI_CPHA, SCREEN_SPI_CPOL);
;;;159    #endif
;;;160    
;;;161    #if PHONE_SLAVE_TRANSFER_I2C
;;;162     //   hal_i2c_s_init(CHIP_I2C_ADDRESS, CHIP_I2C_ADDR_BITS);
;;;163     //   hal_i2c_s_set_transfer(app_tp_i2cs_callback);
;;;164     //   hal_i2c_s_nonblocking_read(s_phone_read_buffer, BUFFER_SIZE_MAX); //先配置接收 buffer
;;;165    #elif PHONE_SLAVE_TRANSFER_SPI
;;;166        hal_spi_slave_init(PHONE_SPI_CPHA, PHONE_SPI_CPOL, true);                                   // 初始化spi以及dma
;;;167        hal_spi_slave_register_callback(app_tp_spis_callback);            // 注册回调
;;;168        hal_spi_slave_auto_transfer_abort();                              // 停止传输
;;;169        hal_spi_slave_flush_fifo();                                       // Flush FIFO
;;;170    
;;;171        /* 每个packet自动接收, circle       mode 为false, 即收到buffer     max size数据后buffer不再更新, packet完成后调用回调    */
;;;172        hal_spi_slave_set_auto_rx_buffer(s_phone_read_buffer, BUFFER_SIZE_MAX, false); // 设置auto   rx buffer
;;;173        hal_spi_slave_set_auto_tx_buffer(phone_reg_const_data[0].write_back, phone_reg_const_data[0].write_back_size, false);   // 配置TX BUFFER
;;;174    
;;;175        hal_spi_slave_enable();                                           // 启动spis
;;;176        hal_spi_slave_auto_transfer_start();                              // 启动tx自动发送
;;;177    #endif
;;;178    }
000042  bd10              POP      {r4,pc}
;;;179    
                          ENDP

                  |L4.68|
                          DCD      g_screen_input_int_pad
                  |L4.72|
                          DCD      app_tp_screen_int_callback
                  |L4.76|
                          DCD      g_phone_output_int_pad
                  |L4.80|
                          DCD      0x00061a80

                          AREA ||i.app_tp_m_read||, CODE, READONLY, ALIGN=1

                  app_tp_m_read PROC
;;;243    **************************************************************************/
;;;244    void app_tp_m_read(const uint8_t *cmd, size_t cmd_size, uint8_t *data_buffer, size_t data_size)
000000  b5f8              PUSH     {r3-r7,lr}
;;;245    {
000002  4605              MOV      r5,r0
;;;246    #if SCREEN_MASTER_TRANSFER_I2C
;;;247        uint8_t i = 0;
000004  2400              MOVS     r4,#0
;;;248        uint32_t address = 0;
000006  4620              MOV      r0,r4
000008  e005              B        |L5.22|
                  |L5.10|
;;;249    
;;;250        for (i = 0; i < cmd_size; i++)                          //先将要发送的数据整合到 address
;;;251        {
;;;252            address |= (uint32_t)cmd[i] << i * 8;
00000a  5d2e              LDRB     r6,[r5,r4]
00000c  00e7              LSLS     r7,r4,#3
00000e  40be              LSLS     r6,r6,r7
000010  4330              ORRS     r0,r0,r6
000012  1c64              ADDS     r4,r4,#1
000014  b2e4              UXTB     r4,r4                 ;250
                  |L5.22|
000016  428c              CMP      r4,r1                 ;250
000018  d3f7              BCC      |L5.10|
;;;253        }
;;;254        hal_i2c_m_dma_read(address, cmd_size, data_buffer, data_size);
00001a  f7fffffe          BL       hal_i2c_m_dma_read
;;;255    #elif SCREEN_MASTER_TRANSFER_SPI
;;;256        hal_spi_m_dma_read(cmd, cmd_size, data_buffer, data_size);
;;;257    #endif
;;;258    }
00001e  bdf8              POP      {r3-r7,pc}
;;;259    
                          ENDP


                          AREA ||i.app_tp_m_transfer_complate||, CODE, READONLY, ALIGN=1

                  app_tp_m_transfer_complate PROC
;;;186    **************************************************************************/
;;;187    bool app_tp_m_transfer_complate(void)
000000  b510              PUSH     {r4,lr}
;;;188    {
;;;189    #if SCREEN_MASTER_TRANSFER_I2C
;;;190        return hal_i2c_m_transfer_complate();
000002  f7fffffe          BL       hal_i2c_m_transfer_complate
;;;191    #elif SCREEN_MASTER_TRANSFER_SPI
;;;192        return hal_spi_m_get_transfer_complate();
;;;193    #else
;;;194        return true;
;;;195    #endif
;;;196    }
000006  bd10              POP      {r4,pc}
;;;197    
                          ENDP


                          AREA ||i.app_tp_m_write||, CODE, READONLY, ALIGN=1

                  app_tp_m_write PROC
;;;223    **************************************************************************/
;;;224    void app_tp_m_write(const uint8_t *txbuffer, size_t buffer_size)
000000  b510              PUSH     {r4,lr}
;;;225    {
;;;226    #if SCREEN_MASTER_TRANSFER_I2C
;;;227        hal_i2c_m_dma_write(txbuffer, buffer_size);
000002  f7fffffe          BL       hal_i2c_m_dma_write
;;;228    #elif SCREEN_MASTER_TRANSFER_SPI
;;;229        hal_spi_m_dma_write(txbuffer, buffer_size);
;;;230        s_spim_write = true;
;;;231    #endif
;;;232    }
000006  bd10              POP      {r4,pc}
;;;233    
                          ENDP


                          AREA ||i.app_tp_phone_clear_reset_on||, CODE, READONLY, ALIGN=2

                  app_tp_phone_clear_reset_on PROC
;;;630    **************************************************************************/
;;;631    void app_tp_phone_clear_reset_on(void)
000000  4901              LDR      r1,|L8.8|
;;;632    {
;;;633        s_phone_reset_flag = false;
000002  2000              MOVS     r0,#0
000004  7088              STRB     r0,[r1,#2]
;;;634    }
000006  4770              BX       lr
;;;635    
                          ENDP

                  |L8.8|
                          DCD      ||.data||

                          AREA ||i.app_tp_phone_reset_on||, CODE, READONLY, ALIGN=2

                  app_tp_phone_reset_on PROC
;;;618    **************************************************************************/
;;;619    bool app_tp_phone_reset_on(void)
000000  4801              LDR      r0,|L9.8|
;;;620    {
;;;621        return s_phone_reset_flag;
000002  7880              LDRB     r0,[r0,#2]  ; s_phone_reset_flag
;;;622    }
000004  4770              BX       lr
;;;623    
                          ENDP

000006  0000              DCW      0x0000
                  |L9.8|
                          DCD      ||.data||

                          AREA ||i.app_tp_s_read||, CODE, READONLY, ALIGN=1

                  app_tp_s_read PROC
;;;292    **************************************************************************/
;;;293    void app_tp_s_read(void *rxBuffer, size_t data_size)
000000  b510              PUSH     {r4,lr}
;;;294    {
;;;295    #if PHONE_SLAVE_TRANSFER_I2C
;;;296        hal_i2c_s_nonblocking_read(rxBuffer, data_size);
000002  f7fffffe          BL       hal_i2c_s_nonblocking_read
;;;297    #endif
;;;298    }
000006  bd10              POP      {r4,pc}
;;;299    
                          ENDP


                          AREA ||i.app_tp_s_transfer_complate||, CODE, READONLY, ALIGN=1

                  app_tp_s_transfer_complate PROC
;;;204    **************************************************************************/
;;;205    bool app_tp_s_transfer_complate(void)
000000  b510              PUSH     {r4,lr}
;;;206    {
;;;207    #if PHONE_SLAVE_TRANSFER_I2C
;;;208        return hal_i2c_s_write_complate() && hal_i2c_s_read_complate();
000002  f7fffffe          BL       hal_i2c_s_write_complate
000006  2800              CMP      r0,#0
000008  d005              BEQ      |L11.22|
00000a  f7fffffe          BL       hal_i2c_s_read_complate
00000e  2800              CMP      r0,#0
000010  d001              BEQ      |L11.22|
000012  2001              MOVS     r0,#1
;;;209    #elif PHONE_SLAVE_TRANSFER_SPI
;;;210        return !hal_spi_slave_busy();
;;;211    #else
;;;212        return true;
;;;213    #endif
;;;214    }
000014  bd10              POP      {r4,pc}
                  |L11.22|
000016  2000              MOVS     r0,#0                 ;208
000018  bd10              POP      {r4,pc}
;;;215    
                          ENDP


                          AREA ||i.app_tp_s_write||, CODE, READONLY, ALIGN=1

                  app_tp_s_write PROC
;;;267    **************************************************************************/
;;;268    void app_tp_s_write(const uint8_t *txbuffer, size_t buffer_size)
000000  b510              PUSH     {r4,lr}
;;;269    {
;;;270    #if PHONE_SLAVE_TRANSFER_I2C
;;;271        hal_i2c_s_dma_write(txbuffer, buffer_size);
000002  f7fffffe          BL       hal_i2c_s_dma_write
;;;272    #elif PHONE_SLAVE_TRANSFER_SPI
;;;273        //while (hal_spi_slave_busy());
;;;274    #if 1
;;;275        hal_spi_slave_reset_tx(txbuffer, buffer_size, true);
;;;276    #else
;;;277        hal_spi_slave_auto_transfer_abort();
;;;278        hal_spi_slave_flush_fifo();
;;;279        hal_spi_slave_set_auto_tx_buffer(txbuffer, buffer_size, true);
;;;280        hal_spi_slave_auto_transfer_start();
;;;281    #endif
;;;282    #endif
;;;283    }
000006  bd10              POP      {r4,pc}
;;;284    
                          ENDP


                          AREA ||i.app_tp_screen_init||, CODE, READONLY, ALIGN=2

                  app_tp_screen_init PROC
;;;123    **************************************************************************/
;;;124    void app_tp_screen_init(void)
000000  b510              PUSH     {r4,lr}
;;;125    {
;;;126        hal_gpio_init_output(g_screen_input_rst_pad, IO_LVL_HIGH);
000002  4c0c              LDR      r4,|L13.52|
000004  2101              MOVS     r1,#1
000006  7820              LDRB     r0,[r4,#0]  ; g_screen_input_rst_pad
000008  f7fffffe          BL       hal_gpio_init_output
;;;127        delayUs(200);
00000c  20c8              MOVS     r0,#0xc8
00000e  f7fffffe          BL       delayUs
;;;128        hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_LOW);
000012  2100              MOVS     r1,#0
000014  7820              LDRB     r0,[r4,#0]  ; g_screen_input_rst_pad
000016  f7fffffe          BL       hal_gpio_set_output_data
;;;129     //   delayUs(200);
;;;130    	delayMs(2);
00001a  2002              MOVS     r0,#2
00001c  f7fffffe          BL       delayMs
;;;131        hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_HIGH);
000020  2101              MOVS     r1,#1
000022  7820              LDRB     r0,[r4,#0]  ; g_screen_input_rst_pad
000024  f7fffffe          BL       hal_gpio_set_output_data
;;;132        delayUs(400);
000028  20ff              MOVS     r0,#0xff
00002a  3091              ADDS     r0,r0,#0x91
00002c  f7fffffe          BL       delayUs
;;;133    }
000030  bd10              POP      {r4,pc}
;;;134    
                          ENDP

000032  0000              DCW      0x0000
                  |L13.52|
                          DCD      g_screen_input_rst_pad

                          AREA ||i.app_tp_screen_int_callback||, CODE, READONLY, ALIGN=2

                  app_tp_screen_int_callback PROC
;;;53     **************************************************************************/
;;;54     static void app_tp_screen_int_callback(void *data)
000000  4901              LDR      r1,|L14.8|
;;;55     {
;;;56         s_screen_int_flag = true;
000002  2001              MOVS     r0,#1
000004  7048              STRB     r0,[r1,#1]
;;;57     }
000006  4770              BX       lr
;;;58     
                          ENDP

                  |L14.8|
                          DCD      ||.data||

                          AREA ||i.app_tp_transfer_screen_const||, CODE, READONLY, ALIGN=2

                  app_tp_transfer_screen_const PROC
;;;382    **************************************************************************/
;;;383    static void app_tp_transfer_screen_const(void)
000000  b5f8              PUSH     {r3-r7,lr}
000002  f7fffffe          BL       hal_i2c_m_transfer_complate
;;;384    {
;;;385        static bool    screen_const_transfer_buffer_ready = true;            //发送 buffer 是否已准备好
;;;386    		
;;;387        /**** 1. 判断当前状态通信已结束, 并且开机初始化流程还未走完****/
;;;388        if (app_tp_m_transfer_complate() && (s_screen_const_transfer_count < screen_reg_start_data_size))
000006  2800              CMP      r0,#0
000008  d020              BEQ      |L15.76|
00000a  4c1e              LDR      r4,|L15.132|
00000c  4e1e              LDR      r6,|L15.136|
00000e  7920              LDRB     r0,[r4,#4]  ; s_screen_const_transfer_count
000010  7831              LDRB     r1,[r6,#0]  ; screen_reg_start_data_size
000012  4288              CMP      r0,r1
000014  d21a              BCS      |L15.76|
;;;389        {
;;;390            if (s_spim_write)                                                //SPI 写数据后需要把接收FIFO的数据读出，不然会影响下一次读取
000016  7820              LDRB     r0,[r4,#0]  ; s_spim_write
000018  2700              MOVS     r7,#0
00001a  2800              CMP      r0,#0
00001c  d002              BEQ      |L15.36|
;;;391            {
;;;392                hal_spi_m_clear_rxfifo();
00001e  f7fffffe          BL       hal_spi_m_clear_rxfifo
;;;393                s_spim_write = false;
000022  7027              STRB     r7,[r4,#0]
                  |L15.36|
;;;394            }
;;;395    
;;;396            /**** 2. 发送或读取从机数据 ****/
;;;397            if (screen_const_transfer_buffer_ready)
000024  79a0              LDRB     r0,[r4,#6]  ; screen_const_transfer_buffer_ready
;;;398            {
;;;399                screen_const_transfer_buffer_ready = false;
;;;400    						g_screen_tp_init_start = true;
;;;401    						
;;;402                if (!screen_reg_start_data[s_screen_const_transfer_count].read_flag)     //当前通信不需要读回，直接写
000026  4919              LDR      r1,|L15.140|
000028  2501              MOVS     r5,#1                 ;400
00002a  2800              CMP      r0,#0                 ;397
00002c  d014              BEQ      |L15.88|
00002e  4818              LDR      r0,|L15.144|
000030  71a7              STRB     r7,[r4,#6]            ;399
000032  7005              STRB     r5,[r0,#0]            ;400
000034  7920              LDRB     r0,[r4,#4]  ; s_screen_const_transfer_count
000036  2214              MOVS     r2,#0x14
000038  4350              MULS     r0,r2,r0
00003a  1840              ADDS     r0,r0,r1
00003c  7c01              LDRB     r1,[r0,#0x10]
00003e  2900              CMP      r1,#0
000040  d005              BEQ      |L15.78|
000042  1d00              ADDS     r0,r0,#4
000044  c80b              LDM      r0,{r0,r1,r3}
;;;403                {
;;;404                    app_tp_m_write(screen_reg_start_data[s_screen_const_transfer_count].buffer, screen_reg_start_data[s_screen_const_transfer_count].txbuffer_size);
;;;405    		//		delayMs(5);
;;;406                }
;;;407                else                                                             //当前通信需要读回，先写再读
;;;408                {
;;;409                    app_tp_m_read(screen_reg_start_data[s_screen_const_transfer_count].buffer, screen_reg_start_data[s_screen_const_transfer_count].txbuffer_size, \
000046  4a13              LDR      r2,|L15.148|
000048  f7fffffe          BL       app_tp_m_read
                  |L15.76|
;;;410                                  s_screen_read_buffer, screen_reg_start_data[s_screen_const_transfer_count].rxbuffer_size);
;;;411                }
;;;412    					
;;;413            }
;;;414            /**** 3. 解析本次通信数据，并准备下一次通信的buffer ****/
;;;415            else
;;;416            {
;;;417                screen_const_transfer_buffer_ready = true;
;;;418                s_screen_const_transfer_count = app_tp_screen_analysis_const(s_screen_const_transfer_count, s_screen_read_buffer, \
;;;419                                                screen_reg_start_data[s_screen_const_transfer_count].rxbuffer_size);
;;;420    
;;;421                if (s_screen_const_transfer_count >= screen_reg_start_data_size)
;;;422                {
;;;423                    s_screen_init_complate = true;
;;;424    				TAU_LOGD("tp init done\n");
;;;425                }
;;;426            }
;;;427        }
;;;428    }
00004c  bdf8              POP      {r3-r7,pc}
                  |L15.78|
00004e  6881              LDR      r1,[r0,#8]            ;404
000050  6840              LDR      r0,[r0,#4]            ;404
000052  f7fffffe          BL       app_tp_m_write
                  |L15.86|
000056  bdf8              POP      {r3-r7,pc}
                  |L15.88|
000058  71a5              STRB     r5,[r4,#6]            ;417
00005a  7920              LDRB     r0,[r4,#4]            ;418  ; s_screen_const_transfer_count
00005c  2214              MOVS     r2,#0x14              ;418
00005e  4342              MULS     r2,r0,r2              ;418
000060  1851              ADDS     r1,r2,r1              ;418
000062  68ca              LDR      r2,[r1,#0xc]          ;418
000064  490b              LDR      r1,|L15.148|
000066  f7fffffe          BL       app_tp_screen_analysis_const
00006a  7120              STRB     r0,[r4,#4]            ;418
00006c  7831              LDRB     r1,[r6,#0]            ;421  ; screen_reg_start_data_size
00006e  4288              CMP      r0,r1                 ;421
000070  d3f1              BCC      |L15.86|
000072  22ff              MOVS     r2,#0xff              ;424
000074  70e5              STRB     r5,[r4,#3]            ;423
000076  32a9              ADDS     r2,r2,#0xa9           ;424
000078  a107              ADR      r1,|L15.152|
00007a  a009              ADR      r0,|L15.160|
00007c  f7fffffe          BL       LOG_printf
000080  bdf8              POP      {r3-r7,pc}
;;;429    
                          ENDP

000082  0000              DCW      0x0000
                  |L15.132|
                          DCD      ||.data||
                  |L15.136|
                          DCD      screen_reg_start_data_size
                  |L15.140|
                          DCD      screen_reg_start_data
                  |L15.144|
                          DCD      g_screen_tp_init_start
                  |L15.148|
                          DCD      ||.bss||
                  |L15.152|
000098  7461755f          DCB      "tau_log",0
00009c  6c6f6700
                  |L15.160|
0000a0  5b25735d          DCB      "[%s] (%04d) tp init done\n",0
0000a4  20282530
0000a8  34642920
0000ac  74702069
0000b0  6e697420
0000b4  646f6e65
0000b8  0a00    
0000ba  00                DCB      0
0000bb  00                DCB      0

                          AREA ||i.app_tp_transfer_screen_int||, CODE, READONLY, ALIGN=2

                  app_tp_transfer_screen_int PROC
;;;484    **************************************************************************/
;;;485    void app_tp_transfer_screen_int(void)
000000  b5f8              PUSH     {r3-r7,lr}
;;;486    {
;;;487    	uint16_t data_size = 0;
;;;488    
;;;489         uint8_t len = 0;
000002  2500              MOVS     r5,#0
;;;490    	  bool screen_gpio_int = false;
;;;491        static uint8_t screen_int_transfer_count = 0;            //记录当前通信到哪一步
;;;492        static bool    screen_int_transfer_buffer_ready = true;  //发送 buffer 是否已准备好
;;;493        volatile bool init_gpio = false;
000004  4668              MOV      r0,sp
000006  462e              MOV      r6,r5
000008  7005              STRB     r5,[r0,#0]
;;;494        if (!s_screen_init_complate)                             //TP 初始化还未完成，则先进行初始化操作
00000a  4c1c              LDR      r4,|L16.124|
00000c  78e0              LDRB     r0,[r4,#3]  ; s_screen_init_complate
00000e  2800              CMP      r0,#0
000010  d018              BEQ      |L16.68|
;;;495        {
;;;496            app_tp_transfer_screen_const();
;;;497            return;
;;;498        }
;;;499    
;;;500    	app_tp_transfer_screen_restart();
000012  f7fffffe          BL       app_tp_transfer_screen_restart
;;;501    	app_tp_screen_analysis_wake_up_exec();
000016  f7fffffe          BL       app_tp_screen_analysis_wake_up_exec
;;;502    	
;;;503    #if 1
;;;504    	 static bool analysis_flag =  false;
;;;505            
;;;506        if(analysis_flag == true)
00001a  79e0              LDRB     r0,[r4,#7]  ; analysis_flag
00001c  2800              CMP      r0,#0
00001e  d014              BEQ      |L16.74|
000020  f7fffffe          BL       hal_i2c_m_transfer_complate
;;;507        {
;;;508            if(app_tp_m_transfer_complate())
000024  2800              CMP      r0,#0
000026  d00c              BEQ      |L16.66|
;;;509            {
;;;510              /**** 3. 转换报点数据 ****/
;;;511    	  //      data_size =63;        //需针对不同项目修改!!!!
;;;512    	        if(s_screen_read_buffer[7]>0)
000028  4815              LDR      r0,|L16.128|
00002a  79c0              LDRB     r0,[r0,#7]  ; s_screen_read_buffer
00002c  2800              CMP      r0,#0
00002e  d001              BEQ      |L16.52|
;;;513    	        {
;;;514    	        	len = s_screen_read_buffer[7]*8;
000030  06c0              LSLS     r0,r0,#27
000032  0e05              LSRS     r5,r0,#24
                  |L16.52|
;;;515    	        }
;;;516    	        app_tp_screen_analysis_int(1, s_screen_read_buffer,(len+8));
000034  462a              MOV      r2,r5
000036  3208              ADDS     r2,r2,#8
000038  4911              LDR      r1,|L16.128|
00003a  2001              MOVS     r0,#1
00003c  f7fffffe          BL       app_tp_screen_analysis_int
;;;517                analysis_flag = false;
000040  71e6              STRB     r6,[r4,#7]
                  |L16.66|
;;;518            }
;;;519        }
;;;520    	else
;;;521    	{
;;;522          	screen_gpio_int = s_screen_int_flag || app_tp_screen_int_lvl_low();
;;;523            if ((screen_gpio_int) && app_tp_m_transfer_complate()) //判断当前不处于通信状态，并且准备通信
;;;524            {
;;;525                    s_screen_int_flag = false;
;;;526    
;;;527                    /**** 2. 读取从机数据 ****/
;;;528                 app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 40);
;;;529                 analysis_flag = true;
;;;530            } 
;;;531        }
;;;532    #else
;;;533        /**** 1. 判断 screen 是否发出中断信号 ****/
;;;534        // s_screen_int_flag:           中断信号标志位
;;;535        // app_tp_screen_int_lvl_low :  SPI 长时间通信时，偶尔会出现cs拉高导致通信异常卡死，该标志位用于解决卡死的问题
;;;536        init_gpio = app_tp_screen_int_lvl_low();
;;;537        screen_gpio_int = (s_screen_int_flag || init_gpio);
;;;538      //  if (((screen_gpio_int) || (s_screen_int_transfer_status)) && app_tp_m_transfer_complate()) //判断当前不处于通信状态，并且准备通信
;;;539        if ((screen_gpio_int))
;;;540    	{
;;;541            s_screen_int_flag = false;
;;;542    
;;;543            /**** 2. 发送或读取从机数据 ****/
;;;544     //       if (screen_int_transfer_buffer_ready)
;;;545            {
;;;546     //           screen_int_transfer_buffer_ready = false;
;;;547     //           s_screen_int_transfer_status = true;
;;;548    	
;;;549    			app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
;;;550    			while(!hal_i2c_m_transfer_complate());
;;;551    			if(s_screen_read_buffer[7]>0)
;;;552    			{
;;;553    				TAU_LOGD("F");
;;;554    				len = s_screen_read_buffer[7]*8;
;;;555    				app_tp_m_read(screen_reg_int_data[0].buffer, 1, &s_screen_read_buffer[8], len);
;;;556    				while(!hal_i2c_m_transfer_complate());		
;;;557    			}	
;;;558    
;;;559    			delayUs(100);
;;;560    
;;;561    			ap_tp_st_touch_error_handler_F3(s_screen_read_buffer);
;;;562                ap_tp_st_touch_error_handler_FF(s_screen_read_buffer);
;;;563    			ap_tp_st_touch_error_handler_03(s_screen_read_buffer);
;;;564                ap_tp_st_touch_scan_point_record_event(s_screen_read_buffer, len + 8);
;;;565    
;;;566    			screen_int_transfer_count = app_tp_screen_analysis_int(screen_int_transfer_count, s_screen_read_buffer, (len + 8));
;;;567    			s_screen_int_transfer_status = true;
;;;568    			 
;;;569            }
;;;570    
;;;571            /**** 3. 解析本次通信数据，并准备下一次通信的buffer ****/
;;;572    /*        else
;;;573            {
;;;574                screen_int_transfer_buffer_ready = true;
;;;575    
;;;576    			screen_int_transfer_count = app_tp_screen_analysis_int(screen_int_transfer_count, s_screen_read_buffer, \
;;;577                                            (len + 8));
;;;578    			 
;;;579     //          screen_int_transfer_count = app_tp_screen_analysis_int(screen_int_transfer_count, s_screen_read_buffer, \
;;;580     //                                      screen_reg_int_data[screen_int_transfer_count].rxbuffer_size);
;;;581    
;;;582                if (screen_int_transfer_count >= screen_reg_int_data_size)       //解析需要等最后一次通信结束，最后一次数据解析后，停止通信
;;;583                {
;;;584                    screen_int_transfer_count = 0;
;;;585                    s_screen_int_transfer_status = false;
;;;586                    return;
;;;587                }
;;;588            }
;;;589    */
;;;590        }
;;;591    	#endif
;;;592    }
000042  bdf8              POP      {r3-r7,pc}
                  |L16.68|
000044  f7fffffe          BL       app_tp_transfer_screen_const
                  |L16.72|
000048  bdf8              POP      {r3-r7,pc}
                  |L16.74|
00004a  7860              LDRB     r0,[r4,#1]            ;522  ; s_screen_int_flag
00004c  2501              MOVS     r5,#1                 ;516
00004e  2800              CMP      r0,#0                 ;522
000050  d105              BNE      |L16.94|
000052  480c              LDR      r0,|L16.132|
000054  7800              LDRB     r0,[r0,#0]            ;522  ; g_screen_input_int_pad
000056  f7fffffe          BL       hal_gpio_get_input_data
00005a  2800              CMP      r0,#0                 ;522
00005c  d1f4              BNE      |L16.72|
                  |L16.94|
00005e  f7fffffe          BL       hal_i2c_m_transfer_complate
000062  2800              CMP      r0,#0                 ;523
000064  d0f0              BEQ      |L16.72|
000066  4808              LDR      r0,|L16.136|
000068  7066              STRB     r6,[r4,#1]            ;525
00006a  6800              LDR      r0,[r0,#0]            ;528  ; screen_reg_int_data
00006c  2328              MOVS     r3,#0x28              ;528
00006e  4a04              LDR      r2,|L16.128|
000070  2101              MOVS     r1,#1                 ;528
000072  f7fffffe          BL       app_tp_m_read
000076  71e5              STRB     r5,[r4,#7]            ;529
000078  bdf8              POP      {r3-r7,pc}
;;;593    
                          ENDP

00007a  0000              DCW      0x0000
                  |L16.124|
                          DCD      ||.data||
                  |L16.128|
                          DCD      ||.bss||
                  |L16.132|
                          DCD      g_screen_input_int_pad
                  |L16.136|
                          DCD      screen_reg_int_data

                          AREA ||i.app_tp_transfer_screen_restart||, CODE, READONLY, ALIGN=2

                  app_tp_transfer_screen_restart PROC
;;;452    
;;;453    void app_tp_transfer_screen_restart(void)
000000  b510              PUSH     {r4,lr}
;;;454    {
;;;455    	if(g_screen_tp_init_restart == true)
000002  4a09              LDR      r2,|L17.40|
000004  7810              LDRB     r0,[r2,#0]  ; g_screen_tp_init_restart
000006  2800              CMP      r0,#0
000008  d006              BEQ      |L17.24|
;;;456    	{
;;;457    		if(s_tp_restart_count < (65536/5))  // 65536*3 = 900ms  65536/5 = 60ms
00000a  4808              LDR      r0,|L17.44|
00000c  4b08              LDR      r3,|L17.48|
00000e  6901              LDR      r1,[r0,#0x10]  ; s_tp_restart_count
000010  4299              CMP      r1,r3
000012  d202              BCS      |L17.26|
000014  1c49              ADDS     r1,r1,#1
;;;458    		{
;;;459    	        s_tp_restart_count ++;
000016  6101              STR      r1,[r0,#0x10]  ; s_tp_restart_count
                  |L17.24|
;;;460    	    }else
;;;461    		{
;;;462    			s_tp_restart_count = 0;
;;;463    	        g_screen_tp_init_restart = false;
;;;464    	//		app_tp_transfer_screen_start();
;;;465    			ap_tp_st_touch_hardware_reset();
;;;466    	    }
;;;467    	}
;;;468        
;;;469    }
000018  bd10              POP      {r4,pc}
                  |L17.26|
00001a  2100              MOVS     r1,#0                 ;462
00001c  6101              STR      r1,[r0,#0x10]         ;463  ; s_tp_restart_count
00001e  7011              STRB     r1,[r2,#0]            ;463
000020  f7fffffe          BL       ap_tp_st_touch_hardware_reset
000024  bd10              POP      {r4,pc}
;;;470    
                          ENDP

000026  0000              DCW      0x0000
                  |L17.40|
                          DCD      g_screen_tp_init_restart
                  |L17.44|
                          DCD      ||.data||
                  |L17.48|
                          DCD      0x00003333

                          AREA ||i.app_tp_transfer_screen_start||, CODE, READONLY, ALIGN=1

                  app_tp_transfer_screen_start PROC
;;;443    
;;;444    void app_tp_transfer_screen_start(void)
000000  b510              PUSH     {r4,lr}
;;;445    {
;;;446    //    s_screen_init_complate = false;
;;;447    //    s_screen_const_transfer_count = 0;
;;;448    //    app_tp_screen_init();
;;;449    //	delayMs(10);
;;;450        app_tp_transfer_screen_const();
000002  f7fffffe          BL       app_tp_transfer_screen_const
;;;451    }
000006  bd10              POP      {r4,pc}
;;;452    
                          ENDP


                          AREA ||i.app_tp_transfer_screen_start_init||, CODE, READONLY, ALIGN=2

                  app_tp_transfer_screen_start_init PROC
;;;436    **************************************************************************/
;;;437    void app_tp_transfer_screen_start_init(void)
000000  b510              PUSH     {r4,lr}
;;;438    {
;;;439    	s_screen_init_complate = false;
000002  4803              LDR      r0,|L19.16|
000004  2100              MOVS     r1,#0
000006  70c1              STRB     r1,[r0,#3]
;;;440    	s_screen_const_transfer_count = 0;
000008  7101              STRB     r1,[r0,#4]
;;;441    	app_tp_screen_init();
00000a  f7fffffe          BL       app_tp_screen_init
;;;442    }
00000e  bd10              POP      {r4,pc}
;;;443    
                          ENDP

                  |L19.16|
                          DCD      ||.data||

                          AREA ||.bss||, DATA, NOINIT, ALIGN=0

                  s_screen_read_buffer
                          %        250
                  s_phone_read_buffer
                          %        250

                          AREA ||.data||, DATA, ALIGN=2

                  s_spim_write
000000  00                DCB      0x00
                  s_screen_int_flag
000001  00                DCB      0x00
                  s_phone_reset_flag
000002  00                DCB      0x00
                  s_screen_init_complate
000003  01                DCB      0x01
                  s_screen_const_transfer_count
000004  ff                DCB      0xff
                  i2cs_transfer
000005  01                DCB      0x01
                  screen_const_transfer_buffer_ready
000006  01                DCB      0x01
                  analysis_flag
000007  00                DCB      0x00
                  s_slave_txbuffer
                          DCD      0x00000000
                  s_slave_txbuffer_size
                          DCD      0x00000000
                  s_tp_restart_count
                          DCD      0x00000000

;*** Start embedded assembler ***

#line 1 "..\\..\\src\\app\\demo\\app_tp_transfer.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___17_app_tp_transfer_c_e672c05a____REV16|
#line 467 "C:\\Keil_v5\\ARM\\PACK\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_armcc.h"
|__asm___17_app_tp_transfer_c_e672c05a____REV16| PROC
#line 468

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE
	THUMB
	EXPORT |__asm___17_app_tp_transfer_c_e672c05a____REVSH|
#line 482
|__asm___17_app_tp_transfer_c_e672c05a____REVSH| PROC
#line 483

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
