Loading...
Searching...
No Matches
FocalTech FT5x06 touch panel driver

Multi-touch capacitive panel controller. More...

Detailed Description

Multi-touch capacitive panel controller.

This driver should also support FT5x06,FT5606,FT5x16,FT6x06,Ft6x36 FT5x06i,FT5336,FT3316,FT5436i,FT5336i,FT5x46.

Files

file  ft5x06_constants.h
 Internal register addresses, bitfields and constants.
 
file  ft5x06_params.h
 Default configuration.
 
file  ft5x06_touch_dev.h
 Definition of the driver for the touch_dev generic interface.
 
file  ft5x06.h
 

Data Structures

struct  ft5x06_touch_position_t
 Touch position structure. More...
 
struct  ft5x06_params_t
 Device initialization parameters. More...
 
struct  ft5x06_t
 Device descriptor for the driver. More...
 

Typedefs

typedef void(* ft5x06_event_cb_t) (void *arg)
 Signature of the touch event callback triggered from interrupt.
 

Enumerations

enum  ft5x06_touch_gesture_t {
  FT5X06_TOUCH_NO_GESTURE , FT5X06_TOUCH_MOVE_UP , FT5X06_TOUCH_MOVE_LEFT , FT5X06_TOUCH_MOVE_DOWN ,
  FT5X06_TOUCH_MOVE_RIGHT , FT5X06_TOUCH_ZOOM_IN , FT5X06_TOUCH_ZOOM_OUT
}
 Touch gesture. More...
 
enum  ft5x06_type_t {
  FT5X06_TYPE_FT5X06 , FT5X06_TYPE_FT5606 , FT5X06_TYPE_FT5X16 , FT5X06_TYPE_FT6X06 ,
  FT5X06_TYPE_FT6X36 , FT5X06_TYPE_FT5X06I , FT5X06_TYPE_FT5336 , FT5X06_TYPE_FT3316 ,
  FT5X06_TYPE_FT5436I , FT5X06_TYPE_FT5336I , FT5X06_TYPE_FT5X46
}
 Device type. More...
 
enum  ft5x06_touch_conv_t { FT5X06_NO_CONV = 0x00 , FT5X06_MIRROR_X = 0x01 , FT5X06_MIRROR_Y = 0x02 , FT5X06_SWAP_XY = 0x04 }
 Touch screen coordinate conversions. More...
 

Functions

int ft5x06_init (ft5x06_t *dev, const ft5x06_params_t *params, ft5x06_event_cb_t cb, void *arg)
 Initialize the given device.
 
int ft5x06_read_touch_positions (const ft5x06_t *dev, ft5x06_touch_position_t *positions, size_t len)
 Read the touch positions.
 
int ft5x06_read_touch_count (const ft5x06_t *dev, uint8_t *count)
 Read the number of touch.
 
int ft5x06_read_touch_gesture (const ft5x06_t *dev, ft5x06_touch_gesture_t *gesture)
 Read the gesture detected.
 

Typedef Documentation

◆ ft5x06_event_cb_t

typedef void(* ft5x06_event_cb_t) (void *arg)

Signature of the touch event callback triggered from interrupt.

Parameters
[in]argoptional context for the callback

Definition at line 105 of file ft5x06.h.

Enumeration Type Documentation

◆ ft5x06_touch_conv_t

Touch screen coordinate conversions.

Normally the coordinates of the touch device must be converted to the screen coordinates by swapping and/or mirroring. The flags defined by this enumeration can be ORed for a combined conversion. In this case, the swapping is performed before the mirroring.

Note
The maximum X and Y screen coordinates defined by ft5x06_params_t::xmax and ft5x06_params_t::ymax define the dimension of the touch device in screen coordinates, i.e. after conversion.
Enumerator
FT5X06_NO_CONV 

No conversion.

FT5X06_MIRROR_X 

Mirror X, applied after optional swapping.

FT5X06_MIRROR_Y 

Mirror Y, applied after optional swapping.

FT5X06_SWAP_XY 

Swap XY, applied before optional mirroring.

Definition at line 93 of file ft5x06.h.

◆ ft5x06_touch_gesture_t

Touch gesture.

Enumerator
FT5X06_TOUCH_NO_GESTURE 

No gesture detected.

FT5X06_TOUCH_MOVE_UP 

Move up gesture detected.

FT5X06_TOUCH_MOVE_LEFT 

Move left gesture detected.

FT5X06_TOUCH_MOVE_DOWN 

Move down gesture detected.

FT5X06_TOUCH_MOVE_RIGHT 

Move right gesture detected.

FT5X06_TOUCH_ZOOM_IN 

Zoom int gesture detected.

FT5X06_TOUCH_ZOOM_OUT 

Zoom out gesture detected.

Definition at line 53 of file ft5x06.h.

◆ ft5x06_type_t

Device type.

Enumerator
FT5X06_TYPE_FT5X06 

FT5X06.

FT5X06_TYPE_FT5606 

FT5606.

FT5X06_TYPE_FT5X16 

FT5X16.

FT5X06_TYPE_FT6X06 

FT6X06.

FT5X06_TYPE_FT6X36 

FT6X36.

FT5X06_TYPE_FT5X06I 

FT5X06I.

FT5X06_TYPE_FT5336 

FT5336.

FT5X06_TYPE_FT3316 

FT3316.

FT5X06_TYPE_FT5436I 

FT5436I.

FT5X06_TYPE_FT5336I 

FT5336I.

FT5X06_TYPE_FT5X46 

FT5X46.

Definition at line 66 of file ft5x06.h.

Function Documentation

◆ ft5x06_init()

int ft5x06_init ( ft5x06_t dev,
const ft5x06_params_t params,
ft5x06_event_cb_t  cb,
void *  arg 
)

Initialize the given device.

Parameters
[in,out]devDevice descriptor of the driver
[in]paramsInitialization parameters
[in]cbCallback function called on touch interrupts
[in]argContext argument used in callback function
Returns
0 on success
-ENODEV when no valid device
-EPROTO on any bus error

◆ ft5x06_read_touch_count()

int ft5x06_read_touch_count ( const ft5x06_t dev,
uint8_t *  count 
)

Read the number of touch.

Parameters
[in]devDevice descriptor of the FT5x06
[out]countNumber of touch detected
Returns
0 on success
-EPROTO on any bus error

◆ ft5x06_read_touch_gesture()

int ft5x06_read_touch_gesture ( const ft5x06_t dev,
ft5x06_touch_gesture_t gesture 
)

Read the gesture detected.

Parameters
[in]devDevice descriptor of the FT5X06
[out]gestureGesture ID
Returns
0 on success
-EPROTO on any bus error

◆ ft5x06_read_touch_positions()

int ft5x06_read_touch_positions ( const ft5x06_t dev,
ft5x06_touch_position_t positions,
size_t  len 
)

Read the touch positions.

Parameters
[in]devDevice descriptor of the FT5x06
[out]positionsTouch positions
[in]lenNumber of touch positions to read
Returns
0 on success
-EPROTO on any bus error