6.1 Gesture Wakeup Function
Basic Info
During sleep in status of phone/Pad, FW will capture user’s touch path on the screen and analyze it. If the touch trace is correct then the related parameters will be ready and an exception will be notified to the driver to obtain data. Via int fetch_object_sample(unsigned char *buf,short pointnum)
in ft_gesture_lib_v1.0_20140820.a
the Driver will receive touch trace parameter for further analysis and output results. If the results shows preset specific drawing(ex. Double tap, letter, etc), then it will notify AP side. AP can then enter required application swiftly for faster shorcuts. FW will ignore the touch if the results are incorrect.
Basic Specification
Currently only supports single touch single event gestures.
- Touch writing time cannot exceed 1.5s.
- Writing cannot be too fast. Speed should be smaller than 200mm/s.
- Symbol cannot be smaller than 1.3cm*1.3cm.
- Standby current (TBD) (No touch status)
- Symbol trace should be reasonably fit. Ratio should be correct and obvious.
Current Support Symbols/Letters
Name | ID |
---|---|
-> | 0x20 |
<- | 0x21 |
↑ | 0x22 |
↓ | 0x23 |
⊙ | 0x24 |
@ | 0x50 |
< | 0x34 |
> | 0x52 |
^ | 0x53 |
v | 0x54 |
△ | 0x55 |
o | 0x30 |
w | 0x31 |
m | 0x32 |
e | 0x33 |
C | 0x34 |
g | 0x35 |
a | 0x36 |
d | 0x37 |
n | 0x40 |
z | 0x65 |
b | 0x42 |
q | 0x43 |
L | 0x44 |
p | 0x45 |
s | 0x46 |
u | 0x47 |
h | 0x70 |
k | 0x71 |
y | 0x72 |
r | 0x73 |
3 | 0x60 |
6 | 0x61 |
9 | 0x62 |
7 | 0x63 |
8 | 0x64 |
2 | 0x65 |
Gesture Writing Specification
- Phone/pad orientation should be normal and not tilt
- Double tap: Distance between 2 spots cannot be larger than 1.0cm. First tap >100ms and Separation period>100ms. No touch is allowed for 200ms after second tap is completed.
- Upwards line: Length should be larger than half of Y resolution. X-direction tolerance should not exceed 1/4 of X resolution.
- Downwards line: Length should be larger than half of Y resolution. X-direction tolerance should not exceed 1/4 of X resolution.
- Lefwards line: Length should be larger than half of X resolution. Y-direction tolerance should not exceed 1/8 of Y resolution.
- Rightwards line: Length should be larger than half of X resolution. Y-direction tolerance should not exceed 1/8 of Y resolution.
- > Symmetric drawing, lines should be straight
- ^ Symmetric drawing, lines should be straight
- v Symmetric drawing, lines should be straight
- △Symmetric drawing, lines should be straight
- Circle(O): Should not be oval-like drawing (X:Y <1.2). Drawing should be enclosed (starting point is near end point). Opening should not exceed 1/4 area in X and Y direction.
- Letter C: Allows straight line(<). Opening should be big,
- Letter e: Curve as possible. Large circling, long and short tails in the ‘e’ are not acceptable.
- Letter w: Allows folded lines(upper case W)
- Letter m: Allows folded lines (upper case M)
- Letter g: Area of upper and lower part should be identical
- Letter a: Tail should be moderate size
- Letter d: Vertical line should be obvious
- Letter n: Symmetric drawing
- Letter z: Upper line can be curved(like a 2)
- Letter b: Vertical line should be obvious
- Letter q: Finish line should be on right side
- Letter p: Vertical line should be obvious
- Letter s: Tail should be moderate size
- Letter u: Symmetric drawing
- Letter h: Vertical line should be obvious
- Letter k: N/A
- Letter y: N/A
- Letter r: N/A
- Letter 3: N/A
- Letter 6: N/A
- Letter 9: N/A
- Letter 7: Vertical line should be straight
- :Letter 8: Start point should be at upper right corner
Driving Code
The following code of FTS_GESTRUE_EN can be found in focaltech_core.h
#if FTS_GESTRUE_EN
#define GESTURE_LEFT 0x20
#define GESTURE_RIGHT 0x21
#define GESTURE_UP 0x22
#define GESTURE_DOWN 0x23
#define GESTURE_DOUBLECLICK 0x24
#define GESTURE_O 0x30
#define GESTURE_W 0x31
#define GESTURE_M 0x32
#define GESTURE_E 0x33
#define GESTURE_C 0x34
#define FTS_GESTRUE_POINTS 255
#define FTS_GESTRUE_POINTS_ONETIME 62
#define FTS_GESTRUE_POINTS_HEADER 8
#define FTS_GESTURE_OUTPUT_ADRESS 0xD3
#define FTS_GESTURE_OUTPUT_UNIT_LENGTH 4
short pointnum = 0;
unsigned short coordinate_x[150] = {0};
unsigned short coordinate_y[150] = {0};
extern int fetch_object_sample(unsigned char *buf,short pointnum);
extern void init_para(int x_pixel,int y_pixel,int time_slot,int cut_x_pixel,int cut_y_pixel);
#endif
The following are functions related to the gesture function.
static int fts_probe(struct i2c_client *client, const struct i2c_device_id *id)
The following code should be added to this function.
#if FTS_GESTRUE_EN
fts_Gesture_init(input_dev);
init_para(720, 1280,60,0,0);
#endif
init_para is used to set X/Y resolution followed up by 3 reserved parameters where the first and second parameter represent current actual X/Y resolution of the touch screen.
static void fts_ts_suspend(struct early_suspend *handler)
The following code should be added to the above function.
#if FTS_GESTRUE_EN
fts_write_reg(this_client, 0xd0, 0x01);
if (fts_updateinfo_curr.CHIP_ID==0x54)
{
fts_write_reg(this_client, 0xd1, 0xff);
fts_write_reg(this_client, 0xd2, 0xff);
fts_write_reg(this_client, 0xd5, 0xff);
fts_write_reg(this_client, 0xd6, 0xff);
fts_write_reg(this_client, 0xd7, 0xff);
fts_write_reg(this_client, 0xd8, 0xff);
}
return 0;
#endif
static void fts_resume_work(struct work_struct *work)
The following code should be added to the above function.
#if FTS_GESTRUE_EN
fts_write_reg(this_client,0xD0,0x00);
#endif
fts_reset();
static int touch_event_handler(void *unused)
The following code should be added to the above function.
#if FTS_GESTRUE_EN
if(data->suspended)
{
fts_read_reg(data->client, 0xB0, &state);
printk("tpd fts_read_Gestruedata state=%d\n",state);
if(state ==1)
{
fts_read_Gestruedata();
return 1;
}
}
#endif
fts_read_Gestruedata()
is used to get the touch trace from the FW.
static void fts_check_gesture(int gesture_id)
uses the library to analyze the touch symbol and reports to the system.