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.

  1. Touch writing time cannot exceed 1.5s.
  2. Writing cannot be too fast. Speed should be smaller than 200mm/s.
  3. Symbol cannot be smaller than 1.3cm*1.3cm.
  4. Standby current (TBD) (No touch status)
  5. 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

  1. Phone/pad orientation should be normal and not tilt
  2. 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.
  3. Upwards line: Length should be larger than half of Y resolution. X-direction tolerance should not exceed 1/4 of X resolution.
  4. Downwards line: Length should be larger than half of Y resolution. X-direction tolerance should not exceed 1/4 of X resolution.
  5. Lefwards line: Length should be larger than half of X resolution. Y-direction tolerance should not exceed 1/8 of Y resolution.
  6. Rightwards line: Length should be larger than half of X resolution. Y-direction tolerance should not exceed 1/8 of Y resolution.
  7. > Symmetric drawing, lines should be straight
  8. ^ Symmetric drawing, lines should be straight
  9. v Symmetric drawing, lines should be straight
  10. △Symmetric drawing, lines should be straight
  11. 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.
  12. Letter C: Allows straight line(<). Opening should be big,
  13. Letter e: Curve as possible. Large circling, long and short tails in the ‘e’ are not acceptable.
  14. Letter w: Allows folded lines(upper case W)
  15. Letter m: Allows folded lines (upper case M)
  16. Letter g: Area of upper and lower part should be identical
  17. Letter a: Tail should be moderate size
  18. Letter d: Vertical line should be obvious
  19. Letter n: Symmetric drawing
  20. Letter z: Upper line can be curved(like a 2)
  21. Letter b: Vertical line should be obvious
  22. Letter q: Finish line should be on right side
  23. Letter p: Vertical line should be obvious
  24. Letter s: Tail should be moderate size
  25. Letter u: Symmetric drawing
  26. Letter h: Vertical line should be obvious
  27. Letter k: N/A
  28. Letter y: N/A
  29. Letter r: N/A
  30. Letter 3: N/A
  31. Letter 6: N/A
  32. Letter 9: N/A
  33. Letter 7: Vertical line should be straight
  34. :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-&gt;suspended)

{

fts_read_reg(data-&gt;client, 0xB0, &amp;state);

printk(&quot;tpd fts_read_Gestruedata state=%d\n&quot;,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.

results matching ""

    No results matching ""