Solar panel
Loading...
Searching...
No Matches
FT5xx6 Touch Controllers Driver

FT5xx6 Touch Controller Driver API Reference. More...

Modules

 FT5xx6 Registers
 FT5xx6 Registers List.
 
 FT5xx6 Settings
 FT5xx6 Settings List.
 

Functions

void ft5xx6_cfg_setup (ft5xx6_cfg_t *cfg, const ft5xx6_controller_t *controller)
 FT5xx6 Configuration Object Setup Function.
 
tp_err_t ft5xx6_init (ft5xx6_t *ctx, ft5xx6_cfg_t *cfg, tp_drv_t *drv)
 FT5xx6 Initialization Function.
 
void ft5xx6_default_cfg (ft5xx6_t *ctx)
 FT5xx6 Default Configuration Function.
 
void ft5xx6_generic_write (ft5xx6_t *ctx, uint8_t reg_addr, uint8_t data_in)
 FT5xx6 Generic Write Function.
 
uint8_t ft5xx6_generic_read_single (ft5xx6_t *ctx, uint8_t reg_addr)
 FT5xx6 Generic Single Read Function.
 
tp_err_t ft5xx6_generic_read_multiple (ft5xx6_t *ctx, uint8_t reg_addr, uint8_t *data_out, uint16_t n_bytes)
 FT5xx6 Generic Multiple Read Function.
 
void ft5xx6_dev_mode_setup (ft5xx6_t *ctx, ft5xx6_dev_mode_t mode)
 FT5xx6 Device Mode Setup Function.
 
void ft5xx6_run_mode_setup (ft5xx6_t *ctx, ft5xx6_run_mode_t mode)
 FT5xx6 Run Mode Setup Function.
 
tp_event_t ft5xx6_press_detect (ft5xx6_t *ctx)
 FT5xx6 Touch Pressure Detect Function.
 
void ft5xx6_press_coordinates (ft5xx6_t *ctx, tp_touch_item_t *touch_item)
 FT5xx6 Pressure Coordinates Check Function.
 
void ft5xx6_gesture (ft5xx6_t *ctx, tp_event_t *event)
 FT5xx6 Gesture Check Function.
 
tp_err_t ft5xx6_process (ft5xx6_t *ctx)
 FT5xx6 Process Function.
 

Detailed Description

FT5xx6 Touch Controller Driver API Reference.

API for configuring and manipulating FT5xx6 Touch Controller driver.

Function Documentation

◆ ft5xx6_cfg_setup()

void ft5xx6_cfg_setup ( ft5xx6_cfg_t cfg,
const ft5xx6_controller_t controller 
)

FT5xx6 Configuration Object Setup Function.

This function initializes FT5xx6 configuration structure to default values.

Parameters
[out]cfg: FT5xx6 configuration object. See ft5xx6_cfg_t structure definition for detailed explanation.
[in]controller: Touch controller selector from FT5xx6 series touch controllers. See ft5xx6_controller_t structure definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

Example

// FT5xx6 configuration object.
ft5xx6_cfg_t ft5xx6_cfg;
// FT5x26 series touch controllers descriptor.
{
{
{ 0x00, TP_EVENT_GEST_NONE },
{ 0x1C, TP_EVENT_GEST_LEFT },
{ 0x14, TP_EVENT_GEST_RIGHT },
{ 0x10, TP_EVENT_GEST_UP },
{ 0x18, TP_EVENT_GEST_DOWN },
{ 0x48, TP_EVENT_GEST_ZOOM_IN },
{ 0x49, TP_EVENT_GEST_ZOOM_OUT }
}
};
// FT5xx6 configuration setup.
const ft5xx6_controller_t FT5X26_CONTROLLER
FT5x26 Touch Controllers Descriptor.
Definition: ft5xx6.c:79
void ft5xx6_cfg_setup(ft5xx6_cfg_t *cfg, const ft5xx6_controller_t *controller)
FT5xx6 Configuration Object Setup Function.
Definition: ft5xx6.c:129
FT5xx6 Configuration Object.
Definition: ft5xx6.h:571
FT5xx6 Gesture Items.
Definition: ft5xx6.h:561

Definition at line 129 of file ft5xx6.c.

◆ ft5xx6_default_cfg()

void ft5xx6_default_cfg ( ft5xx6_t ctx)

FT5xx6 Default Configuration Function.

This function puts the FT5xx6 touch controller to normal operating mode.

Parameters
[in]ctx: FT5xx6 context object. See ft5xx6_t structure definition for detailed explanation.
Returns
Nothing.
Note
It's necessary for this functon to be executed after Initialization function for properly working of entire driver.

Example

// FT5xx6 driver object.
ft5xx6_t ft5xx6;
// FT5xx6 driver default configuration.
ft5xx6_default_cfg( &ft5xx6 );
void ft5xx6_default_cfg(ft5xx6_t *ctx)
FT5xx6 Default Configuration Function.
Definition: ft5xx6.c:192
FT5xx6 Context Object.
Definition: ft5xx6.h:585

Definition at line 192 of file ft5xx6.c.

◆ ft5xx6_dev_mode_setup()

void ft5xx6_dev_mode_setup ( ft5xx6_t ctx,
ft5xx6_dev_mode_t  mode 
)

FT5xx6 Device Mode Setup Function.

This function puts the FT5xx6 series touch controllers to the selected device mode.

Parameters
[in]ctx: FT5xx6 context object. See ft5xx6_t structure definition for detailed explanation.
[in]mode: device mode of operation. See ft5xx6_dev_mode_t for valid values.
Returns
Nothing.

Example

// FT5xx6 driver object.
ft5xx6_t ft5xx6;
// Setting device normal operating mode of FT5xx6 series touch controllers.
@ FT5XX6_DEV_MODE_NORMAL
Definition: ft5xx6.h:525
void ft5xx6_dev_mode_setup(ft5xx6_t *ctx, ft5xx6_dev_mode_t mode)
FT5xx6 Device Mode Setup Function.
Definition: ft5xx6.c:243

Definition at line 243 of file ft5xx6.c.

◆ ft5xx6_generic_read_multiple()

tp_err_t ft5xx6_generic_read_multiple ( ft5xx6_t ctx,
uint8_t  reg_addr,
uint8_t *  data_out,
uint16_t  n_bytes 
)

FT5xx6 Generic Multiple Read Function.

This function allows user to read the desired number of data bytes, starting from the selected register address.

Parameters
[in]ctx: FT5xx6 context object. See ft5xx6_t structure definition for detailed explanation.
[in]reg_addr: Register address which from the data reading will be started.
[out]data_out: Memory where read data will be stored.
[in]n_bytes: Number of data bytes to be read.
Returns
  • 0 - OK,
  • 6 - Number of transfered bytes is out of range. See #tp_err_t structure definition for detailed explanation.
Example
// FT5xx6 driver object.
ft5xx6_t ft5xx6;
// Read value.
uint8_t read_data[ 2 ];
// TP error code.
tp_err_t error;
// Reading two data bytes to get x coordinate value of touch1.
read_data, 2 );
#define FT5XX6_REG_TOUCH1_XH
FT5xx6 Touch1 X-coord MSB Register.
Definition: ft5xx6.h:101
tp_err_t ft5xx6_generic_read_multiple(ft5xx6_t *ctx, uint8_t reg_addr, uint8_t *data_out, uint16_t n_bytes)
FT5xx6 Generic Multiple Read Function.
Definition: ft5xx6.c:224

Definition at line 224 of file ft5xx6.c.

◆ ft5xx6_generic_read_single()

uint8_t ft5xx6_generic_read_single ( ft5xx6_t ctx,
uint8_t  reg_addr 
)

FT5xx6 Generic Single Read Function.

This function allows user to read any desired register of the FT5xx6 series touch controllers.

Parameters
[in]ctx: FT5xx6 context object. See ft5xx6_t structure definition for detailed explanation.
[in]reg_addr: Register address which from data be read.
Returns
8-bit read data.

Example

// FT5xx6 driver object.
ft5xx6_t ft5xx6;
// Read value.
uint8_t read_data;
// Reading status of FT5xx6 controller to get number of pressed touches.
#define FT5XX6_REG_TD_STATUS
FT5xx6 Status Register.
Definition: ft5xx6.h:94
uint8_t ft5xx6_generic_read_single(ft5xx6_t *ctx, uint8_t reg_addr)
FT5xx6 Generic Single Read Function.
Definition: ft5xx6.c:212

Definition at line 212 of file ft5xx6.c.

◆ ft5xx6_generic_write()

void ft5xx6_generic_write ( ft5xx6_t ctx,
uint8_t  reg_addr,
uint8_t  data_in 
)

FT5xx6 Generic Write Function.

This function allows user to write any 8-bit data to the selected register of the FT5xx6 series touch controllers.

Parameters
[in]ctx: FT5xx6 context object. See ft5xx6_t structure definition for detailed explanation.
[in]reg_addr: Register address where data be written.
[in]data_in: Data to be written.
Returns
Nothing.

Example

// FT5xx6 driver object.
ft5xx6_t ft5xx6;
// Setting FT5xx6 controller to configuration mode.
@ FT5XX6_RUN_MODE_CFG
Definition: ft5xx6.h:537
#define FT5XX6_REG_RUNNING_STATE
FT5xx6 Running State Register.
Definition: ft5xx6.h:353
void ft5xx6_generic_write(ft5xx6_t *ctx, uint8_t reg_addr, uint8_t data_in)
FT5xx6 Generic Write Function.
Definition: ft5xx6.c:201

Definition at line 201 of file ft5xx6.c.

◆ ft5xx6_gesture()

void ft5xx6_gesture ( ft5xx6_t ctx,
tp_event_t *  event 
)

FT5xx6 Gesture Check Function.

This function allows user to get the informations about the gesture (slide direction).

Parameters
[in]ctx: FT5xx6 context object. See ft5xx6_t structure definition for detailed explanation.
[out]event: Touch panel gesture data. See #tp_event_t structure definition for detailed explanation.
Returns
Nothing.
Note
ft5xx6_process function must be called to update all events.

Example

// FT5xx6 driver object.
ft5xx6_t ft5xx6;
// Gesture event.
tp_event_t event;
// Checking slide direction event of pressed touch.
ft5xx6_gesture( &ft5xx6, &event );
void ft5xx6_gesture(ft5xx6_t *ctx, tp_event_t *event)
FT5xx6 Gesture Check Function.
Definition: ft5xx6.c:276

Definition at line 276 of file ft5xx6.c.

◆ ft5xx6_init()

tp_err_t ft5xx6_init ( ft5xx6_t ctx,
ft5xx6_cfg_t cfg,
tp_drv_t *  drv 
)

FT5xx6 Initialization Function.

This function initializes FT5xx6 context object to default values and allows driver interface object to be linked with FT5xx6 driver functions.

Parameters
[out]ctx: FT5xx6 context object. See ft5xx6_t structure definition for detailed explanation.
[in]cfg: FT5xx6 configuration object. See ft5xx6_cfg_t structure definition for detailed explanation.
[out]drv: TP driver interface object. See #tp_drv_t structure definition for detailed explanation.
Returns
  • 0 - OK,
  • 1 - I2C driver init error,
  • 2 - Unsupported pin. See #tp_err_t structure definition for detailed explanation.
Example
// FT5xx6 driver object.
ft5xx6_t ft5xx6;
// FT5xx6 configuration object.
ft5xx6_cfg_t ft5xx6_cfg;
// FT5x26 series touch controllers descriptor.
// TP driver interface object.
tp_drv_t tp_interface;
// FT5xx6 configuration setup.
// FT5xx6 controller pin mapping.
FT5XX6_MAP_PINS( ft5xx6_cfg );
// FT5xx6 driver initialization.
ft5xx6_init( &ft5xx6, &ft5xx6_cfg, &tp_interface );
#define FT5XX6_MAP_PINS(cfg)
FT5xx6 Pin Mapping.
Definition: ft5xx6.h:510
tp_err_t ft5xx6_init(ft5xx6_t *ctx, ft5xx6_cfg_t *cfg, tp_drv_t *drv)
FT5xx6 Initialization Function.
Definition: ft5xx6.c:138

Definition at line 138 of file ft5xx6.c.

◆ ft5xx6_press_coordinates()

void ft5xx6_press_coordinates ( ft5xx6_t ctx,
tp_touch_item_t *  touch_item 
)

FT5xx6 Pressure Coordinates Check Function.

This function allows user to get the informations about the number of pressed touch points, coordinates and touch event for each pressed touch point.

Parameters
[in]ctx: FT5xx6 context object. See ft5xx6_t structure definition for detailed explanation.
[out]touch_item: Touch item data. See #tp_touch_item_t structure definition for detailed explanation.
Returns
Nothing.
Note
ft5xx6_process function must be called to update all events.

Example

// FT5xx6 driver object.
ft5xx6_t ft5xx6;
// Touch pressure item.
tp_touch_item_t tp_item;
// To get all necessary data information about pressed touch.
ft5xx6_press_coordinates( &ft5xx6, &tp_item );
void ft5xx6_press_coordinates(ft5xx6_t *ctx, tp_touch_item_t *touch_item)
FT5xx6 Pressure Coordinates Check Function.
Definition: ft5xx6.c:261

Definition at line 261 of file ft5xx6.c.

◆ ft5xx6_press_detect()

tp_event_t ft5xx6_press_detect ( ft5xx6_t ctx)

FT5xx6 Touch Pressure Detect Function.

This function allows the touch pressure detection.

Parameters
[in]ctx: FT5xx6 context object. See ft5xx6_t structure definition for detailed explanation.
Returns
  • 3 - Touch pressure is not detected,
  • 4 - Touch pressure is detected. See #tp_event_t structure definition for detailed explanation.
Note
ft5xx6_process function must be called to update all events.

Example

// FT5xx6 driver object.
ft5xx6_t ft5xx6;
// Touch pressure event.
tp_event_t event;
// Checking touch pressure event.
event = ft5xx6_press_detect( &ft5xx6 );
tp_event_t ft5xx6_press_detect(ft5xx6_t *ctx)
FT5xx6 Touch Pressure Detect Function.
Definition: ft5xx6.c:255

Definition at line 255 of file ft5xx6.c.

◆ ft5xx6_process()

tp_err_t ft5xx6_process ( ft5xx6_t ctx)

FT5xx6 Process Function.

This function detects a touch pressure, and if any touch pressure was detected, then collects all informations about the pressed touch and slide direction (gesture).

Parameters
[in]ctx: FT5xx6 context object. See ft5xx6_t structure definition for detailed explanation.
Returns
  • 0 - OK,
  • 5 - Number of pressed touches is out of range. See #tp_err_t structure definition for detailed explanation.
Note
To update all possible events, just need to call this function before the any other function for checking events is called.

Example

// FT5xx6 driver object.
ft5xx6_t ft5xx6;
// TP error code.
tp_err_t error;
// Processing all data and events of the target touch controller.
error = ft5xx6_process( &ft5xx6 );
tp_err_t ft5xx6_process(ft5xx6_t *ctx)
FT5xx6 Process Function.
Definition: ft5xx6.c:282

Definition at line 282 of file ft5xx6.c.

◆ ft5xx6_run_mode_setup()

void ft5xx6_run_mode_setup ( ft5xx6_t ctx,
ft5xx6_run_mode_t  mode 
)

FT5xx6 Run Mode Setup Function.

This function puts the FT5xx6 series touch controllers to the selected run mode.

Parameters
[in]ctx: FT5xx6 context object. See ft5xx6_t structure definition for detailed explanation.
[in]mode: run mode of operation. See ft5xx6_run_mode_t for valid values.
Returns
Nothing.

Example

// FT5xx6 driver object.
ft5xx6_t ft5xx6;
// Setting run working mode of FT5xx6 series touch controllers.
@ FT5XX6_RUN_MODE_WORK
Definition: ft5xx6.h:538
void ft5xx6_run_mode_setup(ft5xx6_t *ctx, ft5xx6_run_mode_t mode)
FT5xx6 Run Mode Setup Function.
Definition: ft5xx6.c:249

Definition at line 249 of file ft5xx6.c.