增加TP校准功能
This commit is contained in:
parent
3340d545a8
commit
c194a1b790
|
@ -50,7 +50,7 @@
|
||||||
<InvalidFlash>1</InvalidFlash>
|
<InvalidFlash>1</InvalidFlash>
|
||||||
</TargetStatus>
|
</TargetStatus>
|
||||||
<OutputDirectory>.\Objects\</OutputDirectory>
|
<OutputDirectory>.\Objects\</OutputDirectory>
|
||||||
<OutputName>ISP_568T_S21P_20230517</OutputName>
|
<OutputName>ISP_568T_S21P_20230628</OutputName>
|
||||||
<CreateExecutable>1</CreateExecutable>
|
<CreateExecutable>1</CreateExecutable>
|
||||||
<CreateLib>0</CreateLib>
|
<CreateLib>0</CreateLib>
|
||||||
<CreateHexFile>1</CreateHexFile>
|
<CreateHexFile>1</CreateHexFile>
|
||||||
|
@ -313,7 +313,7 @@
|
||||||
</ArmAdsMisc>
|
</ArmAdsMisc>
|
||||||
<Cads>
|
<Cads>
|
||||||
<interw>1</interw>
|
<interw>1</interw>
|
||||||
<Optim>1</Optim>
|
<Optim>2</Optim>
|
||||||
<oTime>0</oTime>
|
<oTime>0</oTime>
|
||||||
<SplitLS>0</SplitLS>
|
<SplitLS>0</SplitLS>
|
||||||
<OneElfS>1</OneElfS>
|
<OneElfS>1</OneElfS>
|
||||||
|
|
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
|
@ -1,5 +1,5 @@
|
||||||
; generated by Component: ARM Compiler 5.06 update 6 (build 750) Tool: ArmCC [4d3637]
|
; generated by Component: ARM Compiler 5.06 update 6 (build 750) Tool: ArmCC [4d3637]
|
||||||
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave --gnu -o.\objects\board.o --asm_dir=.\Listings\ --list_dir=.\Listings\ --depend=.\objects\board.d --cpu=Cortex-M0 --apcs=interwork -O0 --diag_suppress=9931 -I..\..\src -I..\..\src\board -I..\..\src\common -I..\..\src\sdk\include -I..\..\src\app\demo -I..\..\src\sdk\include\M0 -I..\..\src\app -I..\..\src\app\module_demo -I..\..\src\app\touch -I..\..\src\app\S8 -I..\..\src\app\S9 -I..\CVWL568 -I..\..\src\app\s21p -I.\RTE\_ISP_568T -IC:\Keil_v5\ARM\PACK\ARM\CMSIS\5.5.1\CMSIS\Core\Include -IC:\Keil_v5\ARM\PACK\ARM\CMSIS\5.5.1\Device\ARM\ARMCM0\Include -D__MICROLIB -D__UVISION_VERSION=528 -D_RTE_ -DARMCM0 -DISP_568 --omf_browse=.\objects\board.crf ..\..\src\board\board.c]
|
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave --gnu -o.\objects\board.o --asm_dir=.\Listings\ --list_dir=.\Listings\ --depend=.\objects\board.d --cpu=Cortex-M0 --apcs=interwork -O1 --diag_suppress=9931 -I..\..\src -I..\..\src\board -I..\..\src\common -I..\..\src\sdk\include -I..\..\src\app\demo -I..\..\src\sdk\include\M0 -I..\..\src\app -I..\..\src\app\module_demo -I..\..\src\app\touch -I..\..\src\app\S8 -I..\..\src\app\S9 -I..\CVWL568 -I..\..\src\app\s21p -I.\RTE\_ISP_568T -IC:\Users\55\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include -IC:\Users\55\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\Device\ARM\ARMCM0\Include -D__MICROLIB -D__UVISION_VERSION=528 -D_RTE_ -DARMCM0 -DISP_568 --omf_browse=.\objects\board.crf ..\..\src\board\board.c]
|
||||||
THUMB
|
THUMB
|
||||||
|
|
||||||
AREA ||i.board_Init||, CODE, READONLY, ALIGN=2
|
AREA ||i.board_Init||, CODE, READONLY, ALIGN=2
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
AREA ||.rev16_text||, CODE
|
AREA ||.rev16_text||, CODE
|
||||||
THUMB
|
THUMB
|
||||||
EXPORT |__asm___7_board_c_bcd01269____REV16|
|
EXPORT |__asm___7_board_c_bcd01269____REV16|
|
||||||
#line 467 "C:\\Keil_v5\\ARM\\PACK\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_armcc.h"
|
#line 467 "C:\\Users\\55\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_armcc.h"
|
||||||
|__asm___7_board_c_bcd01269____REV16| PROC
|
|__asm___7_board_c_bcd01269____REV16| PROC
|
||||||
#line 468
|
#line 468
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
; generated by Component: ARM Compiler 5.06 update 6 (build 750) Tool: ArmCC [4d3637]
|
; generated by Component: ARM Compiler 5.06 update 6 (build 750) Tool: ArmCC [4d3637]
|
||||||
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave --gnu -o.\objects\main.o --asm_dir=.\Listings\ --list_dir=.\Listings\ --depend=.\objects\main.d --cpu=Cortex-M0 --apcs=interwork -O0 --diag_suppress=9931 -I..\..\src -I..\..\src\board -I..\..\src\common -I..\..\src\sdk\include -I..\..\src\app\demo -I..\..\src\sdk\include\M0 -I..\..\src\app -I..\..\src\app\module_demo -I..\..\src\app\touch -I..\..\src\app\S8 -I..\..\src\app\S9 -I..\CVWL568 -I..\..\src\app\s21p -I.\RTE\_ISP_568T -IC:\Keil_v5\ARM\PACK\ARM\CMSIS\5.5.1\CMSIS\Core\Include -IC:\Keil_v5\ARM\PACK\ARM\CMSIS\5.5.1\Device\ARM\ARMCM0\Include -D__MICROLIB -D__UVISION_VERSION=528 -D_RTE_ -DARMCM0 -DISP_568 --omf_browse=.\objects\main.crf ..\..\src\app\main.c]
|
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave --gnu -o.\objects\main.o --asm_dir=.\Listings\ --list_dir=.\Listings\ --depend=.\objects\main.d --cpu=Cortex-M0 --apcs=interwork -O1 --diag_suppress=9931 -I..\..\src -I..\..\src\board -I..\..\src\common -I..\..\src\sdk\include -I..\..\src\app\demo -I..\..\src\sdk\include\M0 -I..\..\src\app -I..\..\src\app\module_demo -I..\..\src\app\touch -I..\..\src\app\S8 -I..\..\src\app\S9 -I..\CVWL568 -I..\..\src\app\s21p -I.\RTE\_ISP_568T -IC:\Users\55\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include -IC:\Users\55\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\Device\ARM\ARMCM0\Include -D__MICROLIB -D__UVISION_VERSION=528 -D_RTE_ -DARMCM0 -DISP_568 --omf_browse=.\objects\main.crf ..\..\src\app\main.c]
|
||||||
THUMB
|
THUMB
|
||||||
|
|
||||||
AREA ||i.main||, CODE, READONLY, ALIGN=1
|
AREA ||i.main||, CODE, READONLY, ALIGN=1
|
||||||
|
@ -12,8 +12,6 @@
|
||||||
;;;11 board_Init();
|
;;;11 board_Init();
|
||||||
;;;12
|
;;;12
|
||||||
;;;13 while (1)
|
;;;13 while (1)
|
||||||
000004 e003 B |L1.14|
|
|
||||||
|L1.6|
|
|
||||||
;;;14 {
|
;;;14 {
|
||||||
;;;15 #if _DEMO_DSI_TX_EN
|
;;;15 #if _DEMO_DSI_TX_EN
|
||||||
;;;16 demo_dsi_tx_case();
|
;;;16 demo_dsi_tx_case();
|
||||||
|
@ -59,14 +57,11 @@
|
||||||
;;;56
|
;;;56
|
||||||
;;;57 #if _DEMO_S21P_EN
|
;;;57 #if _DEMO_S21P_EN
|
||||||
;;;58 S21P_demo();
|
;;;58 S21P_demo();
|
||||||
000006 f7fffffe BL S21P_demo
|
000004 f7fffffe BL S21P_demo
|
||||||
|
|L1.8|
|
||||||
;;;59 #endif
|
;;;59 #endif
|
||||||
;;;60 while (1);
|
;;;60 while (1);
|
||||||
00000a bf00 NOP
|
000008 e7fe B |L1.8|
|
||||||
|L1.12|
|
|
||||||
00000c e7fe B |L1.12|
|
|
||||||
|L1.14|
|
|
||||||
00000e e7fa B |L1.6|
|
|
||||||
;;;61 }
|
;;;61 }
|
||||||
;;;62 }
|
;;;62 }
|
||||||
ENDP
|
ENDP
|
||||||
|
@ -78,7 +73,7 @@
|
||||||
AREA ||.rev16_text||, CODE
|
AREA ||.rev16_text||, CODE
|
||||||
THUMB
|
THUMB
|
||||||
EXPORT |__asm___6_main_c_main____REV16|
|
EXPORT |__asm___6_main_c_main____REV16|
|
||||||
#line 467 "C:\\Keil_v5\\ARM\\PACK\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_armcc.h"
|
#line 467 "C:\\Users\\55\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_armcc.h"
|
||||||
|__asm___6_main_c_main____REV16| PROC
|
|__asm___6_main_c_main____REV16| PROC
|
||||||
#line 468
|
#line 468
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -115,16 +115,20 @@
|
||||||
#define g_swire_num 40
|
#define g_swire_num 40
|
||||||
#define SWIRE_MAX_NUM 10
|
#define SWIRE_MAX_NUM 10
|
||||||
|
|
||||||
|
#define AUTO_CAL_TP 0
|
||||||
|
#define RUN_TEST 0
|
||||||
|
|
||||||
|
#if AUTO_CAL_TP
|
||||||
|
static uint16_t g_cal_cnt = 300; //3s倒计时进入TP校准
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
RX Filter 1~3 数字越大,水波纹会大一些,边缘锯齿会增加,但是字体会更清晰
|
RX Filter 1~3 数字越大,水波纹会大一些,边缘锯齿会增加,但是字体会更清晰
|
||||||
TX Filter 1~3 值越大字体越清晰,但是字体边缘锯齿会增加,值越小字体越模糊,但边缘锯齿越小,对水波纹没有大影响
|
TX Filter 1~3 值越大字体越清晰,但是字体边缘锯齿会增加,值越小字体越模糊,但边缘锯齿越小,对水波纹没有大影响
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint32_t s_heartbeat = 0;
|
uint32_t s_heartbeat = 0;
|
||||||
|
|
||||||
#if ENABLE_TP_WAKE_UP
|
#if ENABLE_TP_WAKE_UP
|
||||||
static bool g_need_enter_sleep_mode = false;
|
static bool g_need_enter_sleep_mode = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/******************************************************/
|
/******************************************************/
|
||||||
|
@ -135,6 +139,8 @@ static hal_dsi_tx_ctrl_handle_t* g_tx_ctrl_handle = NULL;
|
||||||
static volatile bool start_display_on = true;
|
static volatile bool start_display_on = true;
|
||||||
/* 屏初始化完成标志位 */
|
/* 屏初始化完成标志位 */
|
||||||
static bool panel_display_done = true;
|
static bool panel_display_done = true;
|
||||||
|
static bool g_exit_sleep_mode = false;
|
||||||
|
extern volatile bool s_calibration_flag;
|
||||||
|
|
||||||
uint8_t s_swire_pwm_counter = 0;
|
uint8_t s_swire_pwm_counter = 0;
|
||||||
|
|
||||||
|
@ -147,13 +153,13 @@ static void soft_swire_init(void);
|
||||||
|
|
||||||
#if ENABLE_TP_WAKE_UP
|
#if ENABLE_TP_WAKE_UP
|
||||||
|
|
||||||
static void ap_reset_cb(void *data)
|
static void ap_reset_cb(void* data)
|
||||||
{
|
{
|
||||||
/* 切换电源 */
|
/* 切换电源 */
|
||||||
// hal_gpio_set_output_data_ex(POWER_IO_B, IO_LVL_HIGH, POWER_IO_A, IO_LVL_LOW);
|
// hal_gpio_set_output_data_ex(POWER_IO_B, IO_LVL_HIGH, POWER_IO_A, IO_LVL_LOW);
|
||||||
// hal_gpio_set_output_data(POWER_IO_A, IO_LVL_LOW);//
|
// hal_gpio_set_output_data(POWER_IO_A, IO_LVL_LOW);//
|
||||||
/* 打开VCC供电 */
|
/* 打开VCC供电 */
|
||||||
TAU_LOGD("disable reset!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
TAU_LOGD("disable reset!!!!!!!!!!!!!");
|
||||||
hal_system_set_pvd(true);
|
hal_system_set_pvd(true);
|
||||||
hal_system_set_vcc(true);
|
hal_system_set_vcc(true);
|
||||||
NVIC_SystemReset();
|
NVIC_SystemReset();
|
||||||
|
@ -1235,9 +1241,9 @@ static bool ap_dcs_read(uint8_t data_type, uint8_t dcs_cmd, uint8_t param)
|
||||||
TAU_LOGD("resp error [%d]!\n", return_size);
|
TAU_LOGD("resp error [%d]!\n", return_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (dcs_cmd == 0x01)
|
else if(dcs_cmd == 0x01)
|
||||||
{
|
{
|
||||||
ap_get_tp_calibration_status_01(g_rx_ctrl_handle,param);
|
ap_get_tp_calibration_status_01(g_rx_ctrl_handle, param);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1262,6 +1268,7 @@ static bool pps_update_handle(uint8_t* pps, uint8_t size, uint32_t pic_width, ui
|
||||||
hal_dsi_rx_ctrl_toggle_resolution(g_rx_ctrl_handle);
|
hal_dsi_rx_ctrl_toggle_resolution(g_rx_ctrl_handle);
|
||||||
// TAU_LOGD("resolution update w[%d] h[%d] compress[%d]\n", pic_width, pic_height, g_rx_ctrl_handle->compress_en);
|
// TAU_LOGD("resolution update w[%d] h[%d] compress[%d]\n", pic_width, pic_height, g_rx_ctrl_handle->compress_en);
|
||||||
}
|
}
|
||||||
|
g_exit_sleep_mode = true;
|
||||||
TAU_LOGD("PPS Update\n");
|
TAU_LOGD("PPS Update\n");
|
||||||
// hal_dsi_rx_ctrl_set_hw_tear_mode(g_rx_ctrl_handle);
|
// hal_dsi_rx_ctrl_set_hw_tear_mode(g_rx_ctrl_handle);
|
||||||
return true;
|
return true;
|
||||||
|
@ -1282,7 +1289,7 @@ static bool ap_set_display_off(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_packet
|
||||||
hal_dsi_tx_ctrl_write_cmd(0x29, 0, 3, 0x51, 0x00, 0x00);
|
hal_dsi_tx_ctrl_write_cmd(0x29, 0, 3, 0x51, 0x00, 0x00);
|
||||||
delayMs(10);
|
delayMs(10);
|
||||||
hal_dsi_tx_ctrl_write_cmd(0x05, 0, 2, 0x28);
|
hal_dsi_tx_ctrl_write_cmd(0x05, 0, 2, 0x28);
|
||||||
// delayMs(50);
|
// delayMs(50);
|
||||||
hal_gpio_set_output_data(IO_PAD_ADCIN, IO_LVL_LOW);
|
hal_gpio_set_output_data(IO_PAD_ADCIN, IO_LVL_LOW);
|
||||||
|
|
||||||
hal_dsi_tx_ctrl_write_cmd(0x05, 0, 2, 0x10);
|
hal_dsi_tx_ctrl_write_cmd(0x05, 0, 2, 0x10);
|
||||||
|
@ -1297,7 +1304,7 @@ static bool ap_set_display_off(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_packet
|
||||||
|
|
||||||
static bool ap_set_enter_sleep_mode(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_packet_t* dcs_packet)
|
static bool ap_set_enter_sleep_mode(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_packet_t* dcs_packet)
|
||||||
{
|
{
|
||||||
/* hal_dsi_rx_ctrl_set_sw_tear_mode(g_rx_ctrl_handle);
|
/* hal_dsi_rx_ctrl_set_sw_tear_mode(g_rx_ctrl_handle);
|
||||||
hal_dsi_tx_ctrl_write_cmd(0x29, 0, 3, 0x51, 0x00, 0x00);
|
hal_dsi_tx_ctrl_write_cmd(0x29, 0, 3, 0x51, 0x00, 0x00);
|
||||||
delayMs(10);
|
delayMs(10);
|
||||||
hal_dsi_tx_ctrl_write_cmd(0x05, 0, 2, 0x28);
|
hal_dsi_tx_ctrl_write_cmd(0x05, 0, 2, 0x28);
|
||||||
|
@ -1307,39 +1314,25 @@ static bool ap_set_enter_sleep_mode(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_p
|
||||||
hal_dsi_tx_ctrl_write_cmd(0x05, 0, 2, 0x10);
|
hal_dsi_tx_ctrl_write_cmd(0x05, 0, 2, 0x10);
|
||||||
delayMs(50);
|
delayMs(50);
|
||||||
hal_gpio_set_output_data(IO_PAD_PWMEN, IO_LVL_LOW);
|
hal_gpio_set_output_data(IO_PAD_PWMEN, IO_LVL_LOW);
|
||||||
#if ENABLE_TP_WAKE_UP
|
#if ENABLE_TP_WAKE_UP
|
||||||
g_need_enter_sleep_mode = true;
|
g_need_enter_sleep_mode = true;
|
||||||
#endif
|
#endif
|
||||||
*/
|
*/
|
||||||
TAU_LOGD("enter sleep mode");
|
TAU_LOGD("enter sleep mode");
|
||||||
|
g_exit_sleep_mode = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ap_set_exit_sleep_mode(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_packet_t* dcs_packet)
|
static bool ap_set_exit_sleep_mode(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_packet_t* dcs_packet)
|
||||||
{
|
{
|
||||||
TAU_LOGD("enter exit sleep mode\n");
|
TAU_LOGD("enter exit sleep mode\n");
|
||||||
|
g_exit_sleep_mode = true;
|
||||||
/* AVDD 上电, 用于解决息屏开屏PPS不更新问题 */
|
/* AVDD 上电, 用于解决息屏开屏PPS不更新问题 */
|
||||||
// hal_gpio_set_output_data(IO_PAD_PWMEN, IO_LVL_HIGH);
|
// hal_gpio_set_output_data(IO_PAD_PWMEN, IO_LVL_HIGH);
|
||||||
// hal_gpio_set_output_data(IO_PAD_ADCIN, IO_LVL_HIGH);
|
// hal_gpio_set_output_data(IO_PAD_ADCIN, IO_LVL_HIGH);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ap_set_tear_on(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_packet_t* dcs_packet)
|
|
||||||
{
|
|
||||||
if(panel_display_done == true)
|
|
||||||
{
|
|
||||||
hal_dsi_rx_ctrl_set_hw_tear_mode(g_rx_ctrl_handle);
|
|
||||||
TAU_LOGD("hw te\n");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//soft_te_timer_init();
|
|
||||||
hal_dsi_rx_ctrl_set_sw_tear_mode(g_rx_ctrl_handle);
|
|
||||||
hal_dsi_rx_ctrl_gen_a_tear_signal(g_rx_ctrl_handle);
|
|
||||||
TAU_LOGD("sw gen te\n");
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
static bool ap_update_frame_rate(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_packet_t* dcs_packet)
|
static bool ap_update_frame_rate(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_packet_t* dcs_packet)
|
||||||
{
|
{
|
||||||
static uint8_t frame_rate = 100;
|
static uint8_t frame_rate = 100;
|
||||||
|
@ -1402,7 +1395,7 @@ static bool ap_set_hbm_53(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_packet_t* d
|
||||||
{
|
{
|
||||||
g_tp_sleep_in = false;
|
g_tp_sleep_in = false;
|
||||||
}
|
}
|
||||||
TAU_LOGD("53:[%2x]", dcs_packet->packet_param[0]);
|
// TAU_LOGD("53:[%2x]", dcs_packet->packet_param[0]);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1517,7 +1510,8 @@ static void send_panel_init_code(uint32_t size, uint8_t* data)
|
||||||
//#define USE_PARAS_OLED_HD_1101
|
//#define USE_PARAS_OLED_HD_1101
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
const uint8_t panel_init_code[] = {
|
const uint8_t panel_init_code[] =
|
||||||
|
{
|
||||||
|
|
||||||
#if 1 //S21P ICNA3511
|
#if 1 //S21P ICNA3511
|
||||||
0x29, 0, 3, 0x9C, 0xA5, 0xA5,
|
0x29, 0, 3, 0x9C, 0xA5, 0xA5,
|
||||||
|
@ -3539,7 +3533,7 @@ static void init_panel(void)
|
||||||
/* reset panel*/
|
/* reset panel*/
|
||||||
tx_panel_reset();
|
tx_panel_reset();
|
||||||
|
|
||||||
hal_gpio_init_output(IO_PAD_TD_LEDPWM, IO_LVL_HIGH);
|
hal_gpio_init_output(IO_PAD_TD_LEDPWM, IO_LVL_LOW);
|
||||||
|
|
||||||
/* enter send initial code mode*/
|
/* enter send initial code mode*/
|
||||||
hal_dsi_tx_ctrl_enter_init_panel_mode();
|
hal_dsi_tx_ctrl_enter_init_panel_mode();
|
||||||
|
@ -3568,10 +3562,10 @@ static void init_panel(void)
|
||||||
delayMs(10);
|
delayMs(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void frame_start_cb(hal_rx_dbg_event_e event)
|
//static void frame_start_cb(hal_rx_dbg_event_e event)
|
||||||
{
|
//{
|
||||||
TAU_LOGD("frame start\n");
|
// TAU_LOGD("frame start\n");
|
||||||
}
|
//}
|
||||||
|
|
||||||
static void open_mipi_rx(void)
|
static void open_mipi_rx(void)
|
||||||
{
|
{
|
||||||
|
@ -3675,33 +3669,6 @@ static void tx_display_on(void)
|
||||||
delayMs(20);
|
delayMs(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void swire_timer_callback(void* data)
|
|
||||||
{
|
|
||||||
hal_swire_start(12, 12, 12, 12, 36);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void swire_callback(void* data)
|
|
||||||
{
|
|
||||||
/* swire 的是否需要一直发送需要根据手机定,不同手机不同 */
|
|
||||||
//if(start_display_on == false)
|
|
||||||
{
|
|
||||||
hal_timer_start(SWIRE_TIMER, 16, swire_timer_callback, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* swire 初始化,通过 hal_swire_start 调整波形, 这里在循坏一直发送 */
|
|
||||||
static void swire_init()
|
|
||||||
{
|
|
||||||
hal_swire_open(DISABLE);
|
|
||||||
hal_swire_init();
|
|
||||||
/* swire 波形发生完成后回调函数 */
|
|
||||||
hal_swire_register_callback(swire_callback);
|
|
||||||
hal_swire_open(ENABLE);
|
|
||||||
hal_swire_start(12, 12, 12, 12, 36);
|
|
||||||
hal_timer_init(SWIRE_TIMER);
|
|
||||||
hal_timer_start(SWIRE_TIMER, 16, swire_timer_callback, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void soft_swire_start(uint8_t pulse)
|
static void soft_swire_start(uint8_t pulse)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
|
@ -3710,12 +3677,13 @@ static void soft_swire_start(uint8_t pulse)
|
||||||
delayUs(10);
|
delayUs(10);
|
||||||
hal_gpio_init_output(IO_PAD_ADCIN, IO_LVL_HIGH); // 3us
|
hal_gpio_init_output(IO_PAD_ADCIN, IO_LVL_HIGH); // 3us
|
||||||
delayUs(10);
|
delayUs(10);
|
||||||
}while(pulse--);
|
}
|
||||||
|
while(pulse--);
|
||||||
}
|
}
|
||||||
static void soft_swire_timer_callback(void *data)
|
static void soft_swire_timer_callback(void* data)
|
||||||
{
|
{
|
||||||
s_swire_pwm_counter++;
|
s_swire_pwm_counter++;
|
||||||
if( s_swire_pwm_counter < SWIRE_MAX_NUM )
|
if(s_swire_pwm_counter < SWIRE_MAX_NUM)
|
||||||
{
|
{
|
||||||
soft_swire_start(g_swire_num);
|
soft_swire_start(g_swire_num);
|
||||||
hal_timer_start(SWIRE_TIMER, 16, soft_swire_timer_callback, NULL);
|
hal_timer_start(SWIRE_TIMER, 16, soft_swire_timer_callback, NULL);
|
||||||
|
@ -3754,17 +3722,17 @@ static void soft_te_timer_cb(void* data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void soft_te_timer_init()
|
//static void soft_te_timer_init()
|
||||||
{
|
//{
|
||||||
TAU_LOGD("soft_te_timer_init\n");
|
// TAU_LOGD("soft_te_timer_init\n");
|
||||||
hal_dsi_rx_ctrl_set_sw_tear_mode(g_rx_ctrl_handle);
|
// hal_dsi_rx_ctrl_set_sw_tear_mode(g_rx_ctrl_handle);
|
||||||
hal_timer_init(TE_TIMER);
|
// hal_timer_init(TE_TIMER);
|
||||||
hal_timer_start(TE_TIMER, 1, soft_te_timer_cb, NULL);
|
// hal_timer_start(TE_TIMER, 1, soft_te_timer_cb, NULL);
|
||||||
}
|
//}
|
||||||
|
|
||||||
void tp_heartbeat_exec(void)
|
void tp_heartbeat_exec(void)
|
||||||
{
|
{
|
||||||
if (s_screen_init_complate)
|
if(s_screen_init_complate)
|
||||||
{
|
{
|
||||||
if(hal_gpio_get_input_data(IO_PAD_TD_INT))
|
if(hal_gpio_get_input_data(IO_PAD_TD_INT))
|
||||||
{
|
{
|
||||||
|
@ -3772,10 +3740,11 @@ void tp_heartbeat_exec(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(s_heartbeat < (65536/50)) // 65536*3 = 900ms 65536/50 = 6ms
|
if(s_heartbeat < (65536 / 50)) // 65536*3 = 900ms 65536/50 = 6ms
|
||||||
{
|
{
|
||||||
s_heartbeat ++;
|
s_heartbeat ++;
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
TAU_LOGD("hb...");
|
TAU_LOGD("hb...");
|
||||||
s_heartbeat = 0;
|
s_heartbeat = 0;
|
||||||
|
@ -3786,11 +3755,25 @@ void tp_heartbeat_exec(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ADD_TIMER3_FUNCTION
|
#ifdef ADD_TIMER3_FUNCTION
|
||||||
static void soft_timer3_cb(void *data)
|
static void soft_timer3_cb(void* data)
|
||||||
{
|
{
|
||||||
hal_timer_start(TIMER_NUM3, 10, soft_timer3_cb, NULL);
|
hal_timer_start(TIMER_NUM3, 10, soft_timer3_cb, NULL);
|
||||||
g_tp_sleep_delay_count++;
|
g_tp_sleep_delay_count++;
|
||||||
|
|
||||||
|
#if AUTO_CAL_TP
|
||||||
|
if(g_exit_sleep_mode)
|
||||||
|
{
|
||||||
|
if(g_cal_cnt > 0)
|
||||||
|
{
|
||||||
|
g_cal_cnt--;
|
||||||
|
if(g_cal_cnt == 0)
|
||||||
|
{
|
||||||
|
s_calibration_flag = true;
|
||||||
|
TAU_LOGD("Start cal tp!\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3841,6 +3824,8 @@ void S21P_demo(void)
|
||||||
{
|
{
|
||||||
/* 等待 AP TP 上电*/
|
/* 等待 AP TP 上电*/
|
||||||
if(start_display_on == true)
|
if(start_display_on == true)
|
||||||
|
{
|
||||||
|
if(g_exit_sleep_mode)
|
||||||
{
|
{
|
||||||
/* 屏初始化 */
|
/* 屏初始化 */
|
||||||
tx_display_on();
|
tx_display_on();
|
||||||
|
@ -3848,27 +3833,28 @@ void S21P_demo(void)
|
||||||
|
|
||||||
start_display_on = false;
|
start_display_on = false;
|
||||||
panel_display_done = true;
|
panel_display_done = true;
|
||||||
#if ENABLE_TP_WAKE_UP//将启动中断放这里的原因是当开机时,复位会有一个连续拉低拉高(70ms)的过程,为了区分开机和待机,所以将中断启动放这里大于70ms,使得复位连续第二次拉高时不识别
|
#if ENABLE_TP_WAKE_UP//将启动中断放这里的原因是当开机时,复位会有一个连续拉低拉高(70ms)的过程,为了区分开机和待机,所以将中断启动放这里大于70ms,使得复位连续第二次拉高时不识别
|
||||||
hal_gpio_set_ap_reset_int(ENABLE, ap_reset_cb, DETECT_RISING_EDGE);
|
hal_gpio_set_ap_reset_int(ENABLE, ap_reset_cb, DETECT_RISING_EDGE);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* 与屏的TP 模块通讯并初始化 */
|
/* 与屏的TP 模块通讯并初始化 */
|
||||||
app_tp_transfer_screen_int();
|
app_tp_transfer_screen_int();
|
||||||
|
|
||||||
// tp_heartbeat_exec();
|
tp_heartbeat_exec();
|
||||||
// app_tp_calibration_exec();
|
app_tp_calibration_exec();
|
||||||
// ap_tp_st_touch_scan_point_record_event_exec();
|
ap_tp_st_touch_scan_point_record_event_exec();
|
||||||
|
|
||||||
while(hal_dsi_rx_ctrl_dsc_async_handler(g_rx_ctrl_handle))
|
while(hal_dsi_rx_ctrl_dsc_async_handler(g_rx_ctrl_handle))
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_TP_WAKE_UP
|
#if ENABLE_TP_WAKE_UP
|
||||||
if (g_need_enter_sleep_mode)
|
if(g_need_enter_sleep_mode)
|
||||||
{
|
{
|
||||||
// g_mipi_path_off = true;
|
// g_mipi_path_off = true;
|
||||||
// hal_gpio_set_output_data(IO_PAD_TD_LEDPWM, IO_LVL_HIGH);
|
// hal_gpio_set_output_data(IO_PAD_TD_LEDPWM, IO_LVL_HIGH);
|
||||||
/* FIXME stop more model */
|
/* FIXME stop more model */
|
||||||
hal_dsi_tx_ctrl_stop(g_tx_ctrl_handle);
|
hal_dsi_tx_ctrl_stop(g_tx_ctrl_handle);
|
||||||
hal_dsi_tx_ctrl_deinit(g_tx_ctrl_handle);
|
hal_dsi_tx_ctrl_deinit(g_tx_ctrl_handle);
|
||||||
|
@ -3883,11 +3869,19 @@ void S21P_demo(void)
|
||||||
//hal_gpio_init_output(IO_PAD_TD_TPRSTN, IO_LVL_LOW);
|
//hal_gpio_init_output(IO_PAD_TD_TPRSTN, IO_LVL_LOW);
|
||||||
// hal_system_set_vcc(false); //关VCC有屏唤不醒
|
// hal_system_set_vcc(false); //关VCC有屏唤不醒
|
||||||
// hal_system_set_pvd(false); //
|
// hal_system_set_pvd(false); //
|
||||||
|
hal_gpio_set_output_data(IO_PAD_TD_LEDPWM, IO_LVL_HIGH);
|
||||||
TAU_LOGD("disable video path \n");
|
TAU_LOGD("disable video path \n");
|
||||||
g_need_enter_sleep_mode = false;
|
g_need_enter_sleep_mode = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if RUN_TEST
|
||||||
|
static uint32_t test_cnt = 0;
|
||||||
|
if(test_cnt++ > 0x1fffff)
|
||||||
|
{
|
||||||
|
test_cnt = 0;
|
||||||
|
TAU_LOGD("System run 1...");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
/* enter idle mode*/
|
/* enter idle mode*/
|
||||||
//hal_system_idle_mode(true);
|
//hal_system_idle_mode(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -545,7 +545,7 @@ uint8_t app_tp_screen_analysis_int(uint8_t transfer_now, uint8_t *rxbuffer, size
|
||||||
|
|
||||||
Touch.Event_Single_Flag = 1;
|
Touch.Event_Single_Flag = 1;
|
||||||
// phone_reg_coord_BUF_NUM = 0;
|
// phone_reg_coord_BUF_NUM = 0;
|
||||||
TAU_LOGD("TP [%d]\n", g_tp_sleep_in);
|
// TAU_LOGD("TP [%d]\n", g_tp_sleep_in);
|
||||||
|
|
||||||
if (g_tp_sleep_in == false)
|
if (g_tp_sleep_in == false)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,30 +21,31 @@
|
||||||
#include "hal_spi_master.h"
|
#include "hal_spi_master.h"
|
||||||
#include "hal_spi_slave.h"
|
#include "hal_spi_slave.h"
|
||||||
#include "tau_log.h"
|
#include "tau_log.h"
|
||||||
|
#include "tau_delay.h"
|
||||||
#include "app_tp_st_touch.h"
|
#include "app_tp_st_touch.h"
|
||||||
|
|
||||||
#define ST_TP_CALIBRATION_SUCCESS 0x5A // 校准成功标志
|
#define ST_TP_CALIBRATION_SUCCESS 0x5A // 校准成功标志
|
||||||
|
|
||||||
static volatile bool s_calibration_flag = false;
|
volatile bool s_calibration_flag = false;
|
||||||
static volatile uint8_t s_calibration_correct_flag = false;
|
static volatile uint8_t s_calibration_correct_flag = false;
|
||||||
|
|
||||||
st_tp_scan_data tp_scan_data;
|
st_tp_scan_data tp_scan_data;
|
||||||
|
|
||||||
uint8_t st_touch_init_sensor_off[3] = {0xA0,0x00,0x00}; //2 sensor OFF
|
uint8_t st_touch_init_sensor_off[3] = {0xA0, 0x00, 0x00}; //2 sensor OFF
|
||||||
uint8_t st_touch_init_sensor_on[3] = {0xA0,0x00,0x01}; //2 sensor on
|
uint8_t st_touch_init_sensor_on[3] = {0xA0, 0x00, 0x01}; //2 sensor on
|
||||||
|
|
||||||
|
|
||||||
uint8_t st_touch_tp_tuning_reset[3] = {0xA4,0x00,0x00}; // 3 System Reset
|
uint8_t st_touch_tp_tuning_reset[3] = {0xA4, 0x00, 0x00}; // 3 System Reset
|
||||||
uint8_t st_touch_tp_tuning_FpnlInit[3] = {0xA4,0x00,0x03}; // FPnl Init
|
uint8_t st_touch_tp_tuning_FpnlInit[3] = {0xA4, 0x00, 0x03}; // FPnl Init
|
||||||
uint8_t st_touch_tp_tuning_PnlInit[3] = {0xA4,0x00,0x02}; // Pnl Init
|
uint8_t st_touch_tp_tuning_PnlInit[3] = {0xA4, 0x00, 0x02}; // Pnl Init
|
||||||
uint8_t st_touch_tp_tuning_TuneM[4] = {0xA4,0x03,0x13,0x00}; // TuneM
|
uint8_t st_touch_tp_tuning_TuneM[4] = {0xA4, 0x03, 0x13, 0x00}; // TuneM
|
||||||
uint8_t st_touch_tp_tuning_TuneS[4] = {0xA4,0x03,0x0C,0x00}; // TuneS
|
uint8_t st_touch_tp_tuning_TuneS[4] = {0xA4, 0x03, 0x0C, 0x00}; // TuneS
|
||||||
uint8_t st_touch_tp_tuning_SvCfg[3] = {0xA4,0x05,0x01}; // SvCfg
|
uint8_t st_touch_tp_tuning_SvCfg[3] = {0xA4, 0x05, 0x01}; // SvCfg
|
||||||
uint8_t st_touch_tp_tuning_SvCx[3] = {0xA4,0x05,0x02}; // SvCx
|
uint8_t st_touch_tp_tuning_SvCx[3] = {0xA4, 0x05, 0x02}; // SvCx
|
||||||
uint8_t st_touch_tp_tuning_SvPnl[3] = {0xA4,0x05,0x04}; // SvPnl
|
uint8_t st_touch_tp_tuning_SvPnl[3] = {0xA4, 0x05, 0x04}; // SvPnl
|
||||||
uint8_t st_touch_tp_tuning_clearfifo[3] = {0xA4,0x00,0x01}; // 1 clear fifo
|
uint8_t st_touch_tp_tuning_clearfifo[3] = {0xA4, 0x00, 0x01}; // 1 clear fifo
|
||||||
|
|
||||||
uint8_t st_touch_tp_tuning_clkreset[3] = {0xA4,0x00,0x05}; // clk reset
|
uint8_t st_touch_tp_tuning_clkreset[3] = {0xA4, 0x00, 0x05}; // clk reset
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* @name : ap_tp_st_touch_get_calibration_success_mark
|
* @name : ap_tp_st_touch_get_calibration_success_mark
|
||||||
|
@ -56,8 +57,8 @@ uint8_t st_touch_tp_tuning_clkreset[3] = {0xA4,0x00,0x05}; // clk reset
|
||||||
|
|
||||||
void ap_tp_st_touch_get_calibration_success_mark(void)
|
void ap_tp_st_touch_get_calibration_success_mark(void)
|
||||||
{
|
{
|
||||||
uint8_t cali_send_buff[6] = {0xFA,0x20,0x01,0x00,0x00,0x00};
|
uint8_t cali_send_buff[6] = {0xFA, 0x20, 0x01, 0x00, 0x00, 0x00};
|
||||||
uint8_t cali_send_buff1[3] = {0xA4,0x06,0x01};
|
uint8_t cali_send_buff1[3] = {0xA4, 0x06, 0x01};
|
||||||
uint8_t cali_read_buff[40] = {0};
|
uint8_t cali_read_buff[40] = {0};
|
||||||
uint8_t i = 0;
|
uint8_t i = 0;
|
||||||
|
|
||||||
|
@ -84,12 +85,12 @@ void ap_tp_st_touch_get_calibration_success_mark(void)
|
||||||
{
|
{
|
||||||
s_calibration_correct_flag = 0x00; // 校准失败
|
s_calibration_correct_flag = 0x00; // 校准失败
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
for(i=0;i<32;i++)
|
for(i=0;i<32;i++)
|
||||||
{
|
{
|
||||||
printf("%02x ",cali_read_buff[i]);
|
printf("%02x ",cali_read_buff[i]);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -142,13 +143,13 @@ const unsigned short wCRCTalbeAbs[] =
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
unsigned short CRC16_2(unsigned char *pchMsg, unsigned short wDataLen)
|
unsigned short CRC16_2(unsigned char* pchMsg, unsigned short wDataLen)
|
||||||
{
|
{
|
||||||
unsigned short wCRC = 0xFFFF;
|
unsigned short wCRC = 0xFFFF;
|
||||||
unsigned short i;
|
unsigned short i;
|
||||||
unsigned char chChar;
|
unsigned char chChar;
|
||||||
|
|
||||||
for (i = 0; i < wDataLen; i++)
|
for(i = 0; i < wDataLen; i++)
|
||||||
{
|
{
|
||||||
chChar = *pchMsg++;
|
chChar = *pchMsg++;
|
||||||
wCRC = wCRCTalbeAbs[(chChar ^ wCRC) & 15] ^ (wCRC >> 4);
|
wCRC = wCRCTalbeAbs[(chChar ^ wCRC) & 15] ^ (wCRC >> 4);
|
||||||
|
@ -166,21 +167,21 @@ unsigned short CRC16_2(unsigned char *pchMsg, unsigned short wDataLen)
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
bool ap_set_tp_calibration_04(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
|
bool ap_set_tp_calibration_04(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_packet_t* dcs_packet)
|
||||||
{
|
{
|
||||||
uint8_t i,crch,crcl,command,param[30] = {0};
|
uint8_t i, crch, crcl, command, param[30] = {0};
|
||||||
unsigned short crc;
|
unsigned short crc;
|
||||||
|
|
||||||
// 计算CRC值
|
// 计算CRC值
|
||||||
for(i=0;i<dcs_packet->param_length;i++)
|
for(i = 0; i < dcs_packet->param_length; i++)
|
||||||
{
|
{
|
||||||
param[i+1] = dcs_packet->packet_param[i];
|
param[i + 1] = dcs_packet->packet_param[i];
|
||||||
printf("%02x ",dcs_packet->packet_param[i]);
|
// printf("%02x ",dcs_packet->packet_param[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
param[0] = 0x04;
|
param[0] = 0x04;
|
||||||
crc = CRC16_2(param,dcs_packet->param_length-1);
|
crc = CRC16_2(param, dcs_packet->param_length - 1);
|
||||||
crch = (crc>>8);
|
crch = (crc >> 8);
|
||||||
crcl = crc;
|
crcl = crc;
|
||||||
|
|
||||||
// CRC校验判断
|
// CRC校验判断
|
||||||
|
@ -190,7 +191,7 @@ bool ap_set_tp_calibration_04(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_
|
||||||
switch(command)
|
switch(command)
|
||||||
{
|
{
|
||||||
case CMD_TP_CABLIBRATION: // Touch校准
|
case CMD_TP_CABLIBRATION: // Touch校准
|
||||||
if( (param[4] == 0x01) && (param[5] == 0x01) && (param[6] == 0x01) )
|
if((param[4] == 0x01) && (param[5] == 0x01) && (param[6] == 0x01))
|
||||||
{
|
{
|
||||||
s_calibration_flag = true;
|
s_calibration_flag = true;
|
||||||
s_calibration_correct_flag = false;
|
s_calibration_correct_flag = false;
|
||||||
|
@ -231,12 +232,12 @@ bool ap_set_tp_calibration_04(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_
|
||||||
}
|
}
|
||||||
|
|
||||||
// 兼容旧版本tp calibration
|
// 兼容旧版本tp calibration
|
||||||
if( (dcs_packet->packet_param[0] == 0x01) && (dcs_packet->packet_param[1] == 0x01) && (dcs_packet->packet_param[2] == 0x01) )
|
if((dcs_packet->packet_param[0] == 0x01) && (dcs_packet->packet_param[1] == 0x01) && (dcs_packet->packet_param[2] == 0x01))
|
||||||
{
|
{
|
||||||
s_calibration_flag = true;
|
s_calibration_flag = true;
|
||||||
s_calibration_correct_flag = false;
|
s_calibration_correct_flag = false;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
if( (dcs_packet->packet_param[0] == 0xA5) && (dcs_packet->packet_param[1] == 0x5A) && (dcs_packet->packet_param[2] == 0xA5) )
|
if( (dcs_packet->packet_param[0] == 0xA5) && (dcs_packet->packet_param[1] == 0x5A) && (dcs_packet->packet_param[2] == 0xA5) )
|
||||||
{
|
{
|
||||||
if(s_calibration_correct_flag) // 校准成功
|
if(s_calibration_correct_flag) // 校准成功
|
||||||
|
@ -254,7 +255,7 @@ bool ap_set_tp_calibration_04(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_
|
||||||
0x7, 0x04,0x02,0x07,0x2A,0x00,0x00,0x00);
|
0x7, 0x04,0x02,0x07,0x2A,0x00,0x00,0x00);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,7 +268,7 @@ bool ap_set_tp_calibration_04(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
bool ap_get_tp_calibration_status_01(hal_dsi_rx_ctrl_handle_t *handler, uint8_t param)
|
bool ap_get_tp_calibration_status_01(hal_dsi_rx_ctrl_handle_t* handler, uint8_t param)
|
||||||
{
|
{
|
||||||
// if( param == 0x5A )
|
// if( param == 0x5A )
|
||||||
{
|
{
|
||||||
|
@ -276,14 +277,14 @@ bool ap_get_tp_calibration_status_01(hal_dsi_rx_ctrl_handle_t *handler, uint8_t
|
||||||
hal_dsi_rx_ctrl_send_ack_cmd(handler,
|
hal_dsi_rx_ctrl_send_ack_cmd(handler,
|
||||||
DSI_ACK_DT_DSC_SHORT_RESPONSE_1B, //xxx
|
DSI_ACK_DT_DSC_SHORT_RESPONSE_1B, //xxx
|
||||||
DSI_VC_0,
|
DSI_VC_0,
|
||||||
1,ST_TP_CALIBRATION_SUCCESS);
|
1, ST_TP_CALIBRATION_SUCCESS);
|
||||||
}
|
}
|
||||||
else // 校准失败
|
else // 校准失败
|
||||||
{
|
{
|
||||||
hal_dsi_rx_ctrl_send_ack_cmd(handler,
|
hal_dsi_rx_ctrl_send_ack_cmd(handler,
|
||||||
DSI_ACK_DT_DSC_SHORT_RESPONSE_1B, //xxx
|
DSI_ACK_DT_DSC_SHORT_RESPONSE_1B, //xxx
|
||||||
DSI_VC_0,
|
DSI_VC_0,
|
||||||
1,0x00);
|
1, 0x00);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,7 +306,7 @@ void app_tp_calibration_exec(void)
|
||||||
if(s_calibration_flag)
|
if(s_calibration_flag)
|
||||||
{
|
{
|
||||||
s_calibration_flag = false;
|
s_calibration_flag = false;
|
||||||
for(i=0;i<3;i++)
|
for(i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
ap_tp_st_touch_calibration();
|
ap_tp_st_touch_calibration();
|
||||||
delayMs(4000);
|
delayMs(4000);
|
||||||
|
@ -335,9 +336,9 @@ void app_tp_calibration_exec(void)
|
||||||
|
|
||||||
void ap_tp_st_touch_scan_point_init(void)
|
void ap_tp_st_touch_scan_point_init(void)
|
||||||
{
|
{
|
||||||
uint8_t i=0;
|
uint8_t i = 0;
|
||||||
|
|
||||||
for(i=0;i<ST_TP_SCAN_POINT_NUMBER_MAX;i++)
|
for(i = 0; i < ST_TP_SCAN_POINT_NUMBER_MAX; i++)
|
||||||
tp_scan_data.tp_point_buffer[i] = 0;
|
tp_scan_data.tp_point_buffer[i] = 0;
|
||||||
tp_scan_data.tp_point_up_error_flag = 0;
|
tp_scan_data.tp_point_up_error_flag = 0;
|
||||||
tp_scan_data.tp_read_point_counter = 0;
|
tp_scan_data.tp_read_point_counter = 0;
|
||||||
|
@ -355,14 +356,14 @@ void ap_tp_st_touch_scan_point_init(void)
|
||||||
|
|
||||||
void ap_tp_st_touch_simulate_finger_release_event(void)
|
void ap_tp_st_touch_simulate_finger_release_event(void)
|
||||||
{
|
{
|
||||||
uint8_t i,temp=0,ap_tp_release_buf[8] = {0x33,0x01,0x00,0x00,0x00,0x00,0x00,0x00};
|
uint8_t i, temp = 0, ap_tp_release_buf[8] = {0x33, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
|
|
||||||
for(i=0;i<5;i++)
|
for(i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
temp = i;
|
temp = i;
|
||||||
ap_tp_release_buf[1] = (temp<<4)|0x01;
|
ap_tp_release_buf[1] = (temp << 4) | 0x01;
|
||||||
|
|
||||||
app_tp_screen_analysis_int(0, ap_tp_release_buf,8);
|
app_tp_screen_analysis_int(0, ap_tp_release_buf, 8);
|
||||||
|
|
||||||
delayMs(6);
|
delayMs(6);
|
||||||
}
|
}
|
||||||
|
@ -440,19 +441,19 @@ void ap_tp_st_touch_hardware_reset(void)
|
||||||
* @retval :
|
* @retval :
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
void ap_tp_st_touch_scan_point_record_event(uint8_t* screendata,uint8_t len)
|
void ap_tp_st_touch_scan_point_record_event(uint8_t* screendata, uint8_t len)
|
||||||
{
|
{
|
||||||
uint8_t i = 0, j,flag = 0,eventdata=0,eventid=0;
|
uint8_t i = 0, j, flag = 0, eventdata = 0, eventid = 0;
|
||||||
|
|
||||||
for(i=0;i<len;i++)
|
for(i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
eventdata = screendata[i];
|
eventdata = screendata[i];
|
||||||
eventid = (screendata[i+1]>>4)+1;
|
eventid = (screendata[i + 1] >> 4) + 1;
|
||||||
i+=7;
|
i += 7;
|
||||||
|
|
||||||
if(eventdata == 0x13) // 按下事件
|
if(eventdata == 0x13) // 按下事件
|
||||||
{
|
{
|
||||||
for(j=0;j<ST_TP_SCAN_POINT_NUMBER_MAX;j++)
|
for(j = 0; j < ST_TP_SCAN_POINT_NUMBER_MAX; j++)
|
||||||
{
|
{
|
||||||
if(tp_scan_data.tp_point_buffer[j] == eventid)
|
if(tp_scan_data.tp_point_buffer[j] == eventid)
|
||||||
{
|
{
|
||||||
|
@ -461,9 +462,9 @@ void ap_tp_st_touch_scan_point_record_event(uint8_t* screendata,uint8_t len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flag==0) // 轮询没有该ID,需要保存
|
if(flag == 0) // 轮询没有该ID,需要保存
|
||||||
{
|
{
|
||||||
for(j=0;j<ST_TP_SCAN_POINT_NUMBER_MAX;j++) //寻找空位
|
for(j = 0; j < ST_TP_SCAN_POINT_NUMBER_MAX; j++) //寻找空位
|
||||||
{
|
{
|
||||||
if(tp_scan_data.tp_point_buffer[j] == 0x00)
|
if(tp_scan_data.tp_point_buffer[j] == 0x00)
|
||||||
{
|
{
|
||||||
|
@ -476,9 +477,9 @@ void ap_tp_st_touch_scan_point_record_event(uint8_t* screendata,uint8_t len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(eventdata == 0x33 && (tp_scan_data.tp_read_point_counter>0)) // 释放事件
|
if(eventdata == 0x33 && (tp_scan_data.tp_read_point_counter > 0)) // 释放事件
|
||||||
{
|
{
|
||||||
for(j=0;j<ST_TP_SCAN_POINT_NUMBER_MAX;j++)
|
for(j = 0; j < ST_TP_SCAN_POINT_NUMBER_MAX; j++)
|
||||||
{
|
{
|
||||||
if(tp_scan_data.tp_point_buffer[j] == eventid) // 有该事件需要释放
|
if(tp_scan_data.tp_point_buffer[j] == eventid) // 有该事件需要释放
|
||||||
{
|
{
|
||||||
|
@ -512,15 +513,15 @@ void ap_tp_st_touch_scan_point_record_event_exec(void)
|
||||||
{
|
{
|
||||||
if(tp_scan_data.tp_point_up_error_flag == 1)
|
if(tp_scan_data.tp_point_up_error_flag == 1)
|
||||||
{
|
{
|
||||||
if(tp_scan_data.tp_point_error_time_counter < (65536/10)) // 65536*3 = 900ms 65536/10 = 30ms
|
if(tp_scan_data.tp_point_error_time_counter < (65536 / 10)) // 65536*3 = 900ms 65536/10 = 30ms
|
||||||
{
|
{
|
||||||
tp_scan_data.tp_point_error_time_counter ++;
|
tp_scan_data.tp_point_error_time_counter ++;
|
||||||
}
|
}
|
||||||
else // 没有收到move 或者release 时间超时
|
else // 没有收到move 或者release 时间超时
|
||||||
{
|
{
|
||||||
if(tp_scan_data.tp_read_point_counter>0) // 有残留点
|
if(tp_scan_data.tp_read_point_counter > 0) // 有残留点
|
||||||
{
|
{
|
||||||
printf("release finger %2d\n",tp_scan_data.tp_read_point_counter);
|
// printf("release finger %2d\n",tp_scan_data.tp_read_point_counter);
|
||||||
tp_scan_data.tp_read_point_counter = 0;
|
tp_scan_data.tp_read_point_counter = 0;
|
||||||
ap_tp_st_touch_simulate_finger_release_event();
|
ap_tp_st_touch_simulate_finger_release_event();
|
||||||
}
|
}
|
||||||
|
@ -562,7 +563,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)
|
||||||
{
|
{
|
||||||
// 收到 TP 异常回复 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
|
// 收到 TP 异常回复 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
|
||||||
if(screendata[1] == 0xFF && screendata[2] == 0xFF&& screendata[3] == 0xFF&&screendata[4] == 0xFF)
|
if(screendata[1] == 0xFF && screendata[2] == 0xFF && screendata[3] == 0xFF && screendata[4] == 0xFF)
|
||||||
{
|
{
|
||||||
ap_tp_st_touch_software_reset();
|
ap_tp_st_touch_software_reset();
|
||||||
}
|
}
|
||||||
|
|
|
@ -296,6 +296,7 @@ typedef enum
|
||||||
ERR_HANDLE_L1 = 1,
|
ERR_HANDLE_L1 = 1,
|
||||||
ERR_HANDLE_L2 = 2,
|
ERR_HANDLE_L2 = 2,
|
||||||
ERR_HANDLE_L3 = 3,
|
ERR_HANDLE_L3 = 3,
|
||||||
|
ERR_HANDLE_L4 = 4,
|
||||||
ERR_HANDLE_MAX
|
ERR_HANDLE_MAX
|
||||||
} hal_err_handle_level_e;
|
} hal_err_handle_level_e;
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -69,7 +69,7 @@ typedef struct hal_dsi_rx_ctrl_handle_t
|
||||||
hal_dsi_rx_ctrl_pps_entry pps_update_entry; /* PPS Update 时回调函数,用于分辨率切换更新PPS,为NULL时内部处理 */
|
hal_dsi_rx_ctrl_pps_entry pps_update_entry; /* PPS Update 时回调函数,用于分辨率切换更新PPS,为NULL时内部处理 */
|
||||||
bool used; /* handle使用标志位 */
|
bool used; /* handle使用标志位 */
|
||||||
uint8_t pq_marginal; /* picture quality,参数为hal_rx_pq_marginal_type_e */
|
uint8_t pq_marginal; /* picture quality,参数为hal_rx_pq_marginal_type_e */
|
||||||
bool direct_mode; /* video mode 直通模式,预留,仅debug使用 */
|
bool direct_mode; /* video mode 直通模式,支持60hz同帧率且porch相等或者相近时使用 */
|
||||||
hal_dsi_rx_ctrl_dbg_entry rx_debug_cb; /* rx debug 回调函数,目前为收到frame start之后回调,预留其他debug功能 */
|
hal_dsi_rx_ctrl_dbg_entry rx_debug_cb; /* rx debug 回调函数,目前为收到frame start之后回调,预留其他debug功能 */
|
||||||
hal_err_handle_level_e err_handler_level; /* RX接收错误的时候对模块做reset等级, 等级越高reset模块越多 */
|
hal_err_handle_level_e err_handler_level; /* RX接收错误的时候对模块做reset等级, 等级越高reset模块越多 */
|
||||||
bool draw_mode; /* 画点模式,仅debug使用 */
|
bool draw_mode; /* 画点模式,仅debug使用 */
|
||||||
|
@ -471,12 +471,13 @@ bool hal_dsi_rx_ctrl_set_tear_mode_ex(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle,
|
||||||
bool hal_dsi_rx_ctrl_toggle_resolution_ex(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
|
bool hal_dsi_rx_ctrl_toggle_resolution_ex(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief 注册写命令的回调函数,用于特殊命令序列时写命令的处理,注意无法接收0XFF命令
|
* @brief 注册写命令的回调函数,用于特殊命令序列时写命令的处理.
|
||||||
|
可配合hal_dsi_rx_ctrl_set_auto_hw_filter关闭hw filter用于获取所有软件CMD
|
||||||
* @param rx_ctrl_handle: dsi rx handle
|
* @param rx_ctrl_handle: dsi rx handle
|
||||||
* @param 写命令处理函数
|
* @param 写命令处理函数
|
||||||
* @retval none
|
* @retval none
|
||||||
*/
|
*/
|
||||||
void hal_dsi_rx_register_write_cmd_entry(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, hal_dsi_rx_ctrl_dcs_execute execute_func);
|
void hal_dsi_rx_ctrl_register_write_cmd_entry(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, hal_dsi_rx_ctrl_dcs_execute execute_func);
|
||||||
|
|
||||||
|
|
||||||
#if !defined(ISP_568) && !defined(ISP_368)
|
#if !defined(ISP_568) && !defined(ISP_368)
|
||||||
|
|
|
@ -52,7 +52,9 @@ typedef struct
|
||||||
uint8_t blank_rows; /* 默认为0, 针对特殊屏使用,大于0时生效表示向下补黑blank_rows行 */
|
uint8_t blank_rows; /* 默认为0, 针对特殊屏使用,大于0时生效表示向下补黑blank_rows行 */
|
||||||
uint8_t blank_columns; /* 默认为0, 针对特殊屏使用,大于0时生效表示向右补黑blank_columns列 */
|
uint8_t blank_columns; /* 默认为0, 针对特殊屏使用,大于0时生效表示向右补黑blank_columns列 */
|
||||||
bool lp_exit_lpdt; /* 每一条LP CMD都退出LPDT */
|
bool lp_exit_lpdt; /* 每一条LP CMD都退出LPDT */
|
||||||
|
#if defined(ISP_568) || defined(ISP_368)
|
||||||
bool tx_cmd_mode_sync; /* TX command mode 输出同步 */
|
bool tx_cmd_mode_sync; /* TX command mode 输出同步 */
|
||||||
|
#endif
|
||||||
} hal_dsi_tx_ctrl_handle_t;
|
} hal_dsi_tx_ctrl_handle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -139,9 +141,9 @@ void hal_dsi_tx_ctrl_read_cmd(uint8_t data_type, uint8_t vc, uint8_t cmd, uint8_
|
||||||
* @param vc: 虚拟通道编号,参考枚举类型dsi_virtual_channel_e
|
* @param vc: 虚拟通道编号,参考枚举类型dsi_virtual_channel_e
|
||||||
* @param cmd_count: 可变参数个数
|
* @param cmd_count: 可变参数个数
|
||||||
* @param ...: 可变参数
|
* @param ...: 可变参数
|
||||||
* @retval 无
|
* @retval true-command发送正常;false-TX当前状态不能发送command
|
||||||
*/
|
*/
|
||||||
void hal_dsi_tx_ctrl_write_cmd(uint8_t data_type, uint8_t vc, uint8_t cmd_count, ...);
|
bool hal_dsi_tx_ctrl_write_cmd(uint8_t data_type, uint8_t vc, uint8_t cmd_count, ...);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief MIPI TX发送命令
|
* @brief MIPI TX发送命令
|
||||||
|
@ -149,9 +151,9 @@ void hal_dsi_tx_ctrl_write_cmd(uint8_t data_type, uint8_t vc, uint8_t cmd_count,
|
||||||
* @param vc: 虚拟通道编号,参考枚举类型dsi_virtual_channel_e
|
* @param vc: 虚拟通道编号,参考枚举类型dsi_virtual_channel_e
|
||||||
* @param size: data个数
|
* @param size: data个数
|
||||||
* @param data: data数组
|
* @param data: data数组
|
||||||
* @retval 无
|
* @retval true-command发送正常;false-TX当前状态不能发送command
|
||||||
*/
|
*/
|
||||||
void hal_dsi_tx_ctrl_write_array_cmd(uint8_t data_type, uint8_t vc, uint8_t size, const uint8_t *data);
|
bool hal_dsi_tx_ctrl_write_array_cmd(uint8_t data_type, uint8_t vc, uint8_t size, const uint8_t *data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 设置TX溢出时钟分频系统
|
* @brief 设置TX溢出时钟分频系统
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
#define SDK_REVISION 4450
|
#define SDK_REVISION 4644
|
Loading…
Reference in New Issue