parent
0679b7a66e
commit
3340d545a8
|
@ -50,7 +50,7 @@
|
|||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\Objects\</OutputDirectory>
|
||||
<OutputName>ISP_568T_S21P_20230511</OutputName>
|
||||
<OutputName>ISP_568T_S21P_20230517</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>1</CreateHexFile>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -1391,6 +1391,23 @@ static bool ap_set_backlight_51(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_packe
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool ap_set_hbm_53(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_packet_t* dcs_packet)
|
||||
{
|
||||
|
||||
if(dcs_packet->packet_param[0] == 0x22) // 进入AOD模式
|
||||
{
|
||||
g_tp_sleep_in = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_tp_sleep_in = false;
|
||||
}
|
||||
TAU_LOGD("53:[%2x]", dcs_packet->packet_param[0]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static bool ap_get_reg_df(hal_dsi_rx_ctrl_handle_t* handler, hal_dcs_packet_t* dcs_packet)
|
||||
{
|
||||
uint8_t panel_ccm_en = dcs_packet->packet_param[0x00];
|
||||
|
@ -1454,6 +1471,7 @@ static const hal_dcs_execute_entry_t g_cus_rx_dcs_execute_table[] =
|
|||
{DCS_SET_DISPLAY_OFF, ap_set_display_off, true},
|
||||
// {0xB1, ap_set_backlight, false},
|
||||
{0x51, ap_set_backlight_51, false}, //leo S21U是用51调光的
|
||||
{0x53, ap_set_hbm_53, false}, //leo S21U是用51调光的
|
||||
{0xDF, ap_get_reg_df, false}, //蓝光
|
||||
{0xBB, ap_MIPI_RX_CMD_bb, false},//息屏时钟亮度
|
||||
// TP calibration
|
||||
|
|
|
@ -23,6 +23,12 @@
|
|||
|
||||
#define S8_TP_DEBUG_LOG 0
|
||||
|
||||
#define Touch_Single_AOD 1 // 息屏后单点触摸唤醒 AOD 显示
|
||||
#define Touch_Double_PowerUp 2 // 息屏后双击唤醒屏幕进入界面
|
||||
|
||||
#define Touch_Single_AOD_Time 20 // 息屏后单点持续时间 小于20*10 = 200ms
|
||||
#define Touch_Double_PowerUp_Time 50 // 息屏后双击唤醒:两个点释放相差时间不超过 50*10 = 500ms
|
||||
|
||||
io_pad_e g_screen_input_rst_pad = IO_PAD_TD_TPRSTN;
|
||||
io_pad_e g_screen_input_int_pad = IO_PAD_TD_INT;
|
||||
io_pad_e g_phone_input_rst_pad = IO_PAD_AP_TPRSTN;
|
||||
|
@ -288,7 +294,7 @@ uint8_t g_screen_tp_reg_43_software_reset_flag = false;
|
|||
bool g_screen_tp_init_start = false;
|
||||
bool g_screen_tp_init_restart = false;
|
||||
bool g_tp_sleep_in = false;
|
||||
bool g_tp_wakeup = false;
|
||||
uint8_t g_tp_wakeup = false;
|
||||
uint8_t g_tp_sleep_delay_count = 0;
|
||||
|
||||
/*************************************报点协议 slave 相关 buffer******************************************/
|
||||
|
@ -329,7 +335,7 @@ uint8_t app_tp_screen_analysis_const(uint8_t transfer_now, uint8_t *rxbuffer, si
|
|||
{
|
||||
uint8_t return_num = transfer_now + 1;
|
||||
|
||||
g_tp_sleep_in = false; // 退出息屏状态
|
||||
// g_tp_sleep_in = false; // 退出息屏状态
|
||||
|
||||
// static uint8_t app_tp_count = 0;
|
||||
|
||||
|
@ -383,19 +389,38 @@ uint8_t app_tp_screen_analysis_wake_up(uint8_t *rxbuffer, uint8_t touch_number)
|
|||
if(touch_number == 1) // 单点触摸
|
||||
{
|
||||
touch_event = rxbuffer[0] >> 4;//触摸事件
|
||||
if(touch_event == 0x01) // 按下事件 单击事件
|
||||
{
|
||||
Touch.Touch_Single_Point[0].Event++;
|
||||
if(Touch.Touch_Single_Point[0].Event == 1) // 第一点按压事件
|
||||
g_tp_sleep_delay_count = 0;
|
||||
}
|
||||
|
||||
if(touch_event == 0x03) // 释放事件 单击事件
|
||||
{
|
||||
Touch.Touch_Single_Point[0].X_in = (((u16)rxbuffer[3] & 0x0F) << 8) | (rxbuffer[2]);
|
||||
Touch.Touch_Single_Point[0].Y_in = ((u16)rxbuffer[4] << 4) | ((rxbuffer[3] & 0xF0) >> 4);
|
||||
|
||||
if(g_tp_sleep_delay_count < 50) // 50*10 = 500ms 内双击事件
|
||||
if(Touch.Touch_Single_Point[0].Event == 1)
|
||||
{
|
||||
x = abs(Touch.Touch_Single_Point[0].X_in-Touch.Touch_Single_Point[1].X_in);
|
||||
y = abs(Touch.Touch_Single_Point[0].Y_in-Touch.Touch_Single_Point[1].Y_in);
|
||||
if(x<100 && y<100) // 双击 x y的范围小于100个像素点
|
||||
if(g_tp_sleep_delay_count < Touch_Single_AOD_Time) // 20*10 = 200ms单击事件
|
||||
{
|
||||
g_tp_wakeup = true;
|
||||
g_tp_wakeup = Touch_Single_AOD;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(g_tp_sleep_delay_count < Touch_Double_PowerUp_Time) // 50*10 = 500ms 内双击事件
|
||||
{
|
||||
x = abs(Touch.Touch_Single_Point[0].X_in-Touch.Touch_Single_Point[1].X_in);
|
||||
y = abs(Touch.Touch_Single_Point[0].Y_in-Touch.Touch_Single_Point[1].Y_in);
|
||||
if(x<100 && y<100) // 双击 x y的范围小于100个像素点
|
||||
{
|
||||
g_tp_wakeup = Touch_Double_PowerUp;
|
||||
Touch.Touch_Single_Point[0].Event = 0;
|
||||
Touch.Touch_Single_Point[0].X_in = 0;
|
||||
Touch.Touch_Single_Point[0].Y_in = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -410,6 +435,7 @@ uint8_t app_tp_screen_analysis_wake_up(uint8_t *rxbuffer, uint8_t touch_number)
|
|||
g_tp_sleep_delay_count = 0;
|
||||
Touch.Touch_Single_Point[0].X_in = 0;
|
||||
Touch.Touch_Single_Point[0].Y_in = 0;
|
||||
Touch.Touch_Single_Point[0].Event = 0;
|
||||
Touch.Touch_Single_Point[1].X_in = Touch.Touch_Single_Point[0].X_in;
|
||||
Touch.Touch_Single_Point[1].Y_in = Touch.Touch_Single_Point[0].Y_in;
|
||||
}
|
||||
|
@ -419,10 +445,12 @@ uint8_t app_tp_screen_analysis_wake_up(uint8_t *rxbuffer, uint8_t touch_number)
|
|||
|
||||
void app_tp_screen_analysis_wake_up_exec(void)
|
||||
{
|
||||
if(g_tp_wakeup == true)
|
||||
if(g_tp_wakeup == Touch_Double_PowerUp)
|
||||
{
|
||||
TAU_LOGD("TP Double\n");
|
||||
g_tp_wakeup = false;
|
||||
delayMs(100);
|
||||
Touch.Touch_Single_Point[0].Event = 0;
|
||||
// delayMs(100);
|
||||
phone_reg_coord_back_X61[0] = 0x46; //44 press C4 leave 84 move
|
||||
phone_reg_coord_back_X61[1] = 0x01; //x 高八位
|
||||
phone_reg_coord_back_X61[2] = 0x2D; //y 高八位
|
||||
|
@ -433,15 +461,46 @@ void app_tp_screen_analysis_wake_up_exec(void)
|
|||
// phone_reg_coord_back_X61[((s1) * 8) + 6] = ((Touch.Touch_Single_Point[ss].Z & 0xFE) >> 2); //bit0-bit5:z只有6位;bit6-bit7:touch type的高两位
|
||||
// phone_reg_coord_back_X61[((s1) * 8) + 7] = --Touch_num; //bit0-bit5:buffer里面剩余多少个事件;bit6-bit7:touch type 低两位
|
||||
|
||||
phone_reg_coord_back_X61[ 6] = 0;
|
||||
phone_reg_coord_back_X61[ 7] = 0;
|
||||
phone_reg_coord_back_X61[6] = 0;
|
||||
phone_reg_coord_back_X61[7] = 0;
|
||||
|
||||
phone_reg_coord_back_X61[ 8] = 0;
|
||||
phone_reg_coord_back_X61[ 9] = 0;
|
||||
phone_reg_coord_back_X61[ 10] = 0;
|
||||
phone_reg_coord_back_X61[ 11] = 0;
|
||||
phone_reg_coord_back_X61[ 12] = 0;
|
||||
phone_reg_coord_back_X61[ 13] = 0;
|
||||
phone_reg_coord_back_X61[8] = 0;
|
||||
phone_reg_coord_back_X61[9] = 0;
|
||||
phone_reg_coord_back_X61[10] = 0;
|
||||
phone_reg_coord_back_X61[11] = 0;
|
||||
phone_reg_coord_back_X61[12] = 0;
|
||||
phone_reg_coord_back_X61[13] = 0;
|
||||
phone_reg_coord_back_X61[14] = 0;
|
||||
phone_reg_coord_back_X61[15] = 0;
|
||||
SAMSUNG_s21p.Touch_ON[0] = 1;
|
||||
hal_gpio_set_output_data(g_phone_output_int_pad, IO_LVL_LOW); //拉低TP中断脚,通知AP读取TP数据
|
||||
Touch.Event_Single_Flag = 0;
|
||||
}
|
||||
else if(g_tp_wakeup == Touch_Single_AOD && g_tp_sleep_delay_count > (Touch_Double_PowerUp_Time+10)) // 单击事件后无触摸报点
|
||||
{
|
||||
TAU_LOGD("TP Single\n");
|
||||
g_tp_wakeup = false;
|
||||
Touch.Touch_Single_Point[0].Event = 0;
|
||||
// delayMs(100);
|
||||
phone_reg_coord_back_X61[0] = 0x52; //44 press C4 leave 84 move
|
||||
phone_reg_coord_back_X61[1] = 0x00; //x 高八位
|
||||
phone_reg_coord_back_X61[2] = 0x22; //y 高八位
|
||||
phone_reg_coord_back_X61[3] = 0x45; //bit0-bit3:y低四位;bit4-bit7:x低四位;
|
||||
phone_reg_coord_back_X61[4] = 0xBB; //major
|
||||
phone_reg_coord_back_X61[5] = 0; //minor
|
||||
//touch type:0:普通手指触摸;1:盘旋;2:保护套;3:手套;4:尖笔;5:手掌;6:潮湿的;7:接近;8:轻摇
|
||||
// phone_reg_coord_back_X61[((s1) * 8) + 6] = ((Touch.Touch_Single_Point[ss].Z & 0xFE) >> 2); //bit0-bit5:z只有6位;bit6-bit7:touch type的高两位
|
||||
// phone_reg_coord_back_X61[((s1) * 8) + 7] = --Touch_num; //bit0-bit5:buffer里面剩余多少个事件;bit6-bit7:touch type 低两位
|
||||
|
||||
phone_reg_coord_back_X61[6] = 0;
|
||||
phone_reg_coord_back_X61[7] = 0;
|
||||
|
||||
phone_reg_coord_back_X61[8] = 0;
|
||||
phone_reg_coord_back_X61[9] = 0;
|
||||
phone_reg_coord_back_X61[10] = 0;
|
||||
phone_reg_coord_back_X61[11] = 0;
|
||||
phone_reg_coord_back_X61[12] = 0;
|
||||
phone_reg_coord_back_X61[13] = 0;
|
||||
phone_reg_coord_back_X61[14] = 0;
|
||||
phone_reg_coord_back_X61[15] = 0;
|
||||
SAMSUNG_s21p.Touch_ON[0] = 1;
|
||||
|
@ -486,6 +545,7 @@ uint8_t app_tp_screen_analysis_int(uint8_t transfer_now, uint8_t *rxbuffer, size
|
|||
|
||||
Touch.Event_Single_Flag = 1;
|
||||
// phone_reg_coord_BUF_NUM = 0;
|
||||
TAU_LOGD("TP [%d]\n", g_tp_sleep_in);
|
||||
|
||||
if (g_tp_sleep_in == false)
|
||||
{
|
||||
|
@ -598,6 +658,7 @@ void app_tp_phone_analysis_data(uint8_t *rxbuffer, size_t rxbuffer_size, const u
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (SAMSUNG_s21p.D60_count == 0)
|
||||
{
|
||||
if(g_screen_tp_init_start == true) //开机
|
||||
|
@ -720,6 +781,7 @@ void app_tp_phone_analysis_data(uint8_t *rxbuffer, size_t rxbuffer_size, const u
|
|||
*txbuffer_size = sizeof(SAMSUNG_s21p.reg_22);
|
||||
// app_tp_transfer_screen_start();
|
||||
g_screen_tp_init_restart = true;
|
||||
|
||||
}
|
||||
break;
|
||||
case 0x21:
|
||||
|
@ -874,9 +936,10 @@ void app_tp_phone_analysis_data(uint8_t *rxbuffer, size_t rxbuffer_size, const u
|
|||
// }
|
||||
// break;
|
||||
case 0xE4:
|
||||
{
|
||||
{
|
||||
// g_tp_sleep_in = false; // 退出息屏状态
|
||||
if (rxbuffer_size == 2)
|
||||
{
|
||||
{
|
||||
if(rxbuffer[1] == 0x00)
|
||||
SAMSUNG_s21p.D60_count = 7;
|
||||
else if(rxbuffer[1] == 0x01)
|
||||
|
@ -922,7 +985,7 @@ void app_tp_phone_analysis_data(uint8_t *rxbuffer, size_t rxbuffer_size, const u
|
|||
}
|
||||
break;
|
||||
case 0xBE:
|
||||
{
|
||||
{
|
||||
if (rxbuffer_size == 2)
|
||||
{
|
||||
SAMSUNG_s21p.Phone_Init_Done = true;
|
||||
|
|
|
@ -15,8 +15,16 @@
|
|||
BC_ISP568_S20P_NT37701AH_VSN667_20230316; 博创项目
|
||||
CX_ISP568_S20P_NT37701AH_VSN667_20230316; 创信项目
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ISP568T_S21P_3511_20230508
|
||||
|
||||
1、增加触摸功能:支持双击息屏、双击唤醒
|
||||
|
||||
2、增加触摸功能:单击进入AOD
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ISP568T_S21P_3511_20230505
|
||||
|
|
Loading…
Reference in New Issue