MTK_Touch_panel_Driver(MTK平台触摸屏驱动)
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
2
Features
Enable touch panel in project(CUSTOM_PROJECT.mak)
TOUCH_PANEL_SUPPORT = TRUE HAND_WRITING = MMI_HANWANG # MMI_HANWANG, MMI_PENPOWER
Enable touch panel in MMI(MMI_features.h,do not modify)
3
Files
System Driver
Touch_panel.c (drv\src) Touch_panel.h (interface\hwdrv) Touch_panel_buff.h (interface\hwdrv) Touch_panel_main.c (drv\src)
Custom Driver
The main reason is LCD size and transform speed
For example: 256*256 LCD with 12 bits ADC converter
The distance between two adjacent pixels could reach 16 units (ADC coordinate)
MTK Touch panel
2010/10/14
Agenda
Introduction
Features Files Framework
Driver Touch Panel Introduction Touch Panel Calibration Process Touch panel event
Flow diagram Exercise: tocuh panel event
#ifdef TOUCH_PANEL_SUPPORT #define __MMI_TOUCH_SCREEN__ #endif #ifdef __MMI_TOUCH_SCREEN__ #define __MMI_TOUCH_DIAL_SCREEN__ #define __MMI_DRAW_MANAGER__ #define __MMI_WGUI_CSK_ENABLE__ #endif
my_pen_up_hdlr(mmi_pen_point_struct point); my_pen_down_hdlr(mmi_pen_point_struct point); my_pen_move_hdlr(mmi_pen_point_struct point); my_pen_abort_hdlr(mmi_pen_point_struct point); my_pen_repeat_hdlr(mmi_pen_point_struct point); my_pen_long_tap_hdlr(mmi_pen_point_struct point); start_handwriting(); end_handwriting();
10
Driver: MTK Calibration(1/2)
2 points calibration with extra one point determination
Calibration Flow Calibration Point Position
Avoid boundary points Use relative ADC difference to verify calibration points ⇒ ADC difference is in proportion to coordinate difference
Draw Manager
Introduction Draw flow diagram Event flow diagram Controls map Control sets Coordinate Sets Exercise: Add new screen Editor and handwriting
13 SPI_DOUT_PIN
Touch panel event flow(Touch panel task)
Fra Baidu bibliotek
14
Touch panel event flow(MMI task)
15
Exercise: touch panel event
#include #include #include #include #include #include void void void void void void void void "MMI_features.h" "PixtelDataTypes.h" "wgui_categories.h" "gdi_include.h" "lcd_sw_rnd.h" "wgui_draw_manager.h"
How to get a touch point coordinate?
3. Use calibration data to transformed ADC value into coordinate. 4.Turn on X+, X- and repeat step 1 and step 2.
8
Driver: 2-points Calibration(1/2)
6
Driver: 4-Wire Resistive Touch Panel(2/3)
7
Driver: 4-Wire Resistive Touch Panel(3/3)
Single-Ended Mode 1.Turn on Y+,Y- drivers. 2.Read X+ ADC.
Differential Mode
Touch_panel_custom.c (custom\drv\misc_drv\BOARD_VER) Touch_panel_custom.h (custom\drv\misc_drv\BOARD_VER) Touch_panel_spi.c (custom\drv\misc_drv\BOARD_VER) Touch_panel_spi.h (custom\drv\misc_drv\BOARD_VER)
Wgui_draw_manager.c (plutommi\mmi\gui\gui_src) Wgui_draw_manager.h (plutommi\mmi\gui\gui_inc) Wgui_touch_screen.c (plutommi\mmi\gui\gui_src) Wgui_touch_screen.h (plutommi\mmi\gui\gui_inc) CustCoordinates.c (plutommi\customer\custresource) EditorPen.c (plutommi\mmi\editorpen\editorpensrc)
11
Driver: MTK Calibration(2/2)
Factory Mode
12
Driver: Custom const variables
Members TOUCH_PANEL_ADC_X_START TOUCH_PANEL_ADC_X_EDN TOUCH_PANEL_ADC_Y_START TOUCH_PANEL_ADC_Y_EDN TOUCH_PANEL_COORD_X_START TOUCH_PANEL_COORD_X_EDN TOUCH_PANEL_COORD_Y_START TOUCH_PANEL_COORD_Y_EDN TOUCH_PANEL_START_BIT TOUCH_PANEL_X_PLUS TOUCH_PANEL_Y_PLUS TOUCH_PANEL_ADC3 TOUCH_PANEL_ADC4 TOUCH_PANEL_12BIT_SAMPLE TOUCH_PANEL_8BIT_SAMPLE TOUCH_PANEL_DIFF_MODE TOUCH_PANEL_SINGLE_MODE TOUCH_PANEL_PWD_ENBLE TOUCH_PANEL_IRQ_DISABLE TOUCH_PANEL_PWD_DISABLE TOUCH_PANEL_PWD_RESER SPI_DIN_PIN SPI_CLK_PIN Description ADC of the left-upper x coordinate ADC of the right-lower x coordinate ADC of the left-upper y coordinate ADC of the right-lower y coordinate Minimum value of the x coordinate Maximum value of the x coordinate Minimum value of the y coordinate Maximum value of the y coordinate Start bit setting of touch panel module X plus setting of touch panel module Y plus setting of touch panel module ADC3 setting of touch panel module ADC4 setting of touch panel module 12 bits sample setting of touch panel module 8 bits sample setting of touch panel module Differential mode setting of touch panel module Single-ended mode setting of touch panel module Power down enable setting of touch panel module Interrupt disable setting of touch panel module Power down disable setting of touch panel module Reset setting of touch panel module GPIO used to be input GPIO used to be clock GPIO used to be output
MMI framework
TouchScreen.c (plutommi\mmi\framework\eventhandling\eventssrc) TouchScreenGprot.h (plutommi\mmi\framework\eventhandling\eventsinc)
MMI GUI
9
Driver: 2-points Calibration(2/2)
Coord. at ACD X - axis Coord. at LCD X - axis
distance
≈
distance
Hence we need two predefined calibration points to get a, b, c, d P = aX + b Q = cY + d
4
Framework
System :
MMI :
MMI Application Category screens
Protocol / Keypad / Interrupt event manager
WGUI GUI
Draw Manager
Touch panel event manager
5
Driver: 4-Wire Resistive Touch Panel(1/3)
y
( X ,Y )
q
(P , Q )
x
p
( P, Q) : LCD coodrinare ( X , Y ) : Touch panel coodrinare Assumption 1: X, Y are not correlative Assumption 2 : The linearity error is small enough to be ignored P = aX + b Q = cY + d
Features
Enable touch panel in project(CUSTOM_PROJECT.mak)
TOUCH_PANEL_SUPPORT = TRUE HAND_WRITING = MMI_HANWANG # MMI_HANWANG, MMI_PENPOWER
Enable touch panel in MMI(MMI_features.h,do not modify)
3
Files
System Driver
Touch_panel.c (drv\src) Touch_panel.h (interface\hwdrv) Touch_panel_buff.h (interface\hwdrv) Touch_panel_main.c (drv\src)
Custom Driver
The main reason is LCD size and transform speed
For example: 256*256 LCD with 12 bits ADC converter
The distance between two adjacent pixels could reach 16 units (ADC coordinate)
MTK Touch panel
2010/10/14
Agenda
Introduction
Features Files Framework
Driver Touch Panel Introduction Touch Panel Calibration Process Touch panel event
Flow diagram Exercise: tocuh panel event
#ifdef TOUCH_PANEL_SUPPORT #define __MMI_TOUCH_SCREEN__ #endif #ifdef __MMI_TOUCH_SCREEN__ #define __MMI_TOUCH_DIAL_SCREEN__ #define __MMI_DRAW_MANAGER__ #define __MMI_WGUI_CSK_ENABLE__ #endif
my_pen_up_hdlr(mmi_pen_point_struct point); my_pen_down_hdlr(mmi_pen_point_struct point); my_pen_move_hdlr(mmi_pen_point_struct point); my_pen_abort_hdlr(mmi_pen_point_struct point); my_pen_repeat_hdlr(mmi_pen_point_struct point); my_pen_long_tap_hdlr(mmi_pen_point_struct point); start_handwriting(); end_handwriting();
10
Driver: MTK Calibration(1/2)
2 points calibration with extra one point determination
Calibration Flow Calibration Point Position
Avoid boundary points Use relative ADC difference to verify calibration points ⇒ ADC difference is in proportion to coordinate difference
Draw Manager
Introduction Draw flow diagram Event flow diagram Controls map Control sets Coordinate Sets Exercise: Add new screen Editor and handwriting
13 SPI_DOUT_PIN
Touch panel event flow(Touch panel task)
Fra Baidu bibliotek
14
Touch panel event flow(MMI task)
15
Exercise: touch panel event
#include #include #include #include #include #include void void void void void void void void "MMI_features.h" "PixtelDataTypes.h" "wgui_categories.h" "gdi_include.h" "lcd_sw_rnd.h" "wgui_draw_manager.h"
How to get a touch point coordinate?
3. Use calibration data to transformed ADC value into coordinate. 4.Turn on X+, X- and repeat step 1 and step 2.
8
Driver: 2-points Calibration(1/2)
6
Driver: 4-Wire Resistive Touch Panel(2/3)
7
Driver: 4-Wire Resistive Touch Panel(3/3)
Single-Ended Mode 1.Turn on Y+,Y- drivers. 2.Read X+ ADC.
Differential Mode
Touch_panel_custom.c (custom\drv\misc_drv\BOARD_VER) Touch_panel_custom.h (custom\drv\misc_drv\BOARD_VER) Touch_panel_spi.c (custom\drv\misc_drv\BOARD_VER) Touch_panel_spi.h (custom\drv\misc_drv\BOARD_VER)
Wgui_draw_manager.c (plutommi\mmi\gui\gui_src) Wgui_draw_manager.h (plutommi\mmi\gui\gui_inc) Wgui_touch_screen.c (plutommi\mmi\gui\gui_src) Wgui_touch_screen.h (plutommi\mmi\gui\gui_inc) CustCoordinates.c (plutommi\customer\custresource) EditorPen.c (plutommi\mmi\editorpen\editorpensrc)
11
Driver: MTK Calibration(2/2)
Factory Mode
12
Driver: Custom const variables
Members TOUCH_PANEL_ADC_X_START TOUCH_PANEL_ADC_X_EDN TOUCH_PANEL_ADC_Y_START TOUCH_PANEL_ADC_Y_EDN TOUCH_PANEL_COORD_X_START TOUCH_PANEL_COORD_X_EDN TOUCH_PANEL_COORD_Y_START TOUCH_PANEL_COORD_Y_EDN TOUCH_PANEL_START_BIT TOUCH_PANEL_X_PLUS TOUCH_PANEL_Y_PLUS TOUCH_PANEL_ADC3 TOUCH_PANEL_ADC4 TOUCH_PANEL_12BIT_SAMPLE TOUCH_PANEL_8BIT_SAMPLE TOUCH_PANEL_DIFF_MODE TOUCH_PANEL_SINGLE_MODE TOUCH_PANEL_PWD_ENBLE TOUCH_PANEL_IRQ_DISABLE TOUCH_PANEL_PWD_DISABLE TOUCH_PANEL_PWD_RESER SPI_DIN_PIN SPI_CLK_PIN Description ADC of the left-upper x coordinate ADC of the right-lower x coordinate ADC of the left-upper y coordinate ADC of the right-lower y coordinate Minimum value of the x coordinate Maximum value of the x coordinate Minimum value of the y coordinate Maximum value of the y coordinate Start bit setting of touch panel module X plus setting of touch panel module Y plus setting of touch panel module ADC3 setting of touch panel module ADC4 setting of touch panel module 12 bits sample setting of touch panel module 8 bits sample setting of touch panel module Differential mode setting of touch panel module Single-ended mode setting of touch panel module Power down enable setting of touch panel module Interrupt disable setting of touch panel module Power down disable setting of touch panel module Reset setting of touch panel module GPIO used to be input GPIO used to be clock GPIO used to be output
MMI framework
TouchScreen.c (plutommi\mmi\framework\eventhandling\eventssrc) TouchScreenGprot.h (plutommi\mmi\framework\eventhandling\eventsinc)
MMI GUI
9
Driver: 2-points Calibration(2/2)
Coord. at ACD X - axis Coord. at LCD X - axis
distance
≈
distance
Hence we need two predefined calibration points to get a, b, c, d P = aX + b Q = cY + d
4
Framework
System :
MMI :
MMI Application Category screens
Protocol / Keypad / Interrupt event manager
WGUI GUI
Draw Manager
Touch panel event manager
5
Driver: 4-Wire Resistive Touch Panel(1/3)
y
( X ,Y )
q
(P , Q )
x
p
( P, Q) : LCD coodrinare ( X , Y ) : Touch panel coodrinare Assumption 1: X, Y are not correlative Assumption 2 : The linearity error is small enough to be ignored P = aX + b Q = cY + d