26#ifndef _ULTIBO_FT5X06TOUCH_H
27#define _ULTIBO_FT5X06TOUCH_H
38#define FT5X06_TOUCH_DESCRIPTION "EDT FocalTech FT5x06 Touch Controller"
41#define FT5X06_I2C_RATE 400000
44#define FT5X06_WORK_REGISTER_THRESHOLD 0x00
45#define FT5X06_WORK_REGISTER_REPORT_RATE 0x08
46#define FT5X06_WORK_REGISTER_GAIN 0x30
47#define FT5X06_WORK_REGISTER_OFFSET 0x31
48#define FT5X06_WORK_REGISTER_NUM_X 0x33
49#define FT5X06_WORK_REGISTER_NUM_Y 0x34
51#define FT5X06_PMOD_REGISTER_ACTIVE 0x00
52#define FT5X06_PMOD_REGISTER_HIBERNATE 0x03
54#define FT5X06_M09_REGISTER_THRESHOLD 0x80
55#define FT5X06_M09_REGISTER_GAIN 0x92
56#define FT5X06_M09_REGISTER_OFFSET 0x93
57#define FT5X06_M09_REGISTER_NUM_X 0x94
58#define FT5X06_M09_REGISTER_NUM_Y 0x95
60#define FT5X06_EV_REGISTER_THRESHOLD 0x40
61#define FT5X06_EV_REGISTER_GAIN 0x41
62#define FT5X06_EV_REGISTER_OFFSET_Y 0x45
63#define FT5X06_EV_REGISTER_OFFSET_X 0x46
65#define FT5X06_NO_REGISTER 0xff
67#define FT5X06_WORK_REGISTER_OPMODE 0x3c
68#define FT5X06_FACTORY_REGISTER_OPMODE 0x01
69#define FT5X06_PMOD_REGISTER_OPMODE 0xa5
71#define FT5X06_TOUCH_EVENT_DOWN 0x00
72#define FT5X06_TOUCH_EVENT_UP 0x01
73#define FT5X06_TOUCH_EVENT_ON 0x02
74#define FT5X06_TOUCH_EVENT_RESERVED 0x03
76#define FT5X06_EDT_NAME_LEN 23
77#define FT5X06_EDT_SWITCH_MODE_RETRIES 10
78#define FT5X06_EDT_SWITCH_MODE_DELAY 5
79#define FT5X06_EDT_RAW_DATA_RETRIES 100
80#define FT5X06_EDT_RAW_DATA_DELAY 1000
82#define FT5X06_POLL_INTERVAL_MS 17
85#define FT5X06_EDT_M06 0
86#define FT5X06_EDT_M09 1
87#define FT5X06_EDT_M12 2
89#define FT5X06_GENERIC_FT 4
uint32_t STDCALL ft5x06_touch_destroy(TOUCH_DEVICE *touch)
Stop, deregister and destroy a FT5x06 Touch device created by this driver.
void STDCALL ft5x06_init(void)
struct _FT5X06_TOUCH FT5X06_TOUCH
Definition ft5x06touch.h:120
struct _FT5X06_PARAMETERS FT5X06_PARAMETERS
Definition ft5x06touch.h:106
TOUCH_DEVICE *STDCALL ft5x06_touch_create(I2C_DEVICE *i2c, uint16_t address, uint32_t width, uint32_t height, GPIO_INFO *irq, GPIO_INFO *rst)
Create, register and start a new FT5x06 Touch device connected to the specified I2C device.
struct _FT5X06_REGISTERS FT5X06_REGISTERS
Definition ft5x06touch.h:92
#define STDCALL
Definition globaltypes.h:45
_Bool BOOL
Built in Boolean type (1 byte) (Redeclared here for flexibility).
Definition globaltypes.h:55
HANDLE TIMER_HANDLE
Definition globaltypes.h:119
struct _GPIO_INFO GPIO_INFO
Definition gpio.h:176
struct _I2C_DEVICE I2C_DEVICE
Definition i2c.h:81
Definition ft5x06touch.h:108
uint8_t reportrate
Definition ft5x06touch.h:110
uint8_t offsety
Definition ft5x06touch.h:114
uint8_t numx
Definition ft5x06touch.h:115
uint8_t offsetx
Definition ft5x06touch.h:113
uint8_t gain
Definition ft5x06touch.h:111
uint8_t offset
Definition ft5x06touch.h:112
uint8_t numy
Definition ft5x06touch.h:116
uint8_t threshold
Definition ft5x06touch.h:109
Definition ft5x06touch.h:94
uint8_t reportrate
Definition ft5x06touch.h:96
uint8_t offsety
Definition ft5x06touch.h:100
uint8_t numx
Definition ft5x06touch.h:101
uint8_t offsetx
Definition ft5x06touch.h:99
uint8_t gain
Definition ft5x06touch.h:97
uint8_t offset
Definition ft5x06touch.h:98
uint8_t numy
Definition ft5x06touch.h:102
uint8_t threshold
Definition ft5x06touch.h:95
Definition ft5x06touch.h:122
char * modelname
Model name string for this device.
Definition ft5x06touch.h:140
BOOL invertreportx
If True invert the X value in the input report.
Definition ft5x06touch.h:145
uint16_t maxy
Maximum Y value from current configuration.
Definition ft5x06touch.h:133
I2C_DEVICE * i2c
The I2C device this device is connected to.
Definition ft5x06touch.h:126
uint16_t maxx
Maximum X value from current configuration.
Definition ft5x06touch.h:132
FT5X06_REGISTERS registers
Register addresses for this device.
Definition ft5x06touch.h:142
uint16_t address
The I2C address of the device.
Definition ft5x06touch.h:127
uint32_t lastpoints
Points reported in last input report.
Definition ft5x06touch.h:137
uint16_t height
Screen height value supplied during create.
Definition ft5x06touch.h:135
GPIO_INFO rst
The GPIO information for the Reset line (Optional).
Definition ft5x06touch.h:130
uint32_t maxpoints
Maximum touch points for this device.
Definition ft5x06touch.h:136
GPIO_INFO irq
The GPIO information for the IRQ line (Optional).
Definition ft5x06touch.h:129
TOUCH_DEVICE touch
Definition ft5x06touch.h:124
char * firmwareversion
Firmware version string for this device.
Definition ft5x06touch.h:141
uint32_t version
Version constant for this device (eg FT5X06_EDT_M06).
Definition ft5x06touch.h:139
uint16_t width
Screen width value supplied during create.
Definition ft5x06touch.h:134
FT5X06_PARAMETERS parameters
Configuration parameters for this device.
Definition ft5x06touch.h:143
BOOL swapreportxy
If True swap the X and Y values in the input report.
Definition ft5x06touch.h:144
TIMER_HANDLE timer
Handle for touch polling timer.
Definition ft5x06touch.h:131
BOOL invertreporty
If True invert the Y value in the input report.
Definition ft5x06touch.h:146
struct _TOUCH_DEVICE TOUCH_DEVICE
Definition touch.h:151