MCUXpresso SDK API Reference Manual  Rev 2.16.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Ft6x06

Overview

Data Structures

struct  _touch_point
 Touch point information. More...
 
struct  _ft6x06_handle
 FT6X06 driver handle. More...
 

Macros

#define FT6X06_I2C_ADDRESS   (0x38)
 FT6X06 I2C address. More...
 
#define FT6X06_MAX_TOUCHES   (2U)
 FT6X06 maximum number of simultaneously detected touches. More...
 
#define F6X06_TOUCH_DATA_SUBADDR   (1)
 FT6X06 register address where touch data begin. More...
 
#define FT6X06_TOUCH_DATA_LEN   (2 + (FT6X06_MAX_TOUCHES) * 6)
 FT6X06 raw touch data length. More...
 

Typedefs

typedef enum _touch_event touch_event_t
 Touch event. More...
 
typedef struct _touch_point touch_point_t
 Touch point information. More...
 
typedef struct _ft6x06_handle ft6x06_handle_t
 FT6X06 driver handle. More...
 

Enumerations

enum  _touch_event {
  kTouch_Down = 0,
  kTouch_Up = 1,
  kTouch_Contact = 2,
  kTouch_Reserved = 3
}
 Touch event. More...
 

Functions

status_t FT6X06_Init (ft6x06_handle_t *handle, ARM_DRIVER_I2C *i2c_driver)
 Initialize the driver. More...
 
status_t FT6X06_Denit (ft6x06_handle_t *handle)
 De-initialize the driver. More...
 
void FT6X06_EventHandler (ft6x06_handle_t *handle, uint32_t i2c_event)
 Event Handler. More...
 
status_t FT6X06_GetSingleTouch (ft6x06_handle_t *handle, touch_event_t *touch_event, int *touch_x, int *touch_y)
 Get single touch point coordinate. More...
 
status_t FT6X06_GetMultiTouch (ft6x06_handle_t *handle, int *touch_count, touch_point_t touch_array[FT6X06_MAX_TOUCHES])
 Get multiple touch points coordinate. More...
 

Data Structure Documentation

struct _touch_point

Data Fields

touch_event_t TOUCH_EVENT
 Indicates the state or event of the touch point. More...
 
uint8_t TOUCH_ID
 Id of the touch point. More...
 
uint16_t TOUCH_X
 X coordinate of the touch point.
 
uint16_t TOUCH_Y
 Y coordinate of the touch point.
 

Field Documentation

touch_event_t _touch_point::TOUCH_EVENT
uint8_t _touch_point::TOUCH_ID

This numeric value stays constant between down and up event.

struct _ft6x06_handle

Macro Definition Documentation

#define FT6X06_I2C_ADDRESS   (0x38)
#define FT6X06_MAX_TOUCHES   (2U)
#define F6X06_TOUCH_DATA_SUBADDR   (1)
#define FT6X06_TOUCH_DATA_LEN   (2 + (FT6X06_MAX_TOUCHES) * 6)

Typedef Documentation

typedef struct _touch_point touch_point_t

Enumeration Type Documentation

Enumerator
kTouch_Down 

The state changed to touched.

kTouch_Up 

The state changed to not touched.

kTouch_Contact 

There is a continuous touch being detected.

kTouch_Reserved 

No touch information available.

Function Documentation

status_t FT6X06_Init ( ft6x06_handle_t handle,
ARM_DRIVER_I2C *  i2c_driver 
)

This function power on the touch controller, releases the touch controller reset. After calling this function, the touch controller is ready to work.

Parameters
[in]handlePointer to the driver.
[in]i2c_driverPointer to the CMSIS I2C driver used by FT6X06.
Returns
Returns kStatus_Success if initialize success, otherwise return error code.
status_t FT6X06_Denit ( ft6x06_handle_t handle)

After this function, the touch controller is powered off.

Parameters
[in]handlePointer to the driver.
Returns
Returns kStatus_Success if success, otherwise return error code.
void FT6X06_EventHandler ( ft6x06_handle_t handle,
uint32_t  i2c_event 
)

Called in CMSIS I2C event handler to notify the event.

Parameters
[in]handlePointer to the driver.
[in]i2c_eventThe event passed by CMSIS I2C signal function ARM_I2C_SignalEvent_t
status_t FT6X06_GetSingleTouch ( ft6x06_handle_t handle,
touch_event_t touch_event,
int *  touch_x,
int *  touch_y 
)

Get one touch point coordinate.

Parameters
[in]handlePointer to the driver.
[out]touch_eventTouch Event.
[out]touch_xX coordinate of the touch point.
[out]touch_yY coordinate of the touch point.
Returns
Returns kStatus_Success if success, otherwise return error code.
status_t FT6X06_GetMultiTouch ( ft6x06_handle_t handle,
int *  touch_count,
touch_point_t  touch_array[FT6X06_MAX_TOUCHES] 
)

When this function returns successfully, the touch_count shows how many valid touch points there are in the touch_array.

Parameters
[in]handlePointer to the driver.
[out]touch_countThe actual touch point number.
[out]touch_arrayArray of touch points coordinate.
Returns
Returns kStatus_Success if success, otherwise return error code.