parent
8e0643d30f
commit
2bc75a5297
|
@ -50,7 +50,7 @@
|
||||||
<InvalidFlash>1</InvalidFlash>
|
<InvalidFlash>1</InvalidFlash>
|
||||||
</TargetStatus>
|
</TargetStatus>
|
||||||
<OutputDirectory>.\Objects\</OutputDirectory>
|
<OutputDirectory>.\Objects\</OutputDirectory>
|
||||||
<OutputName>CVWL568_S21U_20230810</OutputName>
|
<OutputName>CVWL568_S21U_20230918</OutputName>
|
||||||
<CreateExecutable>1</CreateExecutable>
|
<CreateExecutable>1</CreateExecutable>
|
||||||
<CreateLib>0</CreateLib>
|
<CreateLib>0</CreateLib>
|
||||||
<CreateHexFile>1</CreateHexFile>
|
<CreateHexFile>1</CreateHexFile>
|
||||||
|
@ -408,6 +408,11 @@
|
||||||
<FileType>5</FileType>
|
<FileType>5</FileType>
|
||||||
<FilePath>..\..\src\app\demo\ap_demo_version.txt</FilePath>
|
<FilePath>..\..\src\app\demo\ap_demo_version.txt</FilePath>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>app_tp_for_custom_s21u.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\src\app\demo\app_tp_for_custom_s21u.c</FilePath>
|
||||||
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
|
@ -418,11 +423,6 @@
|
||||||
<FileType>4</FileType>
|
<FileType>4</FileType>
|
||||||
<FilePath>..\..\src\sdk\CVWL568\lib\CVWL568.lib</FilePath>
|
<FilePath>..\..\src\sdk\CVWL568\lib\CVWL568.lib</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
|
||||||
<FileName>CVWL568_S21U_TP.lib</FileName>
|
|
||||||
<FileType>4</FileType>
|
|
||||||
<FilePath>..\..\src\sdk\CVWL568\lib\CVWL568_S21U_TP.lib</FilePath>
|
|
||||||
</File>
|
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -397,6 +397,33 @@
|
||||||
|L4.172|
|
|L4.172|
|
||||||
DCD ||.data||+0xb
|
DCD ||.data||+0xb
|
||||||
|
|
||||||
|
AREA ||i.ap_tp_st_touch_error_handler_03||, CODE, READONLY, ALIGN=1
|
||||||
|
|
||||||
|
ap_tp_st_touch_error_handler_03 PROC
|
||||||
|
;;;568
|
||||||
|
;;;569 void ap_tp_st_touch_error_handler_03(uint8_t* screendata)
|
||||||
|
000000 b510 PUSH {r4,lr}
|
||||||
|
;;;570 {
|
||||||
|
;;;571 // ÊÕµ½ TP Òì³£»Ø¸´ 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
|
||||||
|
;;;572 if(screendata[0] == 0x03 && screendata[7] == 0x00)
|
||||||
|
000002 7801 LDRB r1,[r0,#0]
|
||||||
|
000004 2903 CMP r1,#3
|
||||||
|
000006 d104 BNE |L5.18|
|
||||||
|
000008 79c0 LDRB r0,[r0,#7]
|
||||||
|
00000a 2800 CMP r0,#0
|
||||||
|
00000c d101 BNE |L5.18|
|
||||||
|
;;;573 {
|
||||||
|
;;;574 // ap_tp_st_touch_software_reset();
|
||||||
|
;;;575 ap_tp_st_touch_hardware_reset();
|
||||||
|
00000e f7fffffe BL ap_tp_st_touch_hardware_reset
|
||||||
|
|L5.18|
|
||||||
|
;;;576 }
|
||||||
|
;;;577 }
|
||||||
|
000012 bd10 POP {r4,pc}
|
||||||
|
;;;578
|
||||||
|
ENDP
|
||||||
|
|
||||||
|
|
||||||
AREA ||i.ap_tp_st_touch_error_handler_F3||, CODE, READONLY, ALIGN=1
|
AREA ||i.ap_tp_st_touch_error_handler_F3||, CODE, READONLY, ALIGN=1
|
||||||
|
|
||||||
ap_tp_st_touch_error_handler_F3 PROC
|
ap_tp_st_touch_error_handler_F3 PROC
|
||||||
|
@ -409,12 +436,12 @@
|
||||||
;;;544 if(screendata[0] == 0xF3)
|
;;;544 if(screendata[0] == 0xF3)
|
||||||
000002 7800 LDRB r0,[r0,#0]
|
000002 7800 LDRB r0,[r0,#0]
|
||||||
000004 28f3 CMP r0,#0xf3
|
000004 28f3 CMP r0,#0xf3
|
||||||
000006 d101 BNE |L5.12|
|
000006 d101 BNE |L6.12|
|
||||||
;;;545 {
|
;;;545 {
|
||||||
;;;546 // ap_tp_st_touch_software_reset();
|
;;;546 // ap_tp_st_touch_software_reset();
|
||||||
;;;547 ap_tp_st_touch_hardware_reset();
|
;;;547 ap_tp_st_touch_hardware_reset();
|
||||||
000008 f7fffffe BL ap_tp_st_touch_hardware_reset
|
000008 f7fffffe BL ap_tp_st_touch_hardware_reset
|
||||||
|L5.12|
|
|L6.12|
|
||||||
;;;548 }
|
;;;548 }
|
||||||
;;;549 }
|
;;;549 }
|
||||||
00000c bd10 POP {r4,pc}
|
00000c bd10 POP {r4,pc}
|
||||||
|
@ -433,21 +460,21 @@
|
||||||
;;;562 if(screendata[1] == 0xFF && screendata[2] == 0xFF&& screendata[3] == 0xFF&&screendata[4] == 0xFF)
|
;;;562 if(screendata[1] == 0xFF && screendata[2] == 0xFF&& screendata[3] == 0xFF&&screendata[4] == 0xFF)
|
||||||
000002 7841 LDRB r1,[r0,#1]
|
000002 7841 LDRB r1,[r0,#1]
|
||||||
000004 29ff CMP r1,#0xff
|
000004 29ff CMP r1,#0xff
|
||||||
000006 d10a BNE |L6.30|
|
000006 d10a BNE |L7.30|
|
||||||
000008 7881 LDRB r1,[r0,#2]
|
000008 7881 LDRB r1,[r0,#2]
|
||||||
00000a 29ff CMP r1,#0xff
|
00000a 29ff CMP r1,#0xff
|
||||||
00000c d107 BNE |L6.30|
|
00000c d107 BNE |L7.30|
|
||||||
00000e 78c1 LDRB r1,[r0,#3]
|
00000e 78c1 LDRB r1,[r0,#3]
|
||||||
000010 29ff CMP r1,#0xff
|
000010 29ff CMP r1,#0xff
|
||||||
000012 d104 BNE |L6.30|
|
000012 d104 BNE |L7.30|
|
||||||
000014 7900 LDRB r0,[r0,#4]
|
000014 7900 LDRB r0,[r0,#4]
|
||||||
000016 28ff CMP r0,#0xff
|
000016 28ff CMP r0,#0xff
|
||||||
000018 d101 BNE |L6.30|
|
000018 d101 BNE |L7.30|
|
||||||
;;;563 {
|
;;;563 {
|
||||||
;;;564 // ap_tp_st_touch_software_reset();
|
;;;564 // ap_tp_st_touch_software_reset();
|
||||||
;;;565 ap_tp_st_touch_hardware_reset();
|
;;;565 ap_tp_st_touch_hardware_reset();
|
||||||
00001a f7fffffe BL ap_tp_st_touch_hardware_reset
|
00001a f7fffffe BL ap_tp_st_touch_hardware_reset
|
||||||
|L6.30|
|
|L7.30|
|
||||||
;;;566 }
|
;;;566 }
|
||||||
;;;567 }
|
;;;567 }
|
||||||
00001e bd10 POP {r4,pc}
|
00001e bd10 POP {r4,pc}
|
||||||
|
@ -463,13 +490,13 @@
|
||||||
000000 b500 PUSH {lr}
|
000000 b500 PUSH {lr}
|
||||||
;;;58 {
|
;;;58 {
|
||||||
;;;59 uint8_t cali_send_buff[6] = {0xFA,0x20,0x01,0x00,0x00,0x00};
|
;;;59 uint8_t cali_send_buff[6] = {0xFA,0x20,0x01,0x00,0x00,0x00};
|
||||||
000002 a125 ADR r1,|L7.152|
|
000002 a125 ADR r1,|L8.152|
|
||||||
000004 c903 LDM r1,{r0,r1}
|
000004 c903 LDM r1,{r0,r1}
|
||||||
000006 b08d SUB sp,sp,#0x34 ;58
|
000006 b08d SUB sp,sp,#0x34 ;58
|
||||||
;;;60 uint8_t cali_send_buff1[3] = {0xA4,0x06,0x01};
|
;;;60 uint8_t cali_send_buff1[3] = {0xA4,0x06,0x01};
|
||||||
000008 910b STR r1,[sp,#0x2c]
|
000008 910b STR r1,[sp,#0x2c]
|
||||||
00000a 900a STR r0,[sp,#0x28]
|
00000a 900a STR r0,[sp,#0x28]
|
||||||
00000c a024 ADR r0,|L7.160|
|
00000c a024 ADR r0,|L8.160|
|
||||||
00000e 6800 LDR r0,[r0,#0]
|
00000e 6800 LDR r0,[r0,#0]
|
||||||
;;;61 uint8_t cali_read_buff[40] = {0};
|
;;;61 uint8_t cali_read_buff[40] = {0};
|
||||||
000010 900c STR r0,[sp,#0x30]
|
000010 900c STR r0,[sp,#0x30]
|
||||||
|
@ -484,11 +511,11 @@
|
||||||
00001e 2105 MOVS r1,#5
|
00001e 2105 MOVS r1,#5
|
||||||
000020 a80a ADD r0,sp,#0x28
|
000020 a80a ADD r0,sp,#0x28
|
||||||
000022 f7fffffe BL app_tp_m_read
|
000022 f7fffffe BL app_tp_m_read
|
||||||
|L7.38|
|
|L8.38|
|
||||||
;;;65 while(!hal_i2c_m_transfer_complate());
|
;;;65 while(!hal_i2c_m_transfer_complate());
|
||||||
000026 f7fffffe BL hal_i2c_m_transfer_complate
|
000026 f7fffffe BL hal_i2c_m_transfer_complate
|
||||||
00002a 2800 CMP r0,#0
|
00002a 2800 CMP r0,#0
|
||||||
00002c d0fb BEQ |L7.38|
|
00002c d0fb BEQ |L8.38|
|
||||||
;;;66 delayMs(1);
|
;;;66 delayMs(1);
|
||||||
00002e 2001 MOVS r0,#1
|
00002e 2001 MOVS r0,#1
|
||||||
000030 f7fffffe BL delayMs
|
000030 f7fffffe BL delayMs
|
||||||
|
@ -497,11 +524,11 @@
|
||||||
000034 2103 MOVS r1,#3
|
000034 2103 MOVS r1,#3
|
||||||
000036 a80c ADD r0,sp,#0x30
|
000036 a80c ADD r0,sp,#0x30
|
||||||
000038 f7fffffe BL app_tp_m_write
|
000038 f7fffffe BL app_tp_m_write
|
||||||
|L7.60|
|
|L8.60|
|
||||||
;;;69 while(!hal_i2c_m_transfer_complate());
|
;;;69 while(!hal_i2c_m_transfer_complate());
|
||||||
00003c f7fffffe BL hal_i2c_m_transfer_complate
|
00003c f7fffffe BL hal_i2c_m_transfer_complate
|
||||||
000040 2800 CMP r0,#0
|
000040 2800 CMP r0,#0
|
||||||
000042 d0fb BEQ |L7.60|
|
000042 d0fb BEQ |L8.60|
|
||||||
;;;70 delayMs(1);
|
;;;70 delayMs(1);
|
||||||
000044 2001 MOVS r0,#1
|
000044 2001 MOVS r0,#1
|
||||||
000046 f7fffffe BL delayMs
|
000046 f7fffffe BL delayMs
|
||||||
|
@ -512,11 +539,11 @@
|
||||||
00004e 2105 MOVS r1,#5
|
00004e 2105 MOVS r1,#5
|
||||||
000050 a80a ADD r0,sp,#0x28
|
000050 a80a ADD r0,sp,#0x28
|
||||||
000052 f7fffffe BL app_tp_m_read
|
000052 f7fffffe BL app_tp_m_read
|
||||||
|L7.86|
|
|L8.86|
|
||||||
;;;73 while(!hal_i2c_m_transfer_complate());
|
;;;73 while(!hal_i2c_m_transfer_complate());
|
||||||
000056 f7fffffe BL hal_i2c_m_transfer_complate
|
000056 f7fffffe BL hal_i2c_m_transfer_complate
|
||||||
00005a 2800 CMP r0,#0
|
00005a 2800 CMP r0,#0
|
||||||
00005c d0fb BEQ |L7.86|
|
00005c d0fb BEQ |L8.86|
|
||||||
;;;74 delayMs(1);
|
;;;74 delayMs(1);
|
||||||
00005e 2001 MOVS r0,#1
|
00005e 2001 MOVS r0,#1
|
||||||
000060 f7fffffe BL delayMs
|
000060 f7fffffe BL delayMs
|
||||||
|
@ -527,31 +554,31 @@
|
||||||
000068 2105 MOVS r1,#5
|
000068 2105 MOVS r1,#5
|
||||||
00006a a80a ADD r0,sp,#0x28
|
00006a a80a ADD r0,sp,#0x28
|
||||||
00006c f7fffffe BL app_tp_m_read
|
00006c f7fffffe BL app_tp_m_read
|
||||||
|L7.112|
|
|L8.112|
|
||||||
;;;77 while(!hal_i2c_m_transfer_complate());
|
;;;77 while(!hal_i2c_m_transfer_complate());
|
||||||
000070 f7fffffe BL hal_i2c_m_transfer_complate
|
000070 f7fffffe BL hal_i2c_m_transfer_complate
|
||||||
000074 2800 CMP r0,#0
|
000074 2800 CMP r0,#0
|
||||||
000076 d0fb BEQ |L7.112|
|
000076 d0fb BEQ |L8.112|
|
||||||
;;;78
|
;;;78
|
||||||
;;;79 if((cali_read_buff[20] == 0xFF) && (cali_read_buff[21] == 0xFF))
|
;;;79 if((cali_read_buff[20] == 0xFF) && (cali_read_buff[21] == 0xFF))
|
||||||
000078 4668 MOV r0,sp
|
000078 4668 MOV r0,sp
|
||||||
00007a 7d01 LDRB r1,[r0,#0x14]
|
00007a 7d01 LDRB r1,[r0,#0x14]
|
||||||
;;;80 {
|
;;;80 {
|
||||||
;;;81 s_calibration_correct_flag = ST_TP_CALIBRATION_SUCCESS; // 校准成功
|
;;;81 s_calibration_correct_flag = ST_TP_CALIBRATION_SUCCESS; // 校准成功
|
||||||
00007c 4809 LDR r0,|L7.164|
|
00007c 4809 LDR r0,|L8.164|
|
||||||
00007e 29ff CMP r1,#0xff ;79
|
00007e 29ff CMP r1,#0xff ;79
|
||||||
000080 d103 BNE |L7.138|
|
000080 d103 BNE |L8.138|
|
||||||
000082 4669 MOV r1,sp ;79
|
000082 4669 MOV r1,sp ;79
|
||||||
000084 7d49 LDRB r1,[r1,#0x15] ;79
|
000084 7d49 LDRB r1,[r1,#0x15] ;79
|
||||||
000086 29ff CMP r1,#0xff ;79
|
000086 29ff CMP r1,#0xff ;79
|
||||||
000088 d003 BEQ |L7.146|
|
000088 d003 BEQ |L8.146|
|
||||||
|L7.138|
|
|L8.138|
|
||||||
;;;82 }
|
;;;82 }
|
||||||
;;;83 else
|
;;;83 else
|
||||||
;;;84 {
|
;;;84 {
|
||||||
;;;85 s_calibration_correct_flag = 0x00; // 校准失败
|
;;;85 s_calibration_correct_flag = 0x00; // 校准失败
|
||||||
00008a 2100 MOVS r1,#0
|
00008a 2100 MOVS r1,#0
|
||||||
|L7.140|
|
|L8.140|
|
||||||
00008c 7041 STRB r1,[r0,#1] ;81
|
00008c 7041 STRB r1,[r0,#1] ;81
|
||||||
;;;86 }
|
;;;86 }
|
||||||
;;;87 /*
|
;;;87 /*
|
||||||
|
@ -563,22 +590,22 @@
|
||||||
;;;93 }
|
;;;93 }
|
||||||
00008e b00d ADD sp,sp,#0x34
|
00008e b00d ADD sp,sp,#0x34
|
||||||
000090 bd00 POP {pc}
|
000090 bd00 POP {pc}
|
||||||
|L7.146|
|
|L8.146|
|
||||||
000092 215a MOVS r1,#0x5a ;81
|
000092 215a MOVS r1,#0x5a ;81
|
||||||
000094 e7fa B |L7.140|
|
000094 e7fa B |L8.140|
|
||||||
;;;94
|
;;;94
|
||||||
ENDP
|
ENDP
|
||||||
|
|
||||||
000096 0000 DCW 0x0000
|
000096 0000 DCW 0x0000
|
||||||
|L7.152|
|
|L8.152|
|
||||||
000098 fa200100 DCB 250," ",1,0
|
000098 fa200100 DCB 250," ",1,0
|
||||||
00009c 00 DCB 0
|
00009c 00 DCB 0
|
||||||
00009d 00 DCB 0
|
00009d 00 DCB 0
|
||||||
00009e 00 DCB 0
|
00009e 00 DCB 0
|
||||||
00009f 00 DCB 0
|
00009f 00 DCB 0
|
||||||
|L7.160|
|
|L8.160|
|
||||||
0000a0 a4060100 DCB 164,6,1,0
|
0000a0 a4060100 DCB 164,6,1,0
|
||||||
|L7.164|
|
|L8.164|
|
||||||
DCD ||.data||
|
DCD ||.data||
|
||||||
|
|
||||||
AREA ||i.ap_tp_st_touch_hardware_reset||, CODE, READONLY, ALIGN=2
|
AREA ||i.ap_tp_st_touch_hardware_reset||, CODE, READONLY, ALIGN=2
|
||||||
|
@ -591,15 +618,15 @@
|
||||||
;;;414 TAU_LOGD("st_touch_hardware_reset \n");
|
;;;414 TAU_LOGD("st_touch_hardware_reset \n");
|
||||||
000002 22ff MOVS r2,#0xff
|
000002 22ff MOVS r2,#0xff
|
||||||
000004 329f ADDS r2,r2,#0x9f
|
000004 329f ADDS r2,r2,#0x9f
|
||||||
000006 a121 ADR r1,|L8.140|
|
000006 a121 ADR r1,|L9.140|
|
||||||
000008 a022 ADR r0,|L8.148|
|
000008 a022 ADR r0,|L9.148|
|
||||||
00000a f7fffffe BL LOG_printf
|
00000a f7fffffe BL LOG_printf
|
||||||
;;;415 ap_tp_st_touch_simulate_finger_release_event();
|
;;;415 ap_tp_st_touch_simulate_finger_release_event();
|
||||||
00000e f7fffffe BL ap_tp_st_touch_simulate_finger_release_event
|
00000e f7fffffe BL ap_tp_st_touch_simulate_finger_release_event
|
||||||
;;;416 ap_tp_st_touch_scan_point_init();
|
;;;416 ap_tp_st_touch_scan_point_init();
|
||||||
000012 f7fffffe BL ap_tp_st_touch_scan_point_init
|
000012 f7fffffe BL ap_tp_st_touch_scan_point_init
|
||||||
;;;417 hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_HIGH);
|
;;;417 hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_HIGH);
|
||||||
000016 4c29 LDR r4,|L8.188|
|
000016 4c29 LDR r4,|L9.188|
|
||||||
000018 2101 MOVS r1,#1
|
000018 2101 MOVS r1,#1
|
||||||
00001a 7820 LDRB r0,[r4,#0] ; g_screen_input_rst_pad
|
00001a 7820 LDRB r0,[r4,#0] ; g_screen_input_rst_pad
|
||||||
00001c f7fffffe BL hal_gpio_set_output_data
|
00001c f7fffffe BL hal_gpio_set_output_data
|
||||||
|
@ -623,39 +650,39 @@
|
||||||
;;;423
|
;;;423
|
||||||
;;;424 app_tp_m_write(st_touch_tp_tuning_clearfifo, sizeof(st_touch_tp_tuning_clearfifo));//0xA4,0x00,0x01}
|
;;;424 app_tp_m_write(st_touch_tp_tuning_clearfifo, sizeof(st_touch_tp_tuning_clearfifo));//0xA4,0x00,0x01}
|
||||||
000042 2103 MOVS r1,#3
|
000042 2103 MOVS r1,#3
|
||||||
000044 481e LDR r0,|L8.192|
|
000044 481e LDR r0,|L9.192|
|
||||||
000046 f7fffffe BL app_tp_m_write
|
000046 f7fffffe BL app_tp_m_write
|
||||||
|L8.74|
|
|L9.74|
|
||||||
;;;425 while(!hal_i2c_m_transfer_complate());
|
;;;425 while(!hal_i2c_m_transfer_complate());
|
||||||
00004a f7fffffe BL hal_i2c_m_transfer_complate
|
00004a f7fffffe BL hal_i2c_m_transfer_complate
|
||||||
00004e 2800 CMP r0,#0
|
00004e 2800 CMP r0,#0
|
||||||
000050 d0fb BEQ |L8.74|
|
000050 d0fb BEQ |L9.74|
|
||||||
;;;426 delayMs(5);
|
;;;426 delayMs(5);
|
||||||
000052 2005 MOVS r0,#5
|
000052 2005 MOVS r0,#5
|
||||||
000054 f7fffffe BL delayMs
|
000054 f7fffffe BL delayMs
|
||||||
;;;427 app_tp_m_write(st_touch_init_sensor_off, sizeof(st_touch_init_sensor_off));//0xA0,0x00,0x00
|
;;;427 app_tp_m_write(st_touch_init_sensor_off, sizeof(st_touch_init_sensor_off));//0xA0,0x00,0x00
|
||||||
000058 4819 LDR r0,|L8.192|
|
000058 4819 LDR r0,|L9.192|
|
||||||
00005a 2103 MOVS r1,#3
|
00005a 2103 MOVS r1,#3
|
||||||
00005c 3818 SUBS r0,r0,#0x18
|
00005c 3818 SUBS r0,r0,#0x18
|
||||||
00005e f7fffffe BL app_tp_m_write
|
00005e f7fffffe BL app_tp_m_write
|
||||||
|L8.98|
|
|L9.98|
|
||||||
;;;428 while(!hal_i2c_m_transfer_complate());
|
;;;428 while(!hal_i2c_m_transfer_complate());
|
||||||
000062 f7fffffe BL hal_i2c_m_transfer_complate
|
000062 f7fffffe BL hal_i2c_m_transfer_complate
|
||||||
000066 2800 CMP r0,#0
|
000066 2800 CMP r0,#0
|
||||||
000068 d0fb BEQ |L8.98|
|
000068 d0fb BEQ |L9.98|
|
||||||
;;;429 delayMs(5);
|
;;;429 delayMs(5);
|
||||||
00006a 2005 MOVS r0,#5
|
00006a 2005 MOVS r0,#5
|
||||||
00006c f7fffffe BL delayMs
|
00006c f7fffffe BL delayMs
|
||||||
;;;430 app_tp_m_write(st_touch_init_sensor_on, sizeof(st_touch_init_sensor_on));//0xA0,0x00,0x01
|
;;;430 app_tp_m_write(st_touch_init_sensor_on, sizeof(st_touch_init_sensor_on));//0xA0,0x00,0x01
|
||||||
000070 4813 LDR r0,|L8.192|
|
000070 4813 LDR r0,|L9.192|
|
||||||
000072 2103 MOVS r1,#3
|
000072 2103 MOVS r1,#3
|
||||||
000074 3815 SUBS r0,r0,#0x15
|
000074 3815 SUBS r0,r0,#0x15
|
||||||
000076 f7fffffe BL app_tp_m_write
|
000076 f7fffffe BL app_tp_m_write
|
||||||
|L8.122|
|
|L9.122|
|
||||||
;;;431 while(!hal_i2c_m_transfer_complate());
|
;;;431 while(!hal_i2c_m_transfer_complate());
|
||||||
00007a f7fffffe BL hal_i2c_m_transfer_complate
|
00007a f7fffffe BL hal_i2c_m_transfer_complate
|
||||||
00007e 2800 CMP r0,#0
|
00007e 2800 CMP r0,#0
|
||||||
000080 d0fb BEQ |L8.122|
|
000080 d0fb BEQ |L9.122|
|
||||||
;;;432 delayMs(5);
|
;;;432 delayMs(5);
|
||||||
000082 2005 MOVS r0,#5
|
000082 2005 MOVS r0,#5
|
||||||
000084 f7fffffe BL delayMs
|
000084 f7fffffe BL delayMs
|
||||||
|
@ -665,10 +692,10 @@
|
||||||
ENDP
|
ENDP
|
||||||
|
|
||||||
00008a 0000 DCW 0x0000
|
00008a 0000 DCW 0x0000
|
||||||
|L8.140|
|
|L9.140|
|
||||||
00008c 7461755f DCB "tau_log",0
|
00008c 7461755f DCB "tau_log",0
|
||||||
000090 6c6f6700
|
000090 6c6f6700
|
||||||
|L8.148|
|
|L9.148|
|
||||||
000094 5b25735d DCB "[%s] (%04d) st_touch_hardware_reset \n",0
|
000094 5b25735d DCB "[%s] (%04d) st_touch_hardware_reset \n",0
|
||||||
000098 20282530
|
000098 20282530
|
||||||
00009c 34642920
|
00009c 34642920
|
||||||
|
@ -681,9 +708,9 @@
|
||||||
0000b8 0a00
|
0000b8 0a00
|
||||||
0000ba 00 DCB 0
|
0000ba 00 DCB 0
|
||||||
0000bb 00 DCB 0
|
0000bb 00 DCB 0
|
||||||
|L8.188|
|
|L9.188|
|
||||||
DCD g_screen_input_rst_pad
|
DCD g_screen_input_rst_pad
|
||||||
|L8.192|
|
|L9.192|
|
||||||
DCD ||.data||+0x1a
|
DCD ||.data||+0x1a
|
||||||
|
|
||||||
AREA ||i.ap_tp_st_touch_scan_point_init||, CODE, READONLY, ALIGN=2
|
AREA ||i.ap_tp_st_touch_scan_point_init||, CODE, READONLY, ALIGN=2
|
||||||
|
@ -697,14 +724,14 @@
|
||||||
;;;339
|
;;;339
|
||||||
;;;340 for(i=0;i<ST_TP_SCAN_POINT_NUMBER_MAX;i++)
|
;;;340 for(i=0;i<ST_TP_SCAN_POINT_NUMBER_MAX;i++)
|
||||||
;;;341 tp_scan_data.tp_point_buffer[i] = 0;
|
;;;341 tp_scan_data.tp_point_buffer[i] = 0;
|
||||||
000002 4a05 LDR r2,|L9.24|
|
000002 4a05 LDR r2,|L10.24|
|
||||||
000004 4601 MOV r1,r0 ;338
|
000004 4601 MOV r1,r0 ;338
|
||||||
|L9.6|
|
|L10.6|
|
||||||
000006 5411 STRB r1,[r2,r0]
|
000006 5411 STRB r1,[r2,r0]
|
||||||
000008 1c40 ADDS r0,r0,#1
|
000008 1c40 ADDS r0,r0,#1
|
||||||
00000a b2c0 UXTB r0,r0 ;340
|
00000a b2c0 UXTB r0,r0 ;340
|
||||||
00000c 2806 CMP r0,#6 ;340
|
00000c 2806 CMP r0,#6 ;340
|
||||||
00000e d3fa BCC |L9.6|
|
00000e d3fa BCC |L10.6|
|
||||||
;;;342 tp_scan_data.tp_point_up_error_flag = 0;
|
;;;342 tp_scan_data.tp_point_up_error_flag = 0;
|
||||||
000010 71d1 STRB r1,[r2,#7]
|
000010 71d1 STRB r1,[r2,#7]
|
||||||
;;;343 tp_scan_data.tp_read_point_counter = 0;
|
;;;343 tp_scan_data.tp_read_point_counter = 0;
|
||||||
|
@ -716,7 +743,7 @@
|
||||||
;;;346
|
;;;346
|
||||||
ENDP
|
ENDP
|
||||||
|
|
||||||
|L9.24|
|
|L10.24|
|
||||||
DCD ||.bss||
|
DCD ||.bss||
|
||||||
|
|
||||||
AREA ||i.ap_tp_st_touch_scan_point_record_event||, CODE, READONLY, ALIGN=2
|
AREA ||i.ap_tp_st_touch_scan_point_record_event||, CODE, READONLY, ALIGN=2
|
||||||
|
@ -741,9 +768,9 @@
|
||||||
;;;455 for(j=0;j<ST_TP_SCAN_POINT_NUMBER_MAX;j++)
|
;;;455 for(j=0;j<ST_TP_SCAN_POINT_NUMBER_MAX;j++)
|
||||||
;;;456 {
|
;;;456 {
|
||||||
;;;457 if(tp_scan_data.tp_point_buffer[j] == eventid)
|
;;;457 if(tp_scan_data.tp_point_buffer[j] == eventid)
|
||||||
000006 4a22 LDR r2,|L10.144|
|
000006 4a22 LDR r2,|L11.144|
|
||||||
000008 e00e B |L10.40|
|
000008 e00e B |L11.40|
|
||||||
|L10.10|
|
|L11.10|
|
||||||
00000a 18c4 ADDS r4,r0,r3 ;450
|
00000a 18c4 ADDS r4,r0,r3 ;450
|
||||||
00000c 7864 LDRB r4,[r4,#1] ;450
|
00000c 7864 LDRB r4,[r4,#1] ;450
|
||||||
00000e 5cc6 LDRB r6,[r0,r3] ;449
|
00000e 5cc6 LDRB r6,[r0,r3] ;449
|
||||||
|
@ -752,7 +779,7 @@
|
||||||
000014 1c64 ADDS r4,r4,#1 ;451
|
000014 1c64 ADDS r4,r4,#1 ;451
|
||||||
000016 b2dd UXTB r5,r3 ;451
|
000016 b2dd UXTB r5,r3 ;451
|
||||||
000018 2e13 CMP r6,#0x13 ;453
|
000018 2e13 CMP r6,#0x13 ;453
|
||||||
00001a d008 BEQ |L10.46|
|
00001a d008 BEQ |L11.46|
|
||||||
;;;458 {
|
;;;458 {
|
||||||
;;;459 flag = 1;
|
;;;459 flag = 1;
|
||||||
;;;460 break;
|
;;;460 break;
|
||||||
|
@ -776,7 +803,7 @@
|
||||||
;;;478
|
;;;478
|
||||||
;;;479 if(eventdata == 0x33 && (tp_scan_data.tp_read_point_counter>0)) // 释放事件
|
;;;479 if(eventdata == 0x33 && (tp_scan_data.tp_read_point_counter>0)) // 释放事件
|
||||||
00001c 2e33 CMP r6,#0x33
|
00001c 2e33 CMP r6,#0x33
|
||||||
00001e d020 BEQ |L10.98|
|
00001e d020 BEQ |L11.98|
|
||||||
;;;480 {
|
;;;480 {
|
||||||
;;;481 for(j=0;j<ST_TP_SCAN_POINT_NUMBER_MAX;j++)
|
;;;481 for(j=0;j<ST_TP_SCAN_POINT_NUMBER_MAX;j++)
|
||||||
;;;482 {
|
;;;482 {
|
||||||
|
@ -794,13 +821,13 @@
|
||||||
;;;494
|
;;;494
|
||||||
;;;495 if(eventdata == 0x23) // 移动MOVE事件
|
;;;495 if(eventdata == 0x23) // 移动MOVE事件
|
||||||
000020 2e23 CMP r6,#0x23
|
000020 2e23 CMP r6,#0x23
|
||||||
000022 d02f BEQ |L10.132|
|
000022 d02f BEQ |L11.132|
|
||||||
|L10.36|
|
|L11.36|
|
||||||
000024 1c6d ADDS r5,r5,#1
|
000024 1c6d ADDS r5,r5,#1
|
||||||
000026 b2eb UXTB r3,r5 ;447
|
000026 b2eb UXTB r3,r5 ;447
|
||||||
|L10.40|
|
|L11.40|
|
||||||
000028 428b CMP r3,r1 ;447
|
000028 428b CMP r3,r1 ;447
|
||||||
00002a d3ee BCC |L10.10|
|
00002a d3ee BCC |L11.10|
|
||||||
;;;496 {
|
;;;496 {
|
||||||
;;;497 tp_scan_data.tp_point_up_error_flag = 1;
|
;;;497 tp_scan_data.tp_point_up_error_flag = 1;
|
||||||
;;;498 tp_scan_data.tp_point_error_time_counter = 0;
|
;;;498 tp_scan_data.tp_point_error_time_counter = 0;
|
||||||
|
@ -808,68 +835,68 @@
|
||||||
;;;500 }
|
;;;500 }
|
||||||
;;;501 }
|
;;;501 }
|
||||||
00002c bdf0 POP {r4-r7,pc}
|
00002c bdf0 POP {r4-r7,pc}
|
||||||
|L10.46|
|
|L11.46|
|
||||||
00002e 2300 MOVS r3,#0 ;455
|
00002e 2300 MOVS r3,#0 ;455
|
||||||
|L10.48|
|
|L11.48|
|
||||||
000030 5cd6 LDRB r6,[r2,r3] ;457
|
000030 5cd6 LDRB r6,[r2,r3] ;457
|
||||||
000032 42a6 CMP r6,r4 ;457
|
000032 42a6 CMP r6,r4 ;457
|
||||||
000034 d101 BNE |L10.58|
|
000034 d101 BNE |L11.58|
|
||||||
000036 2701 MOVS r7,#1 ;459
|
000036 2701 MOVS r7,#1 ;459
|
||||||
000038 e7f4 B |L10.36|
|
000038 e7f4 B |L11.36|
|
||||||
|L10.58|
|
|L11.58|
|
||||||
00003a 1c5b ADDS r3,r3,#1 ;460
|
00003a 1c5b ADDS r3,r3,#1 ;460
|
||||||
00003c b2db UXTB r3,r3 ;455
|
00003c b2db UXTB r3,r3 ;455
|
||||||
00003e 2b06 CMP r3,#6 ;455
|
00003e 2b06 CMP r3,#6 ;455
|
||||||
000040 d3f6 BCC |L10.48|
|
000040 d3f6 BCC |L11.48|
|
||||||
000042 2f00 CMP r7,#0 ;464
|
000042 2f00 CMP r7,#0 ;464
|
||||||
000044 d1ee BNE |L10.36|
|
000044 d1ee BNE |L11.36|
|
||||||
000046 2300 MOVS r3,#0 ;466
|
000046 2300 MOVS r3,#0 ;466
|
||||||
|L10.72|
|
|L11.72|
|
||||||
000048 5cd6 LDRB r6,[r2,r3] ;468
|
000048 5cd6 LDRB r6,[r2,r3] ;468
|
||||||
00004a 2e00 CMP r6,#0 ;468
|
00004a 2e00 CMP r6,#0 ;468
|
||||||
00004c d004 BEQ |L10.88|
|
00004c d004 BEQ |L11.88|
|
||||||
00004e 1c5b ADDS r3,r3,#1 ;468
|
00004e 1c5b ADDS r3,r3,#1 ;468
|
||||||
000050 b2db UXTB r3,r3 ;466
|
000050 b2db UXTB r3,r3 ;466
|
||||||
000052 2b06 CMP r3,#6 ;466
|
000052 2b06 CMP r3,#6 ;466
|
||||||
000054 d3f8 BCC |L10.72|
|
000054 d3f8 BCC |L11.72|
|
||||||
000056 e7e5 B |L10.36|
|
000056 e7e5 B |L11.36|
|
||||||
|L10.88|
|
|L11.88|
|
||||||
000058 54d4 STRB r4,[r2,r3] ;470
|
000058 54d4 STRB r4,[r2,r3] ;470
|
||||||
00005a 7993 LDRB r3,[r2,#6] ;471 ; tp_scan_data
|
00005a 7993 LDRB r3,[r2,#6] ;471 ; tp_scan_data
|
||||||
00005c 1c5b ADDS r3,r3,#1 ;471
|
00005c 1c5b ADDS r3,r3,#1 ;471
|
||||||
00005e 7193 STRB r3,[r2,#6] ;471
|
00005e 7193 STRB r3,[r2,#6] ;471
|
||||||
000060 e7e0 B |L10.36|
|
000060 e7e0 B |L11.36|
|
||||||
|L10.98|
|
|L11.98|
|
||||||
000062 7993 LDRB r3,[r2,#6] ;479 ; tp_scan_data
|
000062 7993 LDRB r3,[r2,#6] ;479 ; tp_scan_data
|
||||||
000064 2b00 CMP r3,#0 ;479
|
000064 2b00 CMP r3,#0 ;479
|
||||||
000066 d0dd BEQ |L10.36|
|
000066 d0dd BEQ |L11.36|
|
||||||
000068 2300 MOVS r3,#0 ;481
|
000068 2300 MOVS r3,#0 ;481
|
||||||
|L10.106|
|
|L11.106|
|
||||||
00006a 5cd6 LDRB r6,[r2,r3] ;483
|
00006a 5cd6 LDRB r6,[r2,r3] ;483
|
||||||
00006c 42a6 CMP r6,r4 ;483
|
00006c 42a6 CMP r6,r4 ;483
|
||||||
00006e d105 BNE |L10.124|
|
00006e d105 BNE |L11.124|
|
||||||
000070 2400 MOVS r4,#0 ;485
|
000070 2400 MOVS r4,#0 ;485
|
||||||
000072 54d4 STRB r4,[r2,r3] ;485
|
000072 54d4 STRB r4,[r2,r3] ;485
|
||||||
000074 7993 LDRB r3,[r2,#6] ;486 ; tp_scan_data
|
000074 7993 LDRB r3,[r2,#6] ;486 ; tp_scan_data
|
||||||
000076 1e5b SUBS r3,r3,#1 ;486
|
000076 1e5b SUBS r3,r3,#1 ;486
|
||||||
000078 7193 STRB r3,[r2,#6] ;486
|
000078 7193 STRB r3,[r2,#6] ;486
|
||||||
00007a e003 B |L10.132|
|
00007a e003 B |L11.132|
|
||||||
|L10.124|
|
|L11.124|
|
||||||
00007c 1c5b ADDS r3,r3,#1 ;487
|
00007c 1c5b ADDS r3,r3,#1 ;487
|
||||||
00007e b2db UXTB r3,r3 ;481
|
00007e b2db UXTB r3,r3 ;481
|
||||||
000080 2b06 CMP r3,#6 ;481
|
000080 2b06 CMP r3,#6 ;481
|
||||||
000082 d3f2 BCC |L10.106|
|
000082 d3f2 BCC |L11.106|
|
||||||
|L10.132|
|
|L11.132|
|
||||||
000084 2301 MOVS r3,#1 ;491
|
000084 2301 MOVS r3,#1 ;491
|
||||||
000086 71d3 STRB r3,[r2,#7] ;491
|
000086 71d3 STRB r3,[r2,#7] ;491
|
||||||
000088 2300 MOVS r3,#0 ;492
|
000088 2300 MOVS r3,#0 ;492
|
||||||
00008a 6093 STR r3,[r2,#8] ;492 ; tp_scan_data
|
00008a 6093 STR r3,[r2,#8] ;492 ; tp_scan_data
|
||||||
00008c e7ca B |L10.36|
|
00008c e7ca B |L11.36|
|
||||||
;;;502
|
;;;502
|
||||||
ENDP
|
ENDP
|
||||||
|
|
||||||
00008e 0000 DCW 0x0000
|
00008e 0000 DCW 0x0000
|
||||||
|L10.144|
|
|L11.144|
|
||||||
DCD ||.bss||
|
DCD ||.bss||
|
||||||
|
|
||||||
AREA ||i.ap_tp_st_touch_scan_point_record_event_exec||, CODE, READONLY, ALIGN=2
|
AREA ||i.ap_tp_st_touch_scan_point_record_event_exec||, CODE, READONLY, ALIGN=2
|
||||||
|
@ -885,21 +912,21 @@
|
||||||
000000 b510 PUSH {r4,lr}
|
000000 b510 PUSH {r4,lr}
|
||||||
;;;512 {
|
;;;512 {
|
||||||
;;;513 if(tp_scan_data.tp_point_up_error_flag == 1)
|
;;;513 if(tp_scan_data.tp_point_up_error_flag == 1)
|
||||||
000002 4c0c LDR r4,|L11.52|
|
000002 4c0c LDR r4,|L12.52|
|
||||||
000004 79e0 LDRB r0,[r4,#7] ; tp_scan_data
|
000004 79e0 LDRB r0,[r4,#7] ; tp_scan_data
|
||||||
000006 2801 CMP r0,#1
|
000006 2801 CMP r0,#1
|
||||||
000008 d105 BNE |L11.22|
|
000008 d105 BNE |L12.22|
|
||||||
;;;514 {
|
;;;514 {
|
||||||
;;;515 if(tp_scan_data.tp_point_error_time_counter < (65536/10)) // 65536*3 = 900ms 65536/10 = 30ms
|
;;;515 if(tp_scan_data.tp_point_error_time_counter < (65536/10)) // 65536*3 = 900ms 65536/10 = 30ms
|
||||||
00000a 490b LDR r1,|L11.56|
|
00000a 490b LDR r1,|L12.56|
|
||||||
00000c 68a0 LDR r0,[r4,#8] ; tp_scan_data
|
00000c 68a0 LDR r0,[r4,#8] ; tp_scan_data
|
||||||
00000e 4288 CMP r0,r1
|
00000e 4288 CMP r0,r1
|
||||||
000010 d202 BCS |L11.24|
|
000010 d202 BCS |L12.24|
|
||||||
000012 1c40 ADDS r0,r0,#1
|
000012 1c40 ADDS r0,r0,#1
|
||||||
;;;516 {
|
;;;516 {
|
||||||
;;;517 tp_scan_data.tp_point_error_time_counter ++;
|
;;;517 tp_scan_data.tp_point_error_time_counter ++;
|
||||||
000014 60a0 STR r0,[r4,#8] ; tp_scan_data
|
000014 60a0 STR r0,[r4,#8] ; tp_scan_data
|
||||||
|L11.22|
|
|L12.22|
|
||||||
;;;518 }
|
;;;518 }
|
||||||
;;;519 else // 没有收到move 或者release 时间超时
|
;;;519 else // 没有收到move 或者release 时间超时
|
||||||
;;;520 {
|
;;;520 {
|
||||||
|
@ -914,27 +941,27 @@
|
||||||
;;;529 }
|
;;;529 }
|
||||||
;;;530 }
|
;;;530 }
|
||||||
000016 bd10 POP {r4,pc}
|
000016 bd10 POP {r4,pc}
|
||||||
|L11.24|
|
|L12.24|
|
||||||
000018 79a1 LDRB r1,[r4,#6] ;521 ; tp_scan_data
|
000018 79a1 LDRB r1,[r4,#6] ;521 ; tp_scan_data
|
||||||
00001a 2900 CMP r1,#0 ;521
|
00001a 2900 CMP r1,#0 ;521
|
||||||
00001c d006 BEQ |L11.44|
|
00001c d006 BEQ |L12.44|
|
||||||
00001e a007 ADR r0,|L11.60|
|
00001e a007 ADR r0,|L12.60|
|
||||||
000020 f7fffffe BL __2printf
|
000020 f7fffffe BL __2printf
|
||||||
000024 2000 MOVS r0,#0 ;524
|
000024 2000 MOVS r0,#0 ;524
|
||||||
000026 71a0 STRB r0,[r4,#6] ;524
|
000026 71a0 STRB r0,[r4,#6] ;524
|
||||||
000028 f7fffffe BL ap_tp_st_touch_simulate_finger_release_event
|
000028 f7fffffe BL ap_tp_st_touch_simulate_finger_release_event
|
||||||
|L11.44|
|
|L12.44|
|
||||||
00002c f7fffffe BL ap_tp_st_touch_scan_point_init
|
00002c f7fffffe BL ap_tp_st_touch_scan_point_init
|
||||||
000030 bd10 POP {r4,pc}
|
000030 bd10 POP {r4,pc}
|
||||||
;;;531
|
;;;531
|
||||||
ENDP
|
ENDP
|
||||||
|
|
||||||
000032 0000 DCW 0x0000
|
000032 0000 DCW 0x0000
|
||||||
|L11.52|
|
|L12.52|
|
||||||
DCD ||.bss||
|
DCD ||.bss||
|
||||||
|L11.56|
|
|L12.56|
|
||||||
DCD 0x00001999
|
DCD 0x00001999
|
||||||
|L11.60|
|
|L12.60|
|
||||||
00003c 72656c65 DCB "release finger %2d\n",0
|
00003c 72656c65 DCB "release finger %2d\n",0
|
||||||
000040 61736520
|
000040 61736520
|
||||||
000044 66696e67
|
000044 66696e67
|
||||||
|
@ -949,14 +976,14 @@
|
||||||
000000 b51c PUSH {r2-r4,lr}
|
000000 b51c PUSH {r2-r4,lr}
|
||||||
;;;357 {
|
;;;357 {
|
||||||
;;;358 uint8_t i,temp=0,ap_tp_release_buf[8] = {0x33,0x01,0x00,0x00,0x00,0x00,0x00,0x00};
|
;;;358 uint8_t i,temp=0,ap_tp_release_buf[8] = {0x33,0x01,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||||
000002 a10a ADR r1,|L12.44|
|
000002 a10a ADR r1,|L13.44|
|
||||||
000004 c903 LDM r1,{r0,r1}
|
000004 c903 LDM r1,{r0,r1}
|
||||||
;;;359
|
;;;359
|
||||||
;;;360 for(i=0;i<5;i++)
|
;;;360 for(i=0;i<5;i++)
|
||||||
000006 2400 MOVS r4,#0
|
000006 2400 MOVS r4,#0
|
||||||
000008 9101 STR r1,[sp,#4]
|
000008 9101 STR r1,[sp,#4]
|
||||||
00000a 9000 STR r0,[sp,#0]
|
00000a 9000 STR r0,[sp,#0]
|
||||||
|L12.12|
|
|L13.12|
|
||||||
00000c 0120 LSLS r0,r4,#4
|
00000c 0120 LSLS r0,r4,#4
|
||||||
;;;361 {
|
;;;361 {
|
||||||
;;;362 temp = i;
|
;;;362 temp = i;
|
||||||
|
@ -976,14 +1003,14 @@
|
||||||
000022 1c64 ADDS r4,r4,#1
|
000022 1c64 ADDS r4,r4,#1
|
||||||
000024 b2e4 UXTB r4,r4 ;360
|
000024 b2e4 UXTB r4,r4 ;360
|
||||||
000026 2c05 CMP r4,#5 ;360
|
000026 2c05 CMP r4,#5 ;360
|
||||||
000028 d3f0 BCC |L12.12|
|
000028 d3f0 BCC |L13.12|
|
||||||
;;;368 }
|
;;;368 }
|
||||||
;;;369 }
|
;;;369 }
|
||||||
00002a bd1c POP {r2-r4,pc}
|
00002a bd1c POP {r2-r4,pc}
|
||||||
;;;370
|
;;;370
|
||||||
ENDP
|
ENDP
|
||||||
|
|
||||||
|L12.44|
|
|L13.44|
|
||||||
00002c 330100 DCB "3",1,0
|
00002c 330100 DCB "3",1,0
|
||||||
00002f 00 DCB 0
|
00002f 00 DCB 0
|
||||||
000030 00 DCB 0
|
000030 00 DCB 0
|
||||||
|
@ -1001,8 +1028,8 @@
|
||||||
;;;381 TAU_LOGD("st_touch_software_reset \n");
|
;;;381 TAU_LOGD("st_touch_software_reset \n");
|
||||||
000002 22ff MOVS r2,#0xff
|
000002 22ff MOVS r2,#0xff
|
||||||
000004 327e ADDS r2,r2,#0x7e
|
000004 327e ADDS r2,r2,#0x7e
|
||||||
000006 a11c ADR r1,|L13.120|
|
000006 a11c ADR r1,|L14.120|
|
||||||
000008 a01d ADR r0,|L13.128|
|
000008 a01d ADR r0,|L14.128|
|
||||||
00000a f7fffffe BL LOG_printf
|
00000a f7fffffe BL LOG_printf
|
||||||
;;;382 ap_tp_st_touch_simulate_finger_release_event();
|
;;;382 ap_tp_st_touch_simulate_finger_release_event();
|
||||||
00000e f7fffffe BL ap_tp_st_touch_simulate_finger_release_event
|
00000e f7fffffe BL ap_tp_st_touch_simulate_finger_release_event
|
||||||
|
@ -1011,55 +1038,55 @@
|
||||||
;;;384
|
;;;384
|
||||||
;;;385 app_tp_m_write(st_touch_tp_tuning_clkreset, sizeof(st_touch_tp_tuning_clkreset)); // clk reset
|
;;;385 app_tp_m_write(st_touch_tp_tuning_clkreset, sizeof(st_touch_tp_tuning_clkreset)); // clk reset
|
||||||
000016 2103 MOVS r1,#3
|
000016 2103 MOVS r1,#3
|
||||||
000018 4823 LDR r0,|L13.168|
|
000018 4823 LDR r0,|L14.168|
|
||||||
00001a f7fffffe BL app_tp_m_write
|
00001a f7fffffe BL app_tp_m_write
|
||||||
|L13.30|
|
|L14.30|
|
||||||
;;;386 while(!hal_i2c_m_transfer_complate());
|
;;;386 while(!hal_i2c_m_transfer_complate());
|
||||||
00001e f7fffffe BL hal_i2c_m_transfer_complate
|
00001e f7fffffe BL hal_i2c_m_transfer_complate
|
||||||
000022 2800 CMP r0,#0
|
000022 2800 CMP r0,#0
|
||||||
000024 d0fb BEQ |L13.30|
|
000024 d0fb BEQ |L14.30|
|
||||||
;;;387 delayMs(5);
|
;;;387 delayMs(5);
|
||||||
000026 2005 MOVS r0,#5
|
000026 2005 MOVS r0,#5
|
||||||
000028 f7fffffe BL delayMs
|
000028 f7fffffe BL delayMs
|
||||||
;;;388
|
;;;388
|
||||||
;;;389 app_tp_m_write(st_touch_tp_tuning_reset, sizeof(st_touch_tp_tuning_reset)); // System Reset A4 00 00
|
;;;389 app_tp_m_write(st_touch_tp_tuning_reset, sizeof(st_touch_tp_tuning_reset)); // System Reset A4 00 00
|
||||||
00002c 481e LDR r0,|L13.168|
|
00002c 481e LDR r0,|L14.168|
|
||||||
00002e 2103 MOVS r1,#3
|
00002e 2103 MOVS r1,#3
|
||||||
000030 3815 SUBS r0,r0,#0x15
|
000030 3815 SUBS r0,r0,#0x15
|
||||||
000032 f7fffffe BL app_tp_m_write
|
000032 f7fffffe BL app_tp_m_write
|
||||||
|L13.54|
|
|L14.54|
|
||||||
;;;390 while(!hal_i2c_m_transfer_complate());
|
;;;390 while(!hal_i2c_m_transfer_complate());
|
||||||
000036 f7fffffe BL hal_i2c_m_transfer_complate
|
000036 f7fffffe BL hal_i2c_m_transfer_complate
|
||||||
00003a 2800 CMP r0,#0
|
00003a 2800 CMP r0,#0
|
||||||
00003c d0fb BEQ |L13.54|
|
00003c d0fb BEQ |L14.54|
|
||||||
;;;391 delayMs(5);
|
;;;391 delayMs(5);
|
||||||
00003e 2005 MOVS r0,#5
|
00003e 2005 MOVS r0,#5
|
||||||
000040 f7fffffe BL delayMs
|
000040 f7fffffe BL delayMs
|
||||||
;;;392
|
;;;392
|
||||||
;;;393 app_tp_m_write(st_touch_tp_tuning_clearfifo, sizeof(st_touch_tp_tuning_clearfifo));//0xA4,0x00,0x01
|
;;;393 app_tp_m_write(st_touch_tp_tuning_clearfifo, sizeof(st_touch_tp_tuning_clearfifo));//0xA4,0x00,0x01
|
||||||
000044 4818 LDR r0,|L13.168|
|
000044 4818 LDR r0,|L14.168|
|
||||||
000046 2103 MOVS r1,#3
|
000046 2103 MOVS r1,#3
|
||||||
000048 1ec0 SUBS r0,r0,#3
|
000048 1ec0 SUBS r0,r0,#3
|
||||||
00004a f7fffffe BL app_tp_m_write
|
00004a f7fffffe BL app_tp_m_write
|
||||||
|L13.78|
|
|L14.78|
|
||||||
;;;394 while(!hal_i2c_m_transfer_complate());
|
;;;394 while(!hal_i2c_m_transfer_complate());
|
||||||
00004e f7fffffe BL hal_i2c_m_transfer_complate
|
00004e f7fffffe BL hal_i2c_m_transfer_complate
|
||||||
000052 2800 CMP r0,#0
|
000052 2800 CMP r0,#0
|
||||||
000054 d0fb BEQ |L13.78|
|
000054 d0fb BEQ |L14.78|
|
||||||
;;;395 delayMs(5);
|
;;;395 delayMs(5);
|
||||||
000056 2005 MOVS r0,#5
|
000056 2005 MOVS r0,#5
|
||||||
000058 f7fffffe BL delayMs
|
000058 f7fffffe BL delayMs
|
||||||
;;;396
|
;;;396
|
||||||
;;;397 app_tp_m_write(st_touch_init_sensor_on, sizeof(st_touch_init_sensor_on));//0xA0,0x00,0x01
|
;;;397 app_tp_m_write(st_touch_init_sensor_on, sizeof(st_touch_init_sensor_on));//0xA0,0x00,0x01
|
||||||
00005c 4812 LDR r0,|L13.168|
|
00005c 4812 LDR r0,|L14.168|
|
||||||
00005e 2103 MOVS r1,#3
|
00005e 2103 MOVS r1,#3
|
||||||
000060 3818 SUBS r0,r0,#0x18
|
000060 3818 SUBS r0,r0,#0x18
|
||||||
000062 f7fffffe BL app_tp_m_write
|
000062 f7fffffe BL app_tp_m_write
|
||||||
|L13.102|
|
|L14.102|
|
||||||
;;;398 while(!hal_i2c_m_transfer_complate());
|
;;;398 while(!hal_i2c_m_transfer_complate());
|
||||||
000066 f7fffffe BL hal_i2c_m_transfer_complate
|
000066 f7fffffe BL hal_i2c_m_transfer_complate
|
||||||
00006a 2800 CMP r0,#0
|
00006a 2800 CMP r0,#0
|
||||||
00006c d0fb BEQ |L13.102|
|
00006c d0fb BEQ |L14.102|
|
||||||
;;;399 delayMs(5);
|
;;;399 delayMs(5);
|
||||||
00006e 2005 MOVS r0,#5
|
00006e 2005 MOVS r0,#5
|
||||||
000070 f7fffffe BL delayMs
|
000070 f7fffffe BL delayMs
|
||||||
|
@ -1071,10 +1098,10 @@
|
||||||
ENDP
|
ENDP
|
||||||
|
|
||||||
000076 0000 DCW 0x0000
|
000076 0000 DCW 0x0000
|
||||||
|L13.120|
|
|L14.120|
|
||||||
000078 7461755f DCB "tau_log",0
|
000078 7461755f DCB "tau_log",0
|
||||||
00007c 6c6f6700
|
00007c 6c6f6700
|
||||||
|L13.128|
|
|L14.128|
|
||||||
000080 5b25735d DCB "[%s] (%04d) st_touch_software_reset \n",0
|
000080 5b25735d DCB "[%s] (%04d) st_touch_software_reset \n",0
|
||||||
000084 20282530
|
000084 20282530
|
||||||
000088 34642920
|
000088 34642920
|
||||||
|
@ -1087,7 +1114,7 @@
|
||||||
0000a4 0a00
|
0000a4 0a00
|
||||||
0000a6 00 DCB 0
|
0000a6 00 DCB 0
|
||||||
0000a7 00 DCB 0
|
0000a7 00 DCB 0
|
||||||
|L13.168|
|
|L14.168|
|
||||||
DCD ||.data||+0x1d
|
DCD ||.data||+0x1d
|
||||||
|
|
||||||
AREA ||i.app_tp_calibration_exec||, CODE, READONLY, ALIGN=2
|
AREA ||i.app_tp_calibration_exec||, CODE, READONLY, ALIGN=2
|
||||||
|
@ -1100,11 +1127,11 @@
|
||||||
;;;303 uint8_t i = 0;
|
;;;303 uint8_t i = 0;
|
||||||
;;;304
|
;;;304
|
||||||
;;;305 if(s_calibration_flag)
|
;;;305 if(s_calibration_flag)
|
||||||
000002 4d13 LDR r5,|L14.80|
|
000002 4d13 LDR r5,|L15.80|
|
||||||
000004 2400 MOVS r4,#0 ;303
|
000004 2400 MOVS r4,#0 ;303
|
||||||
000006 7828 LDRB r0,[r5,#0] ; s_calibration_flag
|
000006 7828 LDRB r0,[r5,#0] ; s_calibration_flag
|
||||||
000008 2800 CMP r0,#0
|
000008 2800 CMP r0,#0
|
||||||
00000a d018 BEQ |L14.62|
|
00000a d018 BEQ |L15.62|
|
||||||
;;;306 {
|
;;;306 {
|
||||||
;;;307 s_calibration_flag = false;
|
;;;307 s_calibration_flag = false;
|
||||||
00000c 2000 MOVS r0,#0
|
00000c 2000 MOVS r0,#0
|
||||||
|
@ -1126,46 +1153,46 @@
|
||||||
000012 27ff MOVS r7,#0xff
|
000012 27ff MOVS r7,#0xff
|
||||||
000014 0176 LSLS r6,r6,#5 ;311
|
000014 0176 LSLS r6,r6,#5 ;311
|
||||||
000016 3741 ADDS r7,r7,#0x41
|
000016 3741 ADDS r7,r7,#0x41
|
||||||
|L14.24|
|
|L15.24|
|
||||||
000018 f7fffffe BL ap_tp_st_touch_calibration
|
000018 f7fffffe BL ap_tp_st_touch_calibration
|
||||||
00001c 4630 MOV r0,r6 ;311
|
00001c 4630 MOV r0,r6 ;311
|
||||||
00001e f7fffffe BL delayMs
|
00001e f7fffffe BL delayMs
|
||||||
000022 f7fffffe BL ap_tp_st_touch_get_calibration_success_mark
|
000022 f7fffffe BL ap_tp_st_touch_get_calibration_success_mark
|
||||||
000026 7868 LDRB r0,[r5,#1] ;313 ; s_calibration_correct_flag
|
000026 7868 LDRB r0,[r5,#1] ;313 ; s_calibration_correct_flag
|
||||||
000028 285a CMP r0,#0x5a ;313
|
000028 285a CMP r0,#0x5a ;313
|
||||||
00002a d009 BEQ |L14.64|
|
00002a d009 BEQ |L15.64|
|
||||||
00002c 463a MOV r2,r7
|
00002c 463a MOV r2,r7
|
||||||
00002e a109 ADR r1,|L14.84|
|
00002e a109 ADR r1,|L15.84|
|
||||||
000030 a00a ADR r0,|L14.92|
|
000030 a00a ADR r0,|L15.92|
|
||||||
000032 f7fffffe BL LOG_printf
|
000032 f7fffffe BL LOG_printf
|
||||||
000036 1c64 ADDS r4,r4,#1
|
000036 1c64 ADDS r4,r4,#1
|
||||||
000038 b2e4 UXTB r4,r4 ;308
|
000038 b2e4 UXTB r4,r4 ;308
|
||||||
00003a 2c02 CMP r4,#2 ;308
|
00003a 2c02 CMP r4,#2 ;308
|
||||||
00003c d3ec BCC |L14.24|
|
00003c d3ec BCC |L15.24|
|
||||||
|L14.62|
|
|L15.62|
|
||||||
;;;321 }
|
;;;321 }
|
||||||
;;;322 }
|
;;;322 }
|
||||||
;;;323
|
;;;323
|
||||||
;;;324 }
|
;;;324 }
|
||||||
;;;325 }
|
;;;325 }
|
||||||
00003e bdf8 POP {r3-r7,pc}
|
00003e bdf8 POP {r3-r7,pc}
|
||||||
|L14.64|
|
|L15.64|
|
||||||
000040 22ff MOVS r2,#0xff ;315
|
000040 22ff MOVS r2,#0xff ;315
|
||||||
000042 323c ADDS r2,r2,#0x3c ;315
|
000042 323c ADDS r2,r2,#0x3c ;315
|
||||||
000044 a103 ADR r1,|L14.84|
|
000044 a103 ADR r1,|L15.84|
|
||||||
000046 a00e ADR r0,|L14.128|
|
000046 a00e ADR r0,|L15.128|
|
||||||
000048 f7fffffe BL LOG_printf
|
000048 f7fffffe BL LOG_printf
|
||||||
00004c bdf8 POP {r3-r7,pc}
|
00004c bdf8 POP {r3-r7,pc}
|
||||||
;;;326
|
;;;326
|
||||||
ENDP
|
ENDP
|
||||||
|
|
||||||
00004e 0000 DCW 0x0000
|
00004e 0000 DCW 0x0000
|
||||||
|L14.80|
|
|L15.80|
|
||||||
DCD ||.data||
|
DCD ||.data||
|
||||||
|L14.84|
|
|L15.84|
|
||||||
000054 7461755f DCB "tau_log",0
|
000054 7461755f DCB "tau_log",0
|
||||||
000058 6c6f6700
|
000058 6c6f6700
|
||||||
|L14.92|
|
|L15.92|
|
||||||
00005c 5b25735d DCB "[%s] (%04d) calibration failure \n",0
|
00005c 5b25735d DCB "[%s] (%04d) calibration failure \n",0
|
||||||
000060 20282530
|
000060 20282530
|
||||||
000064 34642920
|
000064 34642920
|
||||||
|
@ -1177,7 +1204,7 @@
|
||||||
00007c 0a00
|
00007c 0a00
|
||||||
00007e 00 DCB 0
|
00007e 00 DCB 0
|
||||||
00007f 00 DCB 0
|
00007f 00 DCB 0
|
||||||
|L14.128|
|
|L15.128|
|
||||||
000080 5b25735d DCB "[%s] (%04d) calibration successful \n",0
|
000080 5b25735d DCB "[%s] (%04d) calibration successful \n",0
|
||||||
000084 20282530
|
000084 20282530
|
||||||
000088 34642920
|
000088 34642920
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,19 @@
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ISP568_S21U_NT37701AH_TM678_20230918
|
||||||
|
|
||||||
|
1、修正基板低分切换分辨率1080后,重新开机第三个logo抖动
|
||||||
|
2、
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ISP568_S21U_NT37701AH_TM678_20230906
|
||||||
|
|
||||||
|
1、解决韩版N版充电会花屏问题;
|
||||||
|
2、解决S21U美版和B版本会出现唤不醒情况。
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ISP568_S21U_NT37701AH_TM678_20230808
|
ISP568_S21U_NT37701AH_TM678_20230808
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,109 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* File: app_tp_for_custom.h
|
||||||
|
* Description tp 协议处理文件,包括特定配置的宏
|
||||||
|
* Version V0.1
|
||||||
|
* Date 2021-10-14
|
||||||
|
* Author zhanghz
|
||||||
|
*******************************************************************************/
|
||||||
|
#ifndef __APP_TP_FOR_CUSTOM_s21u_H__
|
||||||
|
#define __APP_TP_FOR_CUSTOM_s21u_H__
|
||||||
|
|
||||||
|
#include "string.h"
|
||||||
|
#include "tau_device_datatype.h"
|
||||||
|
#include "tau_common.h"
|
||||||
|
#include "app_tp_transfer.h"
|
||||||
|
#include "hal_gpio.h"
|
||||||
|
#include "ap_demo.h"
|
||||||
|
|
||||||
|
#define BUFFER_SIZE_MAX 250 //定义 bufrer 最大的字节数
|
||||||
|
#define SCREEN_INT_LOW_DEFAULT 0
|
||||||
|
|
||||||
|
/** 跟手机之间使用 I2C 通信 **/
|
||||||
|
#define PHONE_SLAVE_TRANSFER_I2C 1 //1:表示手机跟芯片之间,touch 数据采用 I2C 通信;
|
||||||
|
#define CHIP_I2C_ADDRESS 0x48 //芯片本身 I2C 从机地址
|
||||||
|
#define CHIP_I2C_ADDR_BITS I2C_ADDR_BITS_7 //屏幕 I2C 地址位数 7/10,默认为7
|
||||||
|
|
||||||
|
/** 跟手机之间使用 SPI 通信 **/
|
||||||
|
#define PHONE_SLAVE_TRANSFER_SPI 0 //1:表示手机跟芯片之间,touch 数据采用 SPI 通信;
|
||||||
|
#define PHONE_SPI_CPHA 0 //0:表示时钟在数据之后才切换,即第1个时钟沿有效
|
||||||
|
#define PHONE_SPI_CPOL 0 //0:表示闲时时钟状态为低电平
|
||||||
|
|
||||||
|
/** 跟屏幕之间使用 I2C 通信 **/
|
||||||
|
#define SCREEN_MASTER_TRANSFER_I2C 1 //1:表示屏幕跟芯片之间,touch 数据采用 I2C 通信;
|
||||||
|
#define SCREEN_I2C_ADDRESS 0x49 //屏幕 I2C 从机地址
|
||||||
|
#define SCREEN_I2C_ADDR_BITS I2C_ADDR_BITS_7 //屏幕 I2C 地址位数 7/10,默认为7
|
||||||
|
#define I2C_MASTER_SPEED 400000 //设置 I2C 主机通信速率
|
||||||
|
|
||||||
|
/** 跟屏幕之间使用 SPI 通信 **/
|
||||||
|
#define SCREEN_MASTER_TRANSFER_SPI 0 //1:表示屏幕跟芯片之间,touch 数据采用 SPI 通信;
|
||||||
|
#define SCREEN_SPI_CPHA 0 //0:表示时钟在数据之后才切换,即第1个时钟沿有效
|
||||||
|
#define SCREEN_SPI_CPOL 0 //0:表示闲时时钟状态为低电平
|
||||||
|
#define SPI_MASTER_SPEED 10000000 //设置 SPI 主机通信速率
|
||||||
|
|
||||||
|
|
||||||
|
/** 坐标转换参数 **/
|
||||||
|
#define INPUT_WIDTH_VALUE 1080 //原装屏 X 坐标码值的最大值
|
||||||
|
#define INPUT_HEIGHT_VALUE 2400 //原装屏 Y 坐标码值的最大值
|
||||||
|
#define OUTPUT_WIDTH_VALUE 1080 //维修屏 X 坐标码值的最大值
|
||||||
|
#define OUTPUT_HEIGHT_VALUE 2400 //维修屏 Y 坐标码值的最大值
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
extern io_pad_e g_screen_input_rst_pad;
|
||||||
|
extern io_pad_e g_screen_input_int_pad;
|
||||||
|
extern io_pad_e g_phone_input_rst_pad;
|
||||||
|
extern io_pad_e g_phone_output_int_pad;
|
||||||
|
|
||||||
|
extern const uint8_t screen_reg_int_data_size;
|
||||||
|
extern const uint8_t screen_reg_start_data_size;
|
||||||
|
extern st_screen_data screen_reg_int_data[];
|
||||||
|
extern st_screen_const_data screen_reg_start_data[];
|
||||||
|
extern st_reg_const_data phone_reg_const_data[];
|
||||||
|
|
||||||
|
extern const uint8_t screen_reg_tp_sendcmd_data_size;
|
||||||
|
|
||||||
|
extern st_screen_const_data screen_reg_tp_sendcmd_data[];
|
||||||
|
extern st_screen_const_data screen_reg_tp_software_reset_data[];
|
||||||
|
extern const uint8_t screen_reg_tp_software_reset_data_size;
|
||||||
|
extern uint8_t g_screen_tp_reg_43_software_reset_flag;
|
||||||
|
extern bool g_screen_tp_init_start;
|
||||||
|
extern bool g_screen_tp_init_restart;
|
||||||
|
|
||||||
|
extern bool g_tp_sleep_in;
|
||||||
|
extern uint8_t g_tp_sleep_delay_count;
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* @name : app_tp_screen_analysis_const
|
||||||
|
* @brief : screen start 阶段数据解析函数,由客户定制
|
||||||
|
* @param[in] :
|
||||||
|
* @return :
|
||||||
|
* @retval :
|
||||||
|
**************************************************************************/
|
||||||
|
uint8_t app_tp_screen_analysis_const(uint8_t transfer_now, uint8_t *rxbuffer, size_t data_size);
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* @name : app_tp_screen_analysis_int
|
||||||
|
* @brief : screen 来IO中断后的 数据解析函数,由客户定制
|
||||||
|
* @param[in] :
|
||||||
|
* @return :
|
||||||
|
* @retval :
|
||||||
|
**************************************************************************/
|
||||||
|
uint8_t app_tp_screen_analysis_int(uint8_t transfer_now, uint8_t *rxbuffer, size_t data_size);
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* @name : app_tp_phone_analysis_data
|
||||||
|
* @brief : phone 数据解析函数,由客户定制
|
||||||
|
* @param[in] :
|
||||||
|
* @return :
|
||||||
|
* @retval :
|
||||||
|
**************************************************************************/
|
||||||
|
void app_tp_phone_analysis_data(uint8_t *rxbuffer, size_t rxbuffer_size, const uint8_t **txbuffer, size_t *txbuffer_size);
|
||||||
|
|
||||||
|
void app_tp_screen_analysis_wake_up_exec(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -1,150 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* File: app_tp_for_custom.h
|
|
||||||
* Description tp 协议处理文件,包括特定配置的宏
|
|
||||||
* Version V0.1
|
|
||||||
* Date 2021-10-14
|
|
||||||
* Author zhanghz
|
|
||||||
*******************************************************************************/
|
|
||||||
#ifndef __APP_TP_FOR_CUSTOM_S8_H__
|
|
||||||
#define __APP_TP_FOR_CUSTOM_S8_H__
|
|
||||||
#include "test_cfg_global.h"
|
|
||||||
|
|
||||||
#include "string.h"
|
|
||||||
#include "tau_device_datatype.h"
|
|
||||||
#include "tau_common.h"
|
|
||||||
#include "app_tp_transfer.h"
|
|
||||||
#include "hal_gpio.h"
|
|
||||||
|
|
||||||
#define AP_TP_TRANSFER 1
|
|
||||||
|
|
||||||
#if AMOLED_NT37280
|
|
||||||
#define PHONE_SLAVE_TRANSFER_I2C 1 //1:表示手机跟芯片之间,touch 数据采用 I2C 通信;
|
|
||||||
#define PHONE_SLAVE_TRANSFER_SPI 0 //1:表示手机跟芯片之间,touch 数据采用 SPI 通信;
|
|
||||||
#define SCREEN_MASTER_TRANSFER_I2C 0 //1:表示屏幕跟芯片之间,touch 数据采用 I2C 通信;
|
|
||||||
#define SCREEN_MASTER_TRANSFER_SPI 1 //1:表示屏幕跟芯片之间,touch 数据采用 SPI 通信;
|
|
||||||
#elif LCD_HX83112A
|
|
||||||
#define PHONE_SLAVE_TRANSFER_I2C 1 //1:表示手机跟芯片之间,touch 数据采用 I2C 通信;
|
|
||||||
#define PHONE_SLAVE_TRANSFER_SPI 0 //1:表示手机跟芯片之间,touch 数据采用 SPI 通信;
|
|
||||||
#define SCREEN_MASTER_TRANSFER_I2C 0 //1:表示屏幕跟芯片之间,touch 数据采用 I2C 通信;
|
|
||||||
#define SCREEN_MASTER_TRANSFER_SPI 0 //1:表示屏幕跟芯片之间,touch 数据采用 SPI 通信;
|
|
||||||
#else // #if LCD_TD4310
|
|
||||||
#define PHONE_SLAVE_TRANSFER_I2C 1 //1:表示手机跟芯片之间,touch 数据采用 I2C 通信;
|
|
||||||
#define PHONE_SLAVE_TRANSFER_SPI 0 //1:表示手机跟芯片之间,touch 数据采用 SPI 通信;
|
|
||||||
#define SCREEN_MASTER_TRANSFER_I2C 1 //1:表示屏幕跟芯片之间,touch 数据采用 I2C 通信;
|
|
||||||
#define SCREEN_MASTER_TRANSFER_SPI 0 //1:表示屏幕跟芯片之间,touch 数据采用 SPI 通信;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_FOR_SUMSUNG_S21U
|
|
||||||
#define CHIP_I2C_ADDRESS 0x48 //芯片本身 I2C 从机地址.机板I2C地址
|
|
||||||
#define SCREEN_I2C_ADDRESS 0x49 //屏幕 I2C 从机地址
|
|
||||||
|
|
||||||
#elif defined(USE_FOR_SUMSUNG_S9PLUS)
|
|
||||||
#define CHIP_I2C_ADDRESS 0x48 //芯片本身 I2C 从机地址
|
|
||||||
#define SCREEN_I2C_ADDRESS 0x20 //屏幕 I2C 从机地址
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define CHIP_I2C_ADDRESS 0x48 //芯片本身 I2C 从机地址
|
|
||||||
#define SCREEN_I2C_ADDRESS 0x49 //屏幕 I2C 从机地址
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CHIP_I2C_ADDR_BITS I2C_ADDR_BITS_7 //屏幕 I2C 地址位数 7/10,默认为7
|
|
||||||
#define SCREEN_I2C_ADDR_BITS I2C_ADDR_BITS_7 //屏幕 I2C 地址位数 7/10,默认为7
|
|
||||||
#define I2C_MASTER_SPEED 800000 //设置 I2C 主机通信速率
|
|
||||||
|
|
||||||
#define SPI_MASTER_SPEED 10000000 //设置 SPI 主机通信速率
|
|
||||||
|
|
||||||
#define BUFFER_SIZE_MAX 200 //定义 bufrer 最大的字节数
|
|
||||||
|
|
||||||
#define INPUT_WIDTH_VALUE 1440 //原装屏 X 坐标码值的最大值
|
|
||||||
#define INPUT_HEIGHT_VALUE 3200 //原装屏 Y 坐标码值的最大值
|
|
||||||
|
|
||||||
#define OUTPUT_WIDTH_VALUE 1080 //维修屏 X 坐标码值的最大值
|
|
||||||
#define OUTPUT_HEIGHT_VALUE 2400 //维修屏 Y 坐标码值的最大值
|
|
||||||
|
|
||||||
|
|
||||||
#define SCREEN_TRANSFER_WRITE false //接收到screen io中断,发送数据之后不用读回
|
|
||||||
#define SCREEN_TRANSFER_READ true //接收到screen io中断,发送数据之后要读回数据
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
I2C_ADDR_BITS_7 = 7,
|
|
||||||
I2C_ADDR_BITS_10 = 10
|
|
||||||
} en_I2C_ADDR_BITS_mdoe;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
uint8_t *buffer; //接收到screen io中断后,通信的发送buffer指针
|
|
||||||
size_t txbuffer_size; //发送 buffer 数据长度;需要读回时,目前只支持4个字节
|
|
||||||
size_t rxbuffer_size; //发送完数据之后,要读回的数据长度
|
|
||||||
bool read_flag; //true 接收到screen io中断,发送数据之后要读回数据
|
|
||||||
} st_screen_data;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
const uint8_t *buffer; //通信的发送buffer指针
|
|
||||||
size_t txbuffer_size; //发送 buffer 数据长度;需要读回时,目前只支持4个字节
|
|
||||||
size_t rxbuffer_size; //发送完数据之后,要读回的数据长度
|
|
||||||
bool read_flag; //true 接收到screen io中断,发送数据之后要读回数据
|
|
||||||
} st_screen_const_data;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
uint8_t reg_size; //接收buffer的个数
|
|
||||||
size_t write_back_size; //要发送的数据长度
|
|
||||||
const uint8_t *reg_data; //接收buffer
|
|
||||||
const uint8_t *write_back; //发送bufer
|
|
||||||
} st_reg_const_data;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
uint8_t reg_size; //接收buffer的个数
|
|
||||||
size_t write_back_size; //要发送的数据长度
|
|
||||||
uint8_t *reg_data; //接收buffer
|
|
||||||
uint8_t *write_back; //发送bufer
|
|
||||||
} st_reg_data;
|
|
||||||
|
|
||||||
extern io_pad_e g_screen_input_rst_pad;
|
|
||||||
extern io_pad_e g_screen_input_int_pad;
|
|
||||||
extern io_pad_e g_phone_input_rst_pad;
|
|
||||||
extern io_pad_e g_phone_output_int_pad;
|
|
||||||
|
|
||||||
extern uint8_t phone_start_flag;
|
|
||||||
extern uint8_t phone_touch_flag;
|
|
||||||
extern const uint8_t screen_reg_int_data_size;
|
|
||||||
extern const uint8_t screen_reg_start_data_size;
|
|
||||||
extern st_screen_data screen_reg_int_data[];
|
|
||||||
extern st_screen_const_data screen_reg_start_data[];
|
|
||||||
//extern st_reg_const_data phone_reg_const_data[];
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
* @name : app_tp_screen_analysis_const
|
|
||||||
* @brief : screen start 阶段数据解析函数,由客户定制
|
|
||||||
* @param[in] :
|
|
||||||
* @return :
|
|
||||||
* @retval :
|
|
||||||
**************************************************************************/
|
|
||||||
uint8_t app_tp_screen_analysis_const(uint8_t transfer_now, uint8_t *rxbuffer, size_t data_size);
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
* @name : app_tp_screen_analysis_int
|
|
||||||
* @brief : screen 来IO中断后的 数据解析函数,由客户定制
|
|
||||||
* @param[in] :
|
|
||||||
* @return :
|
|
||||||
* @retval :
|
|
||||||
**************************************************************************/
|
|
||||||
uint8_t app_tp_screen_analysis_int(uint8_t transfer_now, uint8_t *rxbuffer, size_t data_size);
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
* @name : app_tp_phone_analysis_data
|
|
||||||
* @brief : phone 数据解析函数,由客户定制
|
|
||||||
* @param[in] :
|
|
||||||
* @return :
|
|
||||||
* @retval :
|
|
||||||
**************************************************************************/
|
|
||||||
void app_tp_phone_analysis_data(uint8_t *rxbuffer, size_t rxbuffer_size, const uint8_t **txbuffer, size_t *txbuffer_size);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* File: app_tp_transfer_data.h
|
||||||
|
* Description 配置从机需要答复的接收值,及其对应的答复值
|
||||||
|
* Version V0.1
|
||||||
|
* Date 2021-10-14
|
||||||
|
* Author zhanghz
|
||||||
|
*******************************************************************************/
|
||||||
|
#ifndef __APP_TP_PHONE_TRANSFER_DATA_s21u_H__
|
||||||
|
#define __APP_TP_PHONE_TRANSFER_DATA_s21u_H__
|
||||||
|
|
||||||
|
#include "tau_common.h"
|
||||||
|
|
||||||
|
/***************send to phone***************/
|
||||||
|
const uint8_t phone_60_start_back[] = {0x09, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
|
|
||||||
|
const uint8_t phone_22_data[] = {0x22};
|
||||||
|
const uint8_t phone_22_back[] = {0x53, 0x45, 0x37, 0x61, 0x00};
|
||||||
|
|
||||||
|
const uint8_t phone_21_data[] = {0x21};
|
||||||
|
const uint8_t phone_21_back[] = {0x80};
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************/
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* File: hal_tp_screen_transfer_data.h
|
||||||
|
* Description 配置主机 start/sleep/awake 模式下需要发送的值
|
||||||
|
* Version V0.1
|
||||||
|
* Date 2021-10-14
|
||||||
|
* Author zhanghz
|
||||||
|
*******************************************************************************/
|
||||||
|
#ifndef __HAL_TP_SCREEN_TRANSFER_DATA_s21u_H__
|
||||||
|
#define __HAL_TP_SCREEN_TRANSFER_DATA_s21u_H__
|
||||||
|
|
||||||
|
#include "tau_common.h"
|
||||||
|
|
||||||
|
/***************send to screen***************/
|
||||||
|
|
||||||
|
const uint8_t screen_86_data[] = {0x86};
|
||||||
|
const uint8_t screen_a0_00_01_data[] = {0xa0, 0x00, 0x01};
|
||||||
|
const uint8_t screen_a2_03_00_data[] = {0xa2, 0x03, 0x00, 0x00, 0x00, 0x03};
|
||||||
|
const uint8_t screen_a2_02_00_data[] = {0xa2, 0x02, 0x00};
|
||||||
|
const uint8_t screen_c0_07_01_data[] = {0xc0, 0x07, 0x01};
|
||||||
|
|
||||||
|
//const uint8_t screen_87_data[] = {0x87};
|
||||||
|
//const uint8_t screen_a0_00_01_data[] = {0xa0, 0x00, 0x01};
|
||||||
|
//const uint8_t screen_a0_00_ff_data[] = {0xa0, 0x00, 0x01};
|
||||||
|
//const uint8_t screen_a4_06_c1_data[] = {0xa4, 0x01, 0x01};
|
||||||
|
//const uint8_t screen_a3_a4_fc_data[] = {0xa3, 0xA4, 0xFC};
|
||||||
|
//const uint8_t screen_a3_data[] = {0xa3};
|
||||||
|
//const uint8_t screen_a4_data[] = {0xA4};
|
||||||
|
//const uint8_t screen_fc_data[] = {0xFC};
|
||||||
|
//const uint8_t screen_60_data[] = {0x60, 0x00, 0x00};
|
||||||
|
//const uint8_t screen_a4_06_01_data[] = {0xa4, 0x06, 0x01};
|
||||||
|
//const uint8_t screen_a4_00_01_data[] = {0xa4, 0x00, 0x01};
|
||||||
|
//const uint8_t screen_a4_0c_5a_data[] = {0xa4, 0x0c, 0x5a};
|
||||||
|
//const uint8_t screen_a4_05_04_data[] = {0xa4, 0x05, 0x04};
|
||||||
|
//const uint8_t screen_a4_00_03_data[] = {0xa4, 0x00, 0x03};
|
||||||
|
const uint8_t screen_fa_software_reset_data[] = {0xFA, 0x20, 0x00, 0x00, 0x24, 0x80};
|
||||||
|
//读取固件等版本信息
|
||||||
|
const uint8_t screen_a7_00_00_data[] = {0xA7, 0x00, 0x00, 0x00};
|
||||||
|
//解锁
|
||||||
|
const uint8_t screen_fa_20_24_data[] = {0xFA, 0x20, 0x00, 0x00, 0x24, 0x01};
|
||||||
|
const uint8_t screen_fa_20_32_data[] = {0xFA, 0x20, 0x00, 0x00, 0x32, 0x10};
|
||||||
|
const uint8_t screen_fa_20_34_data[] = {0xFA, 0x20, 0x00, 0x00, 0x34, 0x02};
|
||||||
|
const uint8_t screen_fa_20_3f_data[] = {0xFA, 0x20, 0x00, 0x00, 0x3F, 0x07};
|
||||||
|
const uint8_t screen_fa_20_3d_data[] = {0xFA, 0x20, 0x00, 0x00, 0x3D, 0x30};
|
||||||
|
const uint8_t screen_fa_20_2d_data[] = {0xFA, 0x20, 0x00, 0x00, 0x2D, 0x02};
|
||||||
|
const uint8_t screen_fa_20_1b_data[] = {0xFA, 0x20, 0x00, 0x00, 0x1B, 0x66};
|
||||||
|
const uint8_t screen_fa_20_68_data[] = {0xFA, 0x20, 0x00, 0x00, 0x68, 0x13};
|
||||||
|
const uint8_t screen_fa_20_25_data[] = {0xFA, 0x20, 0x00, 0x00, 0x25, 0x20};
|
||||||
|
const uint8_t screen_fa_20_6b_data[] = {0xFA, 0x20, 0x00, 0x00, 0x6B, 0x00};
|
||||||
|
const uint8_t screen_fa_20_de_data[] = {0xFA, 0x20, 0x00, 0x00, 0xDE, 0x03};
|
||||||
|
const uint8_t screen_fa_20_28_data[] = {0xFA, 0x20, 0x00, 0x01, 0x28, 0xFF, 0xFF, 0xFF, 0x83};
|
||||||
|
const uint8_t screen_fa_20_6a_data[] = {0xFA, 0x20, 0x00, 0x00, 0x6A, 0xA0};
|
||||||
|
//读取寄存器值
|
||||||
|
const uint8_t screen_fb_20_6a_data[] = {0xFB, 0x20, 0x00, 0x00, 0x6A};
|
||||||
|
const uint8_t screen_fa_20_72_data1[] = {0xFA, 0x20, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x3F, 0x00};
|
||||||
|
const uint8_t screen_fa_20_72_data2[] = {0xFA, 0x20, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x40, 0x3E, 0x27, 0x00};
|
||||||
|
const uint8_t screen_fa_20_72_data3[] = {0xFA, 0x20, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x7C, 0x2D, 0x03, 0x00};
|
||||||
|
const uint8_t screen_fa_20_6B_data[] = {0xFA, 0x20, 0x00, 0x00, 0x6B, 0x00, 0x40, 0x42, 0x0F, 0x00, 0x00, 0xC0};
|
||||||
|
const uint8_t screen_fb_20_71_data[] = {0xFB, 0x20, 0x00, 0x00, 0x71};
|
||||||
|
|
||||||
|
/*******************************************/
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* File: hal_tp_screen_transfer_data.h
|
|
||||||
* Description 配置主机 start/sleep/awake 模式下需要发送的值
|
|
||||||
* Version V0.1
|
|
||||||
* Date 2021-10-14
|
|
||||||
* Author zhanghz
|
|
||||||
*******************************************************************************/
|
|
||||||
#ifndef __HAL_TP_SCREEN_TRANSFER_DATA_S8_H__
|
|
||||||
#define __HAL_TP_SCREEN_TRANSFER_DATA_S8_H__
|
|
||||||
|
|
||||||
#include "tau_common.h"
|
|
||||||
|
|
||||||
/***************send to screen***************/
|
|
||||||
const uint8_t screen_87_data[] = {0x87};
|
|
||||||
const uint8_t screen_a0_00_ff_data[] = {0xa0, 0x00, 0xff};
|
|
||||||
const uint8_t screen_a4_06_c1_data[] = {0xa4, 0x06, 0xc1};
|
|
||||||
|
|
||||||
/*******************************************/
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -566,6 +566,16 @@ void ap_tp_st_touch_error_handler_FF(uint8_t* screendata)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ap_tp_st_touch_error_handler_03(uint8_t* screendata)
|
||||||
|
{
|
||||||
|
// 收到 TP 异常回复 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
|
||||||
|
if(screendata[0] == 0x03 && screendata[7] == 0x00)
|
||||||
|
{
|
||||||
|
// ap_tp_st_touch_software_reset();
|
||||||
|
ap_tp_st_touch_hardware_reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -165,6 +165,7 @@ void ap_tp_st_touch_error_handler_F3(uint8_t* screendata);
|
||||||
|
|
||||||
void ap_tp_st_touch_error_handler_FF(uint8_t* screendata);
|
void ap_tp_st_touch_error_handler_FF(uint8_t* screendata);
|
||||||
|
|
||||||
|
void ap_tp_st_touch_error_handler_03(uint8_t* screendata);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* File: app_tp_transfer.c
|
* File: app_tp_transfer.c
|
||||||
* Description touch I2C/SPI 初始化、以及数据通信
|
* Description touch I2C/SPI 初始化、以及数据通信
|
||||||
* Version V0.1
|
* Version V0.1
|
||||||
* Date 2021-10-14
|
* Date 2021-10-14
|
||||||
* Author zhanghz
|
* Author zhanghz
|
||||||
|
@ -15,54 +15,38 @@
|
||||||
#include "hal_spi_slave.h"
|
#include "hal_spi_slave.h"
|
||||||
#include "tau_log.h"
|
#include "tau_log.h"
|
||||||
#include "tau_delay.h"
|
#include "tau_delay.h"
|
||||||
|
#include "stdio.h"
|
||||||
#include "app_tp_st_touch.h"
|
#include "app_tp_st_touch.h"
|
||||||
|
|
||||||
#if 1//def AP_TP_TRANSFER
|
#ifdef BUFFER_SIZE_MAX
|
||||||
uint8_t read_point; //当前要读的报点数。一个报点8BYTE数据
|
|
||||||
uint8_t s_screen_number[2];
|
|
||||||
uint8_t s_screen_temp[2];
|
|
||||||
//uint8_t s_screen_read_bak[200];
|
|
||||||
static uint8_t s_screen_read_buffer[BUFFER_SIZE_MAX];
|
static uint8_t s_screen_read_buffer[BUFFER_SIZE_MAX];
|
||||||
static uint8_t s_phone_read_buffer[BUFFER_SIZE_MAX];
|
static uint8_t s_phone_read_buffer[BUFFER_SIZE_MAX];
|
||||||
|
|
||||||
static bool s_spim_write = false; //记录SPI主机是否配置发送,是的话需要清除RXFIFO
|
static const uint8_t *s_slave_txbuffer = NULL;
|
||||||
static bool s_screen_int_flag = false; //记录是否接收到屏幕的报点中断
|
static size_t s_slave_txbuffer_size = 0;
|
||||||
static bool s_phone_reset_flag = false; //记录是否接收到手机的开机复位信号
|
|
||||||
static bool s_screen_int_transfer_status = false; //记录是否已经开始通信
|
|
||||||
bool s_screen_init_complate = false; //屏幕TP开机初始化完成标志
|
|
||||||
static uint8_t s_screen_const_transfer_count = 0xff; //记录当前通信到哪一步,初始值必须大于 screen_reg_start_data_size
|
|
||||||
|
|
||||||
#ifdef USE_FOR_SUMSUNG_S20
|
static bool s_spim_write = false; //记录SPI主机是否配置发送,是的话需要清除RXFIFO
|
||||||
uint16_t u16TouchID;
|
static bool s_screen_int_flag = false; //记录是否接收到屏幕的报点中断
|
||||||
#endif
|
static bool s_phone_reset_flag = false; //记录是否接收到手机的开机复位信号
|
||||||
|
static bool s_screen_int_transfer_status = false; //记录是否已经开始通信
|
||||||
|
bool s_screen_init_complate = true; //屏幕TP开机初始化完成标志,初始值为true,确保app_tp_transfer_screen_start之后才配置开机初始化
|
||||||
|
static uint8_t s_screen_const_transfer_count = 0xff; //记录当前通信到哪一步,初始值必须大于 screen_reg_start_data_size
|
||||||
|
|
||||||
static void app_tp_transfer_phone(size_t recieve_num);
|
static void app_tp_transfer_phone(size_t recieve_num);
|
||||||
//static void app_tp_reset_callback(void *data);
|
static void app_tp_reset_callback(void *data);
|
||||||
#if PHONE_SLAVE_TRANSFER_I2C //消除warning
|
#if PHONE_SLAVE_TRANSFER_I2C //消除warning
|
||||||
static void app_tp_i2cs_callback(e_i2c_s_int_status int_status, size_t recieve_num);
|
static void app_tp_i2cs_callback(e_i2c_s_int_status int_status, size_t recieve_num);
|
||||||
#endif
|
#endif
|
||||||
#if PHONE_SLAVE_TRANSFER_SPI //消除warning
|
#if PHONE_SLAVE_TRANSFER_SPI //消除warning
|
||||||
static void app_tp_spis_callback(hal_spis_event_e event, hal_spi_packet_info_t *packet_info);
|
static void app_tp_spis_callback(hal_spis_event_e event, hal_spi_packet_info_t *packet_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_FOR_SUMSUNG_S21U
|
uint32_t s_tp_restart_count = 0;
|
||||||
uint8_t MI10_PRO_screen_init_data1[3] = {0xA0,0x00,0x01};
|
|
||||||
uint8_t MI10_PRO_screen_init_data2[6] = {0xA2,0x03,0x00,0x00,0x00,0x03};
|
|
||||||
uint8_t MI10_PRO_screen_init_data3[3] = {0xA2,0x02,0x00};
|
|
||||||
uint8_t MI10_PRO_screen_init_data4[3] = {0xC0,0x07,0x01};
|
|
||||||
|
|
||||||
//uint8_t MI10_PRO_screen_init_data5[3] = {0xA4,0x06,0x70};
|
|
||||||
//uint8_t MI10_PRO_screen_init_data6[3] = {0xA6,0x00,0x00};
|
|
||||||
//uint8_t MI10_PRO_screen_init_data7[5] = {0xFA,0x20,0x00,0x00,0x78};
|
|
||||||
|
|
||||||
//uint8_t MI10_PRO_screen_init_data8[6] = {0xA2,0x03,0x20,0x00,0x00,0x00};
|
|
||||||
//uint8_t MI10_PRO_screen_init_data9[2] = {0xA0,0x01};
|
|
||||||
//uint8_t MI10_PRO_screen_init_data10[3] = {0xA0,0x00,0x00};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_screen_int_callback
|
* @name : app_tp_screen_int_callback
|
||||||
* @brief : screen 报点中断 回调函数
|
* @brief : screen 报点中断 回调函数
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
|
@ -74,77 +58,65 @@ static void app_tp_screen_int_callback(void *data)
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_screen_int_lvl_low
|
* @name : app_tp_screen_int_lvl_low
|
||||||
* @brief : 获取 screen 报点中断 IO 电平
|
* @brief : 获取 screen 报点中断 IO 电平
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return : true:IO 为低电平
|
* @return : true:IO 为低电平
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
static bool app_tp_screen_int_lvl_low(void)
|
static bool app_tp_screen_int_lvl_low(void)
|
||||||
{
|
{
|
||||||
uint8_t i = 1;
|
#if SCREEN_INT_LOW_DEFAULT
|
||||||
uint8_t j = 1;
|
return hal_gpio_get_input_data(g_screen_input_int_pad); //INT 为高电平时,说明还有报点数据没读出
|
||||||
#if SCREEN_MASTER_TRANSFER_I2C
|
|
||||||
// i=hal_gpio_get_input_data(g_screen_input_int_pad);
|
|
||||||
// j=hal_gpio_get_input_data(g_screen_input_int_pad);
|
|
||||||
// if((i+j)==0)
|
|
||||||
// {
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
//else
|
|
||||||
// {
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
return !hal_gpio_get_input_data(g_screen_input_int_pad);
|
|
||||||
#elif SCREEN_MASTER_TRANSFER_SPI
|
|
||||||
return !hal_gpio_get_input_data(g_screen_input_int_pad); //应对SPI主机通信过程中偶尔突然拉低CS 导致通信异常
|
|
||||||
#else
|
#else
|
||||||
return false;
|
return !hal_gpio_get_input_data(g_screen_input_int_pad); //INT 为低电平时,说明还有报点数据没读出
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_screen_int_init
|
* @name : app_tp_screen_int_init
|
||||||
* @brief : screen 报点中断 IO 初始化
|
* @brief : screen 报点中断 IO 初始化
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
static void app_tp_screen_int_init(void)
|
static void app_tp_screen_int_init(void)
|
||||||
{
|
{
|
||||||
hal_gpio_set_pull_state(g_screen_input_int_pad, ENABLE, DISABLE); // 1.配置上拉
|
hal_gpio_ctrl_eint(g_screen_input_int_pad, DISABLE); // 1.关闭中断
|
||||||
hal_gpio_ctrl_eint(g_screen_input_int_pad, DISABLE); // 2.关闭中断
|
#if SCREEN_INT_LOW_DEFAULT
|
||||||
hal_gpio_init_eint(g_screen_input_int_pad, DETECT_FALLING_EDGE); // 3.中断初始化,TP一般都是下降沿触发中断
|
hal_gpio_set_pull_state(g_screen_input_int_pad, DISABLE, ENABLE); // 2.配置下拉
|
||||||
hal_gpio_reg_eint_cb(g_screen_input_int_pad, app_tp_screen_int_callback); // 4.注册回调
|
hal_gpio_init_eint(g_screen_input_int_pad, DETECT_RISING_EDGE); // 3.中断初始化,INT 上升沿触发中断
|
||||||
hal_gpio_ctrl_eint(g_screen_input_int_pad, ENABLE); // 5.使能中断
|
#else
|
||||||
|
hal_gpio_set_pull_state(g_screen_input_int_pad, ENABLE, DISABLE); // 2.配置上拉
|
||||||
|
hal_gpio_init_eint(g_screen_input_int_pad, DETECT_FALLING_EDGE); // 3.中断初始化,INT 下降沿触发中断
|
||||||
|
#endif
|
||||||
|
hal_gpio_reg_eint_cb(g_screen_input_int_pad, app_tp_screen_int_callback); // 4.注册回调
|
||||||
|
hal_gpio_ctrl_eint(g_screen_input_int_pad, ENABLE); // 5.使能中断
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_phone_reset_init
|
* @name : app_tp_phone_reset_init
|
||||||
* @brief : phone reset 中断 IO 初始化
|
* @brief : phone reset 中断 IO 初始化
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
static void app_tp_phone_reset_init(void)
|
static void app_tp_phone_reset_init(void)
|
||||||
{
|
{
|
||||||
/*0.配置为输入*/
|
/*0.配置为输入*/
|
||||||
hal_gpio_init_input(g_phone_input_rst_pad);
|
hal_gpio_init_input(g_phone_input_rst_pad);
|
||||||
/*1.关闭中断*/
|
/*1.关闭中断*/
|
||||||
hal_gpio_ctrl_eint(g_phone_input_rst_pad, DISABLE);
|
hal_gpio_ctrl_eint(g_phone_input_rst_pad, DISABLE);
|
||||||
/*2.中断初始化*/
|
/*2.中断初始化*/
|
||||||
hal_gpio_init_eint(g_phone_input_rst_pad, DETECT_RISING_EDGE);
|
hal_gpio_init_eint(g_phone_input_rst_pad, DETECT_RISING_EDGE);
|
||||||
/*3.注册回调*/
|
/*3.注册回调*/
|
||||||
hal_gpio_reg_eint_cb(g_phone_input_rst_pad, app_tp_reset_callback);
|
hal_gpio_reg_eint_cb(g_phone_input_rst_pad, app_tp_reset_callback);
|
||||||
/*4.使能中断*/
|
/*4.使能中断*/
|
||||||
hal_gpio_ctrl_eint(g_phone_input_rst_pad, ENABLE);
|
hal_gpio_ctrl_eint(g_phone_input_rst_pad, ENABLE);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_screen_init
|
* @name : app_tp_screen_init
|
||||||
* @brief : screen IO 跳变,开始初始化
|
* @brief : screen IO 跳变,开始初始化
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
|
@ -154,51 +126,31 @@ void app_tp_screen_init(void)
|
||||||
hal_gpio_init_output(g_screen_input_rst_pad, IO_LVL_HIGH);
|
hal_gpio_init_output(g_screen_input_rst_pad, IO_LVL_HIGH);
|
||||||
delayUs(200);
|
delayUs(200);
|
||||||
hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_LOW);
|
hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_LOW);
|
||||||
delayUs(200);
|
// delayUs(200);
|
||||||
|
delayMs(2);
|
||||||
hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_HIGH);
|
hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_HIGH);
|
||||||
|
delayUs(400);
|
||||||
}
|
}
|
||||||
|
|
||||||
void app_tp_I2C_init(void)
|
void app_tp_I2C_init(void)
|
||||||
{
|
{
|
||||||
hal_i2c_s_init(CHIP_I2C_ADDRESS, CHIP_I2C_ADDR_BITS);
|
hal_i2c_s_init(CHIP_I2C_ADDRESS, CHIP_I2C_ADDR_BITS);
|
||||||
hal_i2c_s_set_transfer(app_tp_i2cs_callback);
|
hal_i2c_s_set_transfer(app_tp_i2cs_callback);
|
||||||
hal_i2c_s_nonblocking_read(s_phone_read_buffer, BUFFER_SIZE_MAX); //先配置接收 buffer
|
hal_i2c_s_nonblocking_read(s_phone_read_buffer, BUFFER_SIZE_MAX); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD> buffer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_init
|
* @name : app_tp_init
|
||||||
* @brief : 初始化通信相关
|
* @brief : 初始化通信相关
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
void app_tp_init(void)
|
void app_tp_init(void)
|
||||||
{
|
{
|
||||||
#ifdef DISABLE_TDDI_I2C_FUNCTION
|
// app_tp_phone_reset_init(); //初始化手机复位的IO口
|
||||||
hal_gpio_init_output(g_phone_output_int_pad, IO_LVL_HIGH); //配置phone报点输出中断IO口
|
app_tp_screen_int_init(); //配置screen中断输入引脚
|
||||||
hal_gpio_init_output(g_screen_input_rst_pad, IO_LVL_HIGH); //配置模组TP RESET
|
hal_gpio_init_output(g_phone_output_int_pad, IO_LVL_HIGH); //配置phone报点输出中断IO口
|
||||||
|
|
||||||
hal_gpio_set_mode(IO_PAD_TD_SPIM_CLK,IO_MODE_I2C1_SCL);
|
|
||||||
hal_gpio_set_mode(IO_PAD_TD_SPIM_CSN,IO_MODE_I2C1_SDA);
|
|
||||||
|
|
||||||
return;
|
|
||||||
#else
|
|
||||||
hal_gpio_set_pull_state(IO_PAD_TD_SPIM_CLK, ENABLE, DISABLE);
|
|
||||||
hal_gpio_set_pull_state(IO_PAD_TD_SPIM_CSN, ENABLE, DISABLE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
app_tp_screen_init(); //初始化手机复位的IO口
|
|
||||||
//app_tp_screen_int_init(); //配置screen中断输入引脚
|
|
||||||
#ifdef G_PHONE_INT_DEFAULT_LOW
|
|
||||||
hal_gpio_init_output(g_phone_output_int_pad, IO_LVL_LOW); //配置phone报点输出中断IO口
|
|
||||||
#else
|
|
||||||
hal_gpio_init_output(g_phone_output_int_pad, IO_LVL_HIGH); //配置phone报点输出中断IO口
|
|
||||||
#endif
|
|
||||||
hal_gpio_init_input(g_screen_input_int_pad);
|
|
||||||
// hal_gpio_init_output(g_screen_input_rst_pad, IO_LVL_HIGH); //配置模组TP RESET
|
|
||||||
|
|
||||||
#if SCREEN_MASTER_TRANSFER_I2C
|
#if SCREEN_MASTER_TRANSFER_I2C
|
||||||
hal_i2c_m_dma_init(SCREEN_I2C_ADDRESS, SCREEN_I2C_ADDR_BITS, I2C_MASTER_SPEED);
|
hal_i2c_m_dma_init(SCREEN_I2C_ADDRESS, SCREEN_I2C_ADDR_BITS, I2C_MASTER_SPEED);
|
||||||
|
@ -207,30 +159,29 @@ void app_tp_init(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if PHONE_SLAVE_TRANSFER_I2C
|
#if PHONE_SLAVE_TRANSFER_I2C
|
||||||
// hal_i2c_s_init(CHIP_I2C_ADDRESS, CHIP_I2C_ADDR_BITS);
|
// hal_i2c_s_init(CHIP_I2C_ADDRESS, CHIP_I2C_ADDR_BITS);
|
||||||
// hal_i2c_s_set_transfer(app_tp_i2cs_callback);
|
// hal_i2c_s_set_transfer(app_tp_i2cs_callback);
|
||||||
// hal_i2c_s_nonblocking_read(s_phone_read_buffer, BUFFER_SIZE_MAX); //先配置接收 buffer
|
// hal_i2c_s_nonblocking_read(s_phone_read_buffer, BUFFER_SIZE_MAX); //先配置接收 buffer
|
||||||
#elif PHONE_SLAVE_TRANSFER_SPI
|
#elif PHONE_SLAVE_TRANSFER_SPI
|
||||||
hal_spi_slave_init(PHONE_SPI_CPHA, PHONE_SPI_CPOL, true); // 初始化spi以及dma
|
hal_spi_slave_init(PHONE_SPI_CPHA, PHONE_SPI_CPOL, true); // 初始化spi以及dma
|
||||||
hal_spi_slave_register_callback(app_tp_spis_callback); // 注册回调
|
hal_spi_slave_register_callback(app_tp_spis_callback); // 注册回调
|
||||||
hal_spi_slave_auto_transfer_abort(); // 停止传输
|
hal_spi_slave_auto_transfer_abort(); // 停止传输
|
||||||
hal_spi_slave_flush_fifo(); // Flush FIFO
|
hal_spi_slave_flush_fifo(); // Flush FIFO
|
||||||
|
|
||||||
/* 每个packet自动接收, circle mode 为false, 即收到buffer max size数据后buffer不再更新, packet完成后调用回调 */
|
/* 每个packet自动接收, circle mode 为false, 即收到buffer max size数据后buffer不再更新, packet完成后调用回调 */
|
||||||
hal_spi_slave_set_auto_rx_buffer(s_phone_read_buffer, BUFFER_SIZE_MAX, false); // 设置auto rx buffer
|
hal_spi_slave_set_auto_rx_buffer(s_phone_read_buffer, BUFFER_SIZE_MAX, false); // 设置auto rx buffer
|
||||||
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
|
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
|
||||||
|
|
||||||
hal_spi_slave_enable(); // 启动spis
|
hal_spi_slave_enable(); // 启动spis
|
||||||
hal_spi_slave_auto_transfer_start(); // 启动rx自动接收
|
hal_spi_slave_auto_transfer_start(); // 启动tx自动发送
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_m_transfer_complate
|
* @name : app_tp_m_transfer_complate
|
||||||
* @brief : 获取主机通信完成状态
|
* @brief : 获取主机通信完成状态
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :true: 通信完成
|
* @return :true: 通信完成
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
bool app_tp_m_transfer_complate(void)
|
bool app_tp_m_transfer_complate(void)
|
||||||
|
@ -246,16 +197,16 @@ bool app_tp_m_transfer_complate(void)
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_s_transfer_complate
|
* @name : app_tp_s_transfer_complate
|
||||||
* @brief : 获取从机通信完成状态
|
* @brief : 获取从机通信完成状态
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :true: 通信完成
|
* @return :true: 通信完成
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
bool app_tp_s_transfer_complate(void)
|
bool app_tp_s_transfer_complate(void)
|
||||||
{
|
{
|
||||||
#if SCREEN_MASTER_TRANSFER_I2C
|
#if PHONE_SLAVE_TRANSFER_I2C
|
||||||
return hal_i2c_s_write_complate() && hal_i2c_s_read_complate();
|
return hal_i2c_s_write_complate() && hal_i2c_s_read_complate();
|
||||||
#elif SCREEN_MASTER_TRANSFER_SPI
|
#elif PHONE_SLAVE_TRANSFER_SPI
|
||||||
return !hal_spi_slave_busy();
|
return !hal_spi_slave_busy();
|
||||||
#else
|
#else
|
||||||
return true;
|
return true;
|
||||||
|
@ -264,9 +215,9 @@ bool app_tp_s_transfer_complate(void)
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_m_write
|
* @name : app_tp_m_write
|
||||||
* @brief : 根据通信方式配置发送txbuffer中的数据
|
* @brief : 根据通信方式配置发送txbuffer中的数据
|
||||||
* @param[in] :txbuffer: 发送数据 buffer 头地址
|
* @param[in] :txbuffer: 发送数据 buffer 头地址
|
||||||
* @param[in] :buffer_size: 发送数据 buffer 长度
|
* @param[in] :buffer_size: 发送数据 buffer 长度
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
@ -282,11 +233,11 @@ void app_tp_m_write(const uint8_t *txbuffer, size_t buffer_size)
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_m_read
|
* @name : app_tp_m_read
|
||||||
* @brief : 根据通信方式配置发送txbuffer中的数据和rxbuffer
|
* @brief : 根据通信方式配置发送txbuffer中的数据和rxbuffer
|
||||||
* @param[in] :cmd: 发送命令 buffer 头地址
|
* @param[in] :cmd: 发送命令 buffer 头地址
|
||||||
* @param[in] :cmd_size: 发送命令 buffer 长度
|
* @param[in] :cmd_size: 发送命令 buffer 长度
|
||||||
* @param[in] :data_buffer: 读取数据 buffer 头地址
|
* @param[in] :data_buffer: 读取数据 buffer 头地址
|
||||||
* @param[in] :data_size: 读取数据 buffer 长度
|
* @param[in] :data_size: 读取数据 buffer 长度
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
@ -296,7 +247,7 @@ void app_tp_m_read(const uint8_t *cmd, size_t cmd_size, uint8_t *data_buffer, si
|
||||||
uint8_t i = 0;
|
uint8_t i = 0;
|
||||||
uint32_t address = 0;
|
uint32_t address = 0;
|
||||||
|
|
||||||
for (i = 0; i < cmd_size; i++) //先将要发送的数据整合到 address
|
for (i = 0; i < cmd_size; i++) //先将要发送的数据整合到 address
|
||||||
{
|
{
|
||||||
address |= (uint32_t)cmd[i] << i * 8;
|
address |= (uint32_t)cmd[i] << i * 8;
|
||||||
}
|
}
|
||||||
|
@ -308,9 +259,9 @@ void app_tp_m_read(const uint8_t *cmd, size_t cmd_size, uint8_t *data_buffer, si
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_s_write
|
* @name : app_tp_s_write
|
||||||
* @brief : 根据通信方式配置发送txbuffer中的数据
|
* @brief : 根据通信方式配置发送txbuffer中的数据
|
||||||
* @param[in] :txbuffer: 发送数据 buffer 头地址
|
* @param[in] :txbuffer: 发送数据 buffer 头地址
|
||||||
* @param[in] :buffer_size: 发送数据 buffer 长度
|
* @param[in] :buffer_size: 发送数据 buffer 长度
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
@ -320,18 +271,22 @@ void app_tp_s_write(const uint8_t *txbuffer, size_t buffer_size)
|
||||||
hal_i2c_s_dma_write(txbuffer, buffer_size);
|
hal_i2c_s_dma_write(txbuffer, buffer_size);
|
||||||
#elif PHONE_SLAVE_TRANSFER_SPI
|
#elif PHONE_SLAVE_TRANSFER_SPI
|
||||||
//while (hal_spi_slave_busy());
|
//while (hal_spi_slave_busy());
|
||||||
|
#if 1
|
||||||
|
hal_spi_slave_reset_tx(txbuffer, buffer_size, true);
|
||||||
|
#else
|
||||||
hal_spi_slave_auto_transfer_abort();
|
hal_spi_slave_auto_transfer_abort();
|
||||||
hal_spi_slave_flush_fifo();
|
hal_spi_slave_flush_fifo();
|
||||||
hal_spi_slave_set_auto_tx_buffer(txbuffer, buffer_size, true);
|
hal_spi_slave_set_auto_tx_buffer(txbuffer, buffer_size, true);
|
||||||
hal_spi_slave_auto_transfer_start();
|
hal_spi_slave_auto_transfer_start();
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_s_read
|
* @name : app_tp_s_read
|
||||||
* @brief : 根据通信方式配置rxbuffer
|
* @brief : 根据通信方式配置rxbuffer
|
||||||
* @param[in] :rxBuffer: 读取数据 buffer 头地址
|
* @param[in] :rxBuffer: 读取数据 buffer 头地址
|
||||||
* @param[in] :data_size: 读取数据 buffer 长度
|
* @param[in] :data_size: 读取数据 buffer 长度
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
@ -344,354 +299,319 @@ void app_tp_s_read(void *rxBuffer, size_t data_size)
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_spis_callback
|
* @name : app_tp_spis_callback
|
||||||
* @brief : SPI slave 中断处理函数
|
* @brief : SPI slave 中断处理函数
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
#if PHONE_SLAVE_TRANSFER_I2C //消除warning
|
#if PHONE_SLAVE_TRANSFER_I2C //消除warning
|
||||||
//经测试。int_status=0,为读命令。=2,为STOP。=1未测试到。
|
|
||||||
//recieve_num为接收到的指令个数
|
|
||||||
static void app_tp_i2cs_callback(e_i2c_s_int_status int_status, size_t recieve_num)
|
static void app_tp_i2cs_callback(e_i2c_s_int_status int_status, size_t recieve_num)
|
||||||
{
|
{
|
||||||
#if 0 // 1: test
|
static bool i2cs_transfer = true; //确保一次通信只解析一次
|
||||||
if (int_status >2)
|
if (i2cs_transfer)
|
||||||
{
|
{
|
||||||
s_phone_read_buffer[2]=int_status;
|
i2cs_transfer = false;
|
||||||
s_phone_read_buffer[3]=recieve_num;
|
app_tp_transfer_phone(recieve_num);
|
||||||
app_tp_m_write(s_phone_read_buffer, 4);
|
}
|
||||||
}
|
if (int_status == I2C_S_INT_READ)
|
||||||
#endif
|
{
|
||||||
app_tp_transfer_phone(recieve_num);
|
app_tp_s_write(s_slave_txbuffer, s_slave_txbuffer_size);
|
||||||
|
}
|
||||||
|
else if (int_status == I2C_S_INT_STOP)
|
||||||
|
{
|
||||||
|
i2cs_transfer = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_spis_callback
|
* @name : app_tp_spis_callback
|
||||||
* @brief : SPI slave 中断处理函数
|
* @brief : SPI slave 中断处理函数
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
#if PHONE_SLAVE_TRANSFER_SPI //消除warning
|
#if PHONE_SLAVE_TRANSFER_SPI //消除warning
|
||||||
static void app_tp_spis_callback(hal_spis_event_e event, hal_spi_packet_info_t *packet_info)
|
static void app_tp_spis_callback(hal_spis_event_e event, hal_spi_packet_info_t *packet_info)
|
||||||
{
|
{
|
||||||
app_tp_transfer_phone(packet_info->packet_size);
|
static bool spis_transfer = true; //确保一次通信只解析一次
|
||||||
|
|
||||||
|
// 1. 接收完数据, 完成一次解析??
|
||||||
|
if (spis_transfer)
|
||||||
|
{
|
||||||
|
app_tp_transfer_phone(packet_info->packet_size);
|
||||||
|
spis_transfer = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2.一帧通信结束, 需要重新设置 txbuffer
|
||||||
|
if (event == SPI_EVENT_RCV_CS_HIGH)
|
||||||
|
{
|
||||||
|
spis_transfer = true;
|
||||||
|
if (s_slave_txbuffer_size)
|
||||||
|
{
|
||||||
|
app_tp_s_write(s_slave_txbuffer, s_slave_txbuffer_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_reset_callback
|
* @name : app_tp_reset_callback
|
||||||
* @brief : 手机 IO跳变复位的中断处理函数
|
* @brief : 手机 IO跳变复位的中断处理函数
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
static void app_tp_reset_callback(void *data)
|
static void app_tp_reset_callback(void *data)
|
||||||
{
|
{
|
||||||
TAU_LOGD("app_tp_reset_callback\n");
|
|
||||||
s_phone_reset_flag = true;
|
s_phone_reset_flag = true;
|
||||||
app_tp_s_write(phone_reg_const_data[0].write_back, phone_reg_const_data[0].write_back_size);
|
//app_tp_s_write(phone_reg_const_data[0].write_back, phone_reg_const_data[0].write_back_size); ///////S8 s8p
|
||||||
|
|
||||||
#if PHONE_SLAVE_TRANSFER_SPI
|
#if PHONE_SLAVE_TRANSFER_SPI
|
||||||
hal_gpio_set_output_data(IO_PAD_AP_INT, IO_LVL_LOW);
|
hal_gpio_set_output_data(IO_PAD_AP_INT, IO_LVL_LOW);
|
||||||
#endif
|
#endif
|
||||||
|
//TAU_LOGD("app_tp_reset_callback\n");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
void S20_Start_init(void)
|
|
||||||
{
|
|
||||||
uint8_t len=0;
|
|
||||||
uint8_t temp=0;
|
|
||||||
uint8_t temp_start_flag=0;
|
|
||||||
// if(phone_start_flag==1)
|
|
||||||
{
|
|
||||||
app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
|
|
||||||
while(!hal_i2c_m_transfer_complate());
|
|
||||||
delayMs(2);
|
|
||||||
while(!hal_gpio_get_input_data(g_screen_input_int_pad))
|
|
||||||
{
|
|
||||||
app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
|
|
||||||
while(!hal_i2c_m_transfer_complate());
|
|
||||||
delayMs(2);
|
|
||||||
}
|
|
||||||
temp=s_screen_read_buffer[0]&0xf0;
|
|
||||||
if((temp==0x10)||(temp==0x20)||(temp==0x30))
|
|
||||||
{
|
|
||||||
temp_start_flag=1;
|
|
||||||
}
|
|
||||||
if(temp_start_flag==0)
|
|
||||||
{
|
|
||||||
app_tp_m_write(MI10_PRO_screen_init_data1, sizeof(MI10_PRO_screen_init_data1));//0xA0,0x00,0x01
|
|
||||||
while(!hal_i2c_m_transfer_complate());
|
|
||||||
delayMs(1);
|
|
||||||
app_tp_m_write(MI10_PRO_screen_init_data2, sizeof(MI10_PRO_screen_init_data2));//0xA2,0x03,0x00,0x00,0x00,0x03
|
|
||||||
while(!hal_i2c_m_transfer_complate());
|
|
||||||
delayMs(1);
|
|
||||||
app_tp_m_write(MI10_PRO_screen_init_data3, sizeof(MI10_PRO_screen_init_data3));//0xA2,0x02,0x00
|
|
||||||
while(!hal_i2c_m_transfer_complate());
|
|
||||||
delayMs(1);
|
|
||||||
app_tp_m_write(MI10_PRO_screen_init_data4, sizeof(MI10_PRO_screen_init_data4));//0xC0,0x07,0x01
|
|
||||||
while(!hal_i2c_m_transfer_complate());
|
|
||||||
delayMs(1);
|
|
||||||
app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
|
|
||||||
while(!hal_i2c_m_transfer_complate());
|
|
||||||
if(s_screen_read_buffer[7]>0)
|
|
||||||
{
|
|
||||||
len=s_screen_read_buffer[7]*8;
|
|
||||||
app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, len);
|
|
||||||
while(!hal_i2c_m_transfer_complate());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if(hal_gpio_get_input_data(g_screen_input_int_pad))
|
|
||||||
{
|
|
||||||
s_screen_init_complate = true;
|
|
||||||
app_tp_screen_int_init();
|
|
||||||
phone_start_flag=0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_transfer_screen_const
|
* @name : app_tp_transfer_screen_const
|
||||||
* @brief : 按照flow读写screen,完成 开机 screen 初始化
|
* @brief : 按照flow读写screen,完成 开机 screen 初始化
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
*修改TP第1步:模组初始化!!!!!!
|
|
||||||
*执行数组screen_reg_start_data[]。
|
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
static void app_tp_transfer_screen_const(void)
|
static void app_tp_transfer_screen_const(void)
|
||||||
{
|
{
|
||||||
// static bool screen_const_transfer_buffer_ready = true; //发送 buffer 是否已准备好
|
static bool screen_const_transfer_buffer_ready = true; //发送 buffer 是否已准备好
|
||||||
uint8_t ii;
|
|
||||||
// uint8_t len=0;
|
/**** 1. 判断当前状态通信已结束, 并且开机初始化流程还未走完****/
|
||||||
/**** 1. 判断当前状态通信已结束, 状态通信已结束,并且开机初始化流程还未走完****/
|
|
||||||
#if 0 // test
|
|
||||||
uint8_t test_master_read_buffer[10] = {0x08, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19};
|
|
||||||
uint8_t write_buffer[10] = {0x04, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19};
|
|
||||||
|
|
||||||
// for (ii =0x20; ii<0x7F; ii++)
|
|
||||||
{
|
|
||||||
//hal_i2c_m_dma_init(ii, SCREEN_I2C_ADDR_BITS);
|
|
||||||
//delayMs(100);
|
|
||||||
if (hal_i2c_m_dma_write(write_buffer, 1))
|
|
||||||
{
|
|
||||||
//break;
|
|
||||||
}
|
|
||||||
while(!hal_i2c_m_transfer_complate());
|
|
||||||
hal_i2c_m_dma_read(test_master_read_buffer, 1, test_master_read_buffer, 2);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
if (app_tp_m_transfer_complate() && (s_screen_const_transfer_count < screen_reg_start_data_size))
|
if (app_tp_m_transfer_complate() && (s_screen_const_transfer_count < screen_reg_start_data_size))
|
||||||
{
|
{
|
||||||
if (s_spim_write) //SPI 写数据后需要把接收FIFO的数据读出,不然会影响下一次读取
|
if (s_spim_write) //SPI 写数据后需要把接收FIFO的数据读出,不然会影响下一次读取
|
||||||
{
|
{
|
||||||
hal_spi_m_clear_rxfifo();
|
hal_spi_m_clear_rxfifo();
|
||||||
s_spim_write = false;
|
s_spim_write = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
/**** 2. 发送或读取从机数据 ****/
|
||||||
|
|
||||||
// #ifndef USE_FOR_SUMSUNG_S20
|
|
||||||
// for (ii =0; ii<screen_reg_start_data_size; ii++)
|
|
||||||
// {
|
|
||||||
// if (!screen_reg_start_data[ii].read_flag) //当前通信不需要读回,直接写
|
|
||||||
// {
|
|
||||||
// app_tp_m_write(screen_reg_start_data[ii].buffer, screen_reg_start_data[ii].txbuffer_size);
|
|
||||||
// }
|
|
||||||
// else //当前通信需要读回,先写再读
|
|
||||||
// {
|
|
||||||
// app_tp_m_read(screen_reg_start_data[ii].buffer, screen_reg_start_data[ii].txbuffer_size, \
|
|
||||||
// s_screen_read_bak, screen_reg_start_data[ii].rxbuffer_size);
|
|
||||||
// }
|
|
||||||
// while(!hal_i2c_m_transfer_complate());
|
|
||||||
// }
|
|
||||||
// #endif
|
|
||||||
#ifdef USE_FOR_SUMSUNG_S21U
|
|
||||||
|
|
||||||
#if 1
|
|
||||||
|
|
||||||
if(phone_start_flag==1)
|
|
||||||
{
|
|
||||||
S20_Start_init();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0//
|
|
||||||
delayMs(100);
|
|
||||||
app_tp_m_read(screen_reg_int_data[0].buffer, screen_reg_int_data[0].txbuffer_size, s_screen_number, screen_reg_int_data[0].rxbuffer_size);
|
|
||||||
while(!hal_i2c_m_transfer_complate());
|
|
||||||
#endif
|
|
||||||
#ifdef USE_FOR_SUMSUNG_S20
|
|
||||||
s_screen_init_complate = true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
/**** 2. 发送或读取从机数据 ****/
|
|
||||||
if (screen_const_transfer_buffer_ready)
|
if (screen_const_transfer_buffer_ready)
|
||||||
{
|
{
|
||||||
screen_const_transfer_buffer_ready = false;
|
screen_const_transfer_buffer_ready = false;
|
||||||
if (!screen_reg_start_data[s_screen_const_transfer_count].read_flag) //当前通信不需要读回,直接写
|
g_screen_tp_init_start = true;
|
||||||
|
|
||||||
|
if (!screen_reg_start_data[s_screen_const_transfer_count].read_flag) //当前通信不需要读回,直接写
|
||||||
{
|
{
|
||||||
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);
|
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);
|
||||||
|
// delayMs(5);
|
||||||
}
|
}
|
||||||
else //当前通信需要读回,先写再读
|
else //当前通信需要读回,先写再读
|
||||||
{
|
{
|
||||||
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, \
|
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, \
|
||||||
s_screen_number, screen_reg_start_data[s_screen_const_transfer_count].rxbuffer_size);
|
s_screen_read_buffer, screen_reg_start_data[s_screen_const_transfer_count].rxbuffer_size);
|
||||||
}
|
}
|
||||||
s_screen_init_complate = true;
|
|
||||||
}
|
}
|
||||||
/**** 3. 解析本次通信数据,并准备下一次通信的buffer ****/
|
/**** 3. 解析本次通信数据,并准备下一次通信的buffer ****/
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
screen_const_transfer_buffer_ready = true;
|
screen_const_transfer_buffer_ready = true;
|
||||||
s_screen_const_transfer_count = app_tp_screen_analysis_const(s_screen_const_transfer_count, s_screen_number, \
|
s_screen_const_transfer_count = app_tp_screen_analysis_const(s_screen_const_transfer_count, s_screen_read_buffer, \
|
||||||
screen_reg_start_data[s_screen_const_transfer_count].rxbuffer_size);
|
screen_reg_start_data[s_screen_const_transfer_count].rxbuffer_size);
|
||||||
|
|
||||||
if (s_screen_const_transfer_count >= screen_reg_start_data_size)
|
if (s_screen_const_transfer_count >= screen_reg_start_data_size)
|
||||||
{
|
{
|
||||||
s_screen_init_complate = true;
|
s_screen_init_complate = true;
|
||||||
|
TAU_LOGD("tp init done\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_transfer_screen_start
|
* @name : app_tp_transfer_screen_start
|
||||||
* @brief : 按照flow读写screen,开始开机初始化
|
* @brief : 按照flow读写screen,开始开机初始化
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
void app_tp_transfer_screen_start_init(void)
|
||||||
|
{
|
||||||
|
s_screen_init_complate = false;
|
||||||
|
s_screen_const_transfer_count = 0;
|
||||||
|
app_tp_screen_init();
|
||||||
|
}
|
||||||
|
|
||||||
void app_tp_transfer_screen_start(void)
|
void app_tp_transfer_screen_start(void)
|
||||||
{
|
{
|
||||||
// s_screen_init_complate = false;
|
// s_screen_init_complate = false;
|
||||||
s_screen_const_transfer_count = 0;
|
// s_screen_const_transfer_count = 0;
|
||||||
//app_tp_screen_init();
|
// app_tp_screen_init();
|
||||||
#ifndef DISABLE_I2C_INIT_CODE
|
// delayMs(10);
|
||||||
app_tp_transfer_screen_const();
|
app_tp_transfer_screen_const();
|
||||||
#endif
|
}
|
||||||
s_screen_int_flag = false;
|
|
||||||
|
void app_tp_transfer_screen_restart(void)
|
||||||
|
{
|
||||||
|
if(g_screen_tp_init_restart == true)
|
||||||
|
{
|
||||||
|
if(s_tp_restart_count < (65536/5)) // 65536*3 = 900ms 65536/5 = 60ms
|
||||||
|
{
|
||||||
|
s_tp_restart_count ++;
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
s_tp_restart_count = 0;
|
||||||
|
g_screen_tp_init_restart = false;
|
||||||
|
// app_tp_transfer_screen_start();
|
||||||
|
ap_tp_st_touch_hardware_reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ap_tp_st_touch_get_status(void)
|
||||||
|
{
|
||||||
|
app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
|
||||||
|
while(!hal_i2c_m_transfer_complate());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_transfer_screen_int
|
* @name : app_tp_transfer_screen_int
|
||||||
* @brief : 接收screen中断后,按照flow读写screen,即报点协议转换
|
* @brief : 接收screen中断后,按照flow读写screen,即报点协议转换
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
*修改TP第2步:读取模组报点!!!!!!
|
|
||||||
*执行数组screen_reg_int_data[]。也可以自己写。
|
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
void app_tp_transfer_screen_int(void)
|
void app_tp_transfer_screen_int(void)
|
||||||
{
|
{
|
||||||
uint8_t len=0;
|
uint16_t data_size = 0;
|
||||||
uint8_t temp_len=0;
|
|
||||||
bool screen_gpio_int = false;
|
|
||||||
static uint8_t screen_int_transfer_count = 0; //记录当前通信到哪一步
|
|
||||||
static bool screen_int_transfer_buffer_ready = true; //发送 buffer 是否已准备好
|
|
||||||
// static uint8_t test_flag = 0;
|
|
||||||
// s_screen_init_complate=false;//为了在线烧录,特意将码片设置为不下发数据,而是FT8719与敦泰的工具通讯
|
|
||||||
if (!s_screen_init_complate) //TP 初始化还未完成,则先进行初始化操作
|
|
||||||
{
|
|
||||||
|
|
||||||
|
uint8_t len = 0;
|
||||||
|
bool screen_gpio_int = false;
|
||||||
|
static uint8_t screen_int_transfer_count = 0; //记录当前通信到哪一步
|
||||||
|
static bool screen_int_transfer_buffer_ready = true; //发送 buffer 是否已准备好
|
||||||
|
volatile bool init_gpio = false;
|
||||||
|
if (!s_screen_init_complate) //TP 初始化还未完成,则先进行初始化操作
|
||||||
|
{
|
||||||
app_tp_transfer_screen_const();
|
app_tp_transfer_screen_const();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app_tp_transfer_screen_restart();
|
||||||
/**** 1. 判断 screen 是否发出中断信号 ****/
|
app_tp_screen_analysis_wake_up_exec();
|
||||||
// s_screen_int_flag: 中断信号标志位
|
|
||||||
// app_tp_screen_int_lvl_low : SPI 长时间通信时,偶尔会出现cs拉高导致通信异常卡死,该标志位用于解决卡死的问题
|
#if 1
|
||||||
screen_gpio_int = s_screen_int_flag || app_tp_screen_int_lvl_low();
|
static bool analysis_flag = false;
|
||||||
if (screen_gpio_int)
|
|
||||||
|
if(analysis_flag == true)
|
||||||
{
|
{
|
||||||
s_screen_int_flag = false;
|
if(app_tp_m_transfer_complate())
|
||||||
|
{
|
||||||
|
/**** 3. 转换报点数据 ****/
|
||||||
|
// data_size =63; //需针对不同项目修改!!!!
|
||||||
|
if(s_screen_read_buffer[7]>0)
|
||||||
|
{
|
||||||
|
len = s_screen_read_buffer[7]*8;
|
||||||
|
}
|
||||||
|
app_tp_screen_analysis_int(1, s_screen_read_buffer,(len+8));
|
||||||
|
analysis_flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
screen_gpio_int = s_screen_int_flag || app_tp_screen_int_lvl_low();
|
||||||
|
if ((screen_gpio_int) && app_tp_m_transfer_complate()) //判断当前不处于通信状态,并且准备通信
|
||||||
|
{
|
||||||
|
s_screen_int_flag = false;
|
||||||
|
|
||||||
app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
|
/**** 2. 读取从机数据 ****/
|
||||||
while(!hal_i2c_m_transfer_complate());
|
app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 40);
|
||||||
if(s_screen_read_buffer[7]>0)
|
analysis_flag = true;
|
||||||
{
|
}
|
||||||
len=s_screen_read_buffer[7]*8;
|
}
|
||||||
app_tp_m_read(screen_reg_int_data[0].buffer, 1, &s_screen_read_buffer[8], len);
|
#else
|
||||||
while(!hal_i2c_m_transfer_complate());
|
/**** 1. 判断 screen 是否发出中断信号 ****/
|
||||||
temp_len=len+7;
|
// s_screen_int_flag: 中断信号标志位
|
||||||
}
|
// app_tp_screen_int_lvl_low : SPI 长时间通信时,偶尔会出现cs拉高导致通信异常卡死,该标志位用于解决卡死的问题
|
||||||
if(s_screen_read_buffer[temp_len]>0)
|
init_gpio = app_tp_screen_int_lvl_low();
|
||||||
{
|
screen_gpio_int = (s_screen_int_flag || init_gpio);
|
||||||
len=s_screen_read_buffer[7]*8;
|
// if (((screen_gpio_int) || (s_screen_int_transfer_status)) && app_tp_m_transfer_complate()) //判断当前不处于通信状态,并且准备通信
|
||||||
app_tp_m_read(screen_reg_int_data[0].buffer, 1, &s_screen_read_buffer[temp_len+1], len);
|
if ((screen_gpio_int))
|
||||||
while(!hal_i2c_m_transfer_complate());
|
{
|
||||||
}
|
s_screen_int_flag = false;
|
||||||
delayUs(100);
|
|
||||||
|
/**** 2. 发送或读取从机数据 ****/
|
||||||
while(!hal_gpio_get_input_data(g_screen_input_int_pad))
|
// if (screen_int_transfer_buffer_ready)
|
||||||
{
|
{
|
||||||
|
// screen_int_transfer_buffer_ready = false;
|
||||||
|
// s_screen_int_transfer_status = true;
|
||||||
|
|
||||||
app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
|
app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
|
||||||
while(!hal_i2c_m_transfer_complate());
|
while(!hal_i2c_m_transfer_complate());
|
||||||
delayUs(100);
|
|
||||||
if(s_screen_read_buffer[7]>0)
|
if(s_screen_read_buffer[7]>0)
|
||||||
{
|
{
|
||||||
len=s_screen_read_buffer[7]*8;
|
TAU_LOGD("F");
|
||||||
|
len = s_screen_read_buffer[7]*8;
|
||||||
app_tp_m_read(screen_reg_int_data[0].buffer, 1, &s_screen_read_buffer[8], len);
|
app_tp_m_read(screen_reg_int_data[0].buffer, 1, &s_screen_read_buffer[8], len);
|
||||||
while(!hal_i2c_m_transfer_complate());
|
while(!hal_i2c_m_transfer_complate());
|
||||||
delayUs(100);
|
}
|
||||||
}
|
|
||||||
}
|
delayUs(100);
|
||||||
ap_tp_st_touch_error_handler_F3(s_screen_read_buffer);
|
|
||||||
ap_tp_st_touch_error_handler_FF(s_screen_read_buffer);
|
ap_tp_st_touch_error_handler_F3(s_screen_read_buffer);
|
||||||
ap_tp_st_touch_scan_point_record_event(s_screen_read_buffer, len + 8);
|
ap_tp_st_touch_error_handler_FF(s_screen_read_buffer);
|
||||||
screen_int_transfer_buffer_ready = true;
|
ap_tp_st_touch_error_handler_03(s_screen_read_buffer);
|
||||||
screen_int_transfer_count = app_tp_screen_analysis_int(screen_int_transfer_count, s_screen_read_buffer,screen_reg_int_data[2].rxbuffer_size);
|
ap_tp_st_touch_scan_point_record_event(s_screen_read_buffer, len + 8);
|
||||||
screen_int_transfer_count = 0;
|
|
||||||
s_screen_int_transfer_status = false;
|
screen_int_transfer_count = app_tp_screen_analysis_int(screen_int_transfer_count, s_screen_read_buffer, (len + 8));
|
||||||
|
s_screen_int_transfer_status = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**** 3. 解析本次通信数据,并准备下一次通信的buffer ****/
|
||||||
|
/* else
|
||||||
|
{
|
||||||
|
screen_int_transfer_buffer_ready = true;
|
||||||
|
|
||||||
|
screen_int_transfer_count = app_tp_screen_analysis_int(screen_int_transfer_count, s_screen_read_buffer, \
|
||||||
|
(len + 8));
|
||||||
|
|
||||||
|
// screen_int_transfer_count = app_tp_screen_analysis_int(screen_int_transfer_count, s_screen_read_buffer, \
|
||||||
|
// screen_reg_int_data[screen_int_transfer_count].rxbuffer_size);
|
||||||
|
|
||||||
|
if (screen_int_transfer_count >= screen_reg_int_data_size) //解析需要等最后一次通信结束,最后一次数据解析后,停止通信
|
||||||
|
{
|
||||||
|
screen_int_transfer_count = 0;
|
||||||
|
s_screen_int_transfer_status = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_transfer_phone
|
* @name : app_tp_transfer_phone
|
||||||
* @brief : 根据数据解析进行相应的答复
|
* @brief : 根据数据解析进行相应的答复
|
||||||
* @param[in] : recieve_num:接收数据长度
|
* @param[in] : recieve_num:接收数据长度
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
static void app_tp_transfer_phone(size_t recieve_num)
|
static void app_tp_transfer_phone(size_t recieve_num)
|
||||||
{
|
{
|
||||||
const uint8_t *phone_write_buffer;
|
/* 数据解析,判断是否需要答复以及答复的buffer指针 */
|
||||||
size_t phone_write_buffer_size = 0;
|
|
||||||
/* 数据解析,判断是否需要答复以及答复的buffer指针 */
|
|
||||||
if (recieve_num > 0)
|
if (recieve_num > 0)
|
||||||
{
|
{
|
||||||
#if 0// 1: test
|
app_tp_phone_analysis_data(s_phone_read_buffer, recieve_num, &s_slave_txbuffer, &s_slave_txbuffer_size);
|
||||||
s_phone_read_buffer[3]=recieve_num;
|
|
||||||
app_tp_m_write(s_phone_read_buffer, 4);
|
|
||||||
#endif
|
|
||||||
app_tp_phone_analysis_data(s_phone_read_buffer, recieve_num, &phone_write_buffer, &phone_write_buffer_size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
app_tp_s_read(s_phone_read_buffer, BUFFER_SIZE_MAX);
|
app_tp_s_read(s_phone_read_buffer, BUFFER_SIZE_MAX);
|
||||||
if (phone_write_buffer_size) //大于0表示需要答复手机,配置发送buffer
|
|
||||||
{
|
|
||||||
app_tp_s_write(phone_write_buffer, phone_write_buffer_size);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_phone_reset_on
|
* @name : app_tp_phone_reset_on
|
||||||
* @brief : 获取手机复位信号的状态
|
* @brief : 获取手机复位信号的状态
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
|
@ -703,7 +623,7 @@ bool app_tp_phone_reset_on(void)
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_phone_clear_reset_on
|
* @name : app_tp_phone_clear_reset_on
|
||||||
* @brief : 清除手机复位信号的状态
|
* @brief : 清除手机复位信号的状态
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
|
@ -750,10 +670,5 @@ void app_tp_s_write(const uint8_t *txbuffer, size_t buffer_size)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool app_tp_enter_sleep_on(void)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* File: app_tp_transfer.h
|
* File: app_tp_transfer.h
|
||||||
* Description touch I2C/SPI 通信相关函数申明
|
* Description touch I2C/SPI 通信相关函数申明
|
||||||
* Version V0.1
|
* Version V0.1
|
||||||
* Date 2021-10-14
|
* Date 2021-10-14
|
||||||
* Author zhanghz
|
* Author zhanghz
|
||||||
|
@ -14,12 +14,108 @@
|
||||||
#include "tau_device_datatype.h"
|
#include "tau_device_datatype.h"
|
||||||
#include "tau_common.h"
|
#include "tau_common.h"
|
||||||
|
|
||||||
#define SCREEN_TRANSFER_WRITE false //接收到screen io中断,发送数据之后不用读回
|
#define SCREEN_TRANSFER_WRITE false //接收到screen io中断,发送数据之后不用读回
|
||||||
#define SCREEN_TRANSFER_READ true //接收到screen io中断,发送数据之后要读回数据
|
#define SCREEN_TRANSFER_READ true //接收到screen io中断,发送数据之后要读回数据
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
I2C_ADDR_BITS_7 = 7,
|
||||||
|
I2C_ADDR_BITS_10 = 10
|
||||||
|
} en_I2C_ADDR_BITS_mdoe;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
data_num_00 = 0,
|
||||||
|
data_num_01,
|
||||||
|
data_num_02,
|
||||||
|
data_num_03,
|
||||||
|
data_num_04,
|
||||||
|
data_num_05,
|
||||||
|
data_num_06,
|
||||||
|
data_num_07,
|
||||||
|
data_num_08,
|
||||||
|
data_num_09,
|
||||||
|
data_num_10,
|
||||||
|
data_num_11,
|
||||||
|
data_num_12,
|
||||||
|
data_num_13,
|
||||||
|
data_num_14,
|
||||||
|
data_num_15,
|
||||||
|
data_num_16,
|
||||||
|
data_num_17,
|
||||||
|
data_num_18,
|
||||||
|
data_num_19,
|
||||||
|
data_num_20,
|
||||||
|
data_num_21,
|
||||||
|
data_num_22,
|
||||||
|
data_num_23,
|
||||||
|
data_num_24,
|
||||||
|
data_num_25,
|
||||||
|
data_num_26,
|
||||||
|
data_num_27,
|
||||||
|
data_num_28,
|
||||||
|
data_num_29,
|
||||||
|
data_num_30,
|
||||||
|
data_num_31,
|
||||||
|
data_num_32,
|
||||||
|
data_num_33,
|
||||||
|
data_num_34,
|
||||||
|
data_num_35,
|
||||||
|
data_num_36,
|
||||||
|
data_num_37,
|
||||||
|
data_num_38,
|
||||||
|
data_num_39,
|
||||||
|
data_num_40,
|
||||||
|
data_num_41,
|
||||||
|
data_num_42,
|
||||||
|
data_num_43,
|
||||||
|
data_num_44,
|
||||||
|
data_num_45,
|
||||||
|
data_num_46,
|
||||||
|
data_num_47,
|
||||||
|
data_num_48,
|
||||||
|
data_num_49
|
||||||
|
} en_data_num;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint8_t *buffer; //接收到screen io中断后,通信的发送buffer指针
|
||||||
|
size_t txbuffer_size; //发送 buffer 数据长度;需要读回时,目前只支持4个字节
|
||||||
|
size_t rxbuffer_size; //发送完数据之后,要读回的数据长度
|
||||||
|
bool read_flag; //true 接收到screen io中断,发送数据之后要读回数据
|
||||||
|
} st_screen_data;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
en_data_num data_num; //记录当前为第几个结构体数组元素
|
||||||
|
const uint8_t *buffer; //通信的发送buffer指针
|
||||||
|
size_t txbuffer_size; //发送 buffer 数据长度;需要读回时,目前只支持4个字节
|
||||||
|
size_t rxbuffer_size; //发送完数据之后,要读回的数据长度
|
||||||
|
bool read_flag; //true 接收到screen io中断,发送数据之后要读回数据
|
||||||
|
} st_screen_const_data;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint8_t reg_size; //接收buffer的个数
|
||||||
|
size_t write_back_size; //要发送的数据长度
|
||||||
|
const uint8_t *reg_data; //接收buffer
|
||||||
|
const uint8_t *write_back; //发送bufer
|
||||||
|
} st_reg_const_data;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint8_t reg_size; //接收buffer的个数
|
||||||
|
size_t write_back_size; //要发送的数据长度
|
||||||
|
const uint8_t *reg_data; //接收buffer
|
||||||
|
const uint8_t *write_back; //发送bufer
|
||||||
|
} st_reg_data;
|
||||||
|
|
||||||
|
extern bool s_screen_init_complate; //屏幕TP开机初始化完成标志
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_screen_init
|
* @name : app_tp_screen_init
|
||||||
* @brief : screen IO 跳变,开始初始化
|
* @brief : screen IO 跳变,开始初始化
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
|
@ -28,7 +124,7 @@ void app_tp_screen_init(void);
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_init
|
* @name : app_tp_init
|
||||||
* @brief : 初始化通信相关
|
* @brief : 初始化通信相关
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
|
@ -37,7 +133,7 @@ void app_tp_init(void);
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_transfer_screen_int
|
* @name : app_tp_transfer_screen_int
|
||||||
* @brief : 接收screen中断后,按照flow读写screen,即报点协议转换
|
* @brief : 接收screen中断后,按照flow读写screen,即报点协议转换
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
|
@ -46,7 +142,7 @@ void app_tp_transfer_screen_int(void);
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_transfer_screen_start
|
* @name : app_tp_transfer_screen_start
|
||||||
* @brief : 按照flow读写screen,开始开机初始化
|
* @brief : 按照flow读写screen,开始开机初始化
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
|
@ -55,7 +151,7 @@ void app_tp_transfer_screen_start(void);
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_phone_reset_on
|
* @name : app_tp_phone_reset_on
|
||||||
* @brief : 获取手机复位信号的状态
|
* @brief : 获取手机复位信号的状态
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
|
@ -64,7 +160,7 @@ bool app_tp_phone_reset_on(void);
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_phone_clear_reset_on
|
* @name : app_tp_phone_clear_reset_on
|
||||||
* @brief : 清除手机复位信号的状态
|
* @brief : 清除手机复位信号的状态
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
|
@ -73,9 +169,9 @@ void app_tp_phone_clear_reset_on(void);
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_s_write
|
* @name : app_tp_s_write
|
||||||
* @brief : 根据通信方式配置发送txbuffer中的数据
|
* @brief : 根据通信方式配置发送txbuffer中的数据
|
||||||
* @param[in] :txbuffer: 发送数据 buffer 头地址
|
* @param[in] :txbuffer: 发送数据 buffer 头地址
|
||||||
* @param[in] :buffer_size: 发送数据 buffer 长度
|
* @param[in] :buffer_size: 发送数据 buffer 长度
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
@ -83,7 +179,7 @@ void app_tp_s_write(const uint8_t *txbuffer, size_t buffer_size);
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : app_tp_enter_sleep_on
|
* @name : app_tp_enter_sleep_on
|
||||||
* @brief : 获取 tp 通信状态
|
* @brief : 获取 tp 通信状态
|
||||||
* @param[in] :
|
* @param[in] :
|
||||||
* @return :
|
* @return :
|
||||||
* @retval :
|
* @retval :
|
||||||
|
@ -92,6 +188,9 @@ bool app_tp_enter_sleep_on(void);
|
||||||
|
|
||||||
void app_tp_m_write(const uint8_t *txbuffer, size_t buffer_size);
|
void app_tp_m_write(const uint8_t *txbuffer, size_t buffer_size);
|
||||||
void app_tp_m_read(const uint8_t *cmd, size_t cmd_size, uint8_t *data_buffer, size_t data_size);
|
void app_tp_m_read(const uint8_t *cmd, size_t cmd_size, uint8_t *data_buffer, size_t data_size);
|
||||||
|
void app_tp_I2C_init(void);
|
||||||
|
void ap_tp_st_touch_get_status(void);
|
||||||
|
void app_tp_transfer_screen_start_init(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,8 @@
|
||||||
|
|
||||||
#if _DEMO_S8_EN
|
#if _DEMO_S8_EN
|
||||||
#include "ap_demo.h"
|
#include "ap_demo.h"
|
||||||
#include "app_tp_for_custom_s8.h"
|
#include "app_tp_for_custom_s21u.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if _DEMO_S8P_EN
|
#if _DEMO_S8P_EN
|
||||||
|
|
Loading…
Reference in New Issue