mikroSDK Reference Manual
ft5xx6.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** Copyright (C) 2024 MikroElektronika d.o.o.
4** Contact: https://www.mikroe.com/contact
5**
6** This file is part of the mikroSDK package
7**
8** Commercial License Usage
9**
10** Licensees holding valid commercial NECTO compilers AI licenses may use this
11** file in accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The MikroElektronika Company.
14** For licensing terms and conditions see
15** https://www.mikroe.com/legal/software-license-agreement.
16** For further information use the contact form at
17** https://www.mikroe.com/contact.
18**
19**
20** GNU Lesser General Public License Usage
21**
22** Alternatively, this file may be used for
23** non-commercial projects under the terms of the GNU Lesser
24** General Public License version 3 as published by the Free Software
25** Foundation: https://www.gnu.org/licenses/lgpl-3.0.html.
26**
27** The above copyright notice and this permission notice shall be
28** included in all copies or substantial portions of the Software.
29**
30** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31** OF MERCHANTABILITY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
32** TO THE WARRANTIES FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
33** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
34** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
35** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
36** OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37**
38****************************************************************************/
39
45#ifndef FT5XX6_H
46#define FT5XX6_H
47
48#include "drv_i2c_master.h"
49#include "drv_digital_in.h"
50#include "drv_name.h"
51#include "tp.h"
52
81#define FT5XX6_REG_DEVICE_MODE 0x0
82
88#define FT5XX6_REG_GEST_ID 0x1
89
94#define FT5XX6_REG_TD_STATUS 0x2
95
101#define FT5XX6_REG_TOUCH1_XH 0x3
102
108#define FT5XX6_REG_TOUCH1_XL 0x4
109
115#define FT5XX6_REG_TOUCH1_YH 0x5
116
122#define FT5XX6_REG_TOUCH1_YL 0x6
123
129#define FT5XX6_REG_TOUCH2_XH 0x9
130
136#define FT5XX6_REG_TOUCH2_XL 0xA
137
143#define FT5XX6_REG_TOUCH2_YH 0xB
144
150#define FT5XX6_REG_TOUCH2_YL 0xC
151
157#define FT5XX6_REG_TOUCH3_XH 0xF
158
164#define FT5XX6_REG_TOUCH3_XL 0x10
165
171#define FT5XX6_REG_TOUCH3_YH 0x11
172
178#define FT5XX6_REG_TOUCH3_YL 0x12
179
185#define FT5XX6_REG_TOUCH4_XH 0x15
186
192#define FT5XX6_REG_TOUCH4_XL 0x16
193
199#define FT5XX6_REG_TOUCH4_YH 0x17
200
206#define FT5XX6_REG_TOUCH4_YL 0x18
207
213#define FT5XX6_REG_TOUCH5_XH 0x1B
214
220#define FT5XX6_REG_TOUCH5_XL 0x1C
221
227#define FT5XX6_REG_TOUCH5_YH 0x1D
228
234#define FT5XX6_REG_TOUCH5_YL 0x1E
235
241#define FT5XX6_REG_TOUCH_DET_TH 0x80
242
248#define FT5XX6_REG_TOUCH_PEAK_DET_TH 0x81
249
255#define FT5XX6_REG_TOUCH_TH_CAL 0x82
256
262#define FT5XX6_REG_TOUCH_TH_WATER 0x83
263
269#define FT5XX6_REG_TOUCH_TH_TEMP_COMP 0x84
270
276#define FT5XX6_REG_POWER_CTRL_MODE 0x86
277
283#define FT5XX6_REG_MONITOR_STATUS_TMR 0x87
284
290#define FT5XX6_REG_MONITOR_ACT_PERIOD 0x88
291
297#define FT5XX6_REG_ENTER_IDLE_TIMER 0x89
298
304#define FT5XX6_REG_AUTO_CALIB_MODE 0xA0
305
311#define FT5XX6_REG_LIB_VERSION_H 0xA1
312
318#define FT5XX6_REG_LIB_VERSION_L 0xA2
319
325#define FT5XX6_REG_LIB_CHIP_VENDOR_ID 0xA3
326
332#define FT5XX6_REG_IVT_TO_HOST_STATUS 0xA4
333
339#define FT5XX6_REG_POWER_CONSUME_MODE 0xA5
340
346#define FT5XX6_REG_FW_ID 0xA6
347
353#define FT5XX6_REG_RUNNING_STATE 0xA7
354
360#define FT5XX6_REG_CTPM_VENDOR_ID 0xA8
361
366#define FT5XX6_REG_ERROR_ID 0xA9
367
373#define FT5XX6_REG_CONFIGURE_CAL_MODE 0xAA
374
380#define FT5XX6_REG_BIG_AREA_TH 0xAE
381
382 // ft5xx6_registers
383
399#define FT5XX6_INT_MODE_POLLING 0
400
405#define FT5XX6_INT_MODE_TRIGGER 1
406
411#define FT5XX6_I2C_ADDR 0x38
412
417#define FT5XX6_N_DATA_TRANSFER_MIN 1
418#define FT5XX6_N_DATA_TRANSFER_MAX 256
419
424#define FT5XX6_GESTURE_ITEMS_MAX 7
425
430#define FT5XX6_EVENT_PRESS_DET 0x80
431
447#define FT5XX6_MASK_PRESS_COORD 0xFFF
448
453#define FT5XX6_MASK_PRESS_EVENT 0xC0
454
459#define FT5XX6_MASK_PRESS_DET 0xC0
460
465#define FT5XX6_MASK_TP_NUM 0xF
466
467 // ft5xx6_masks
468
484#define FT5XX6_OFFSET_PRESS_EVENT 6
485
490#define FT5XX6_OFFSET_PRESS_ID 4
491
496#define FT5XX6_OFFSET_DEV_MODE 4
497
502#define FT5XX6_OFFSET_TOUCH_READING 6
503
504 // ft5xx6_offsets
505
510#define FT5XX6_MAP_PINS( cfg ) \
511 cfg.i2c_cfg.scl = CTP_SCL; \
512 cfg.i2c_cfg.sda = CTP_SDA; \
513 cfg.int_pin = CTP_INT
514
515 // ft5xx6_settings
516 // ft5xx6
517 // middlewaregroup
518
530
544
549typedef struct
550{
551 uint8_t key;
555
560typedef struct
561{
563
565
579
597
604
611
618
625
638#ifdef __cplusplus
639extern "C"{
640#endif
641
676void
678
715
735void
737
758void
759ft5xx6_generic_write( ft5xx6_t * ctx, uint8_t reg_addr, uint8_t data_in );
760
781uint8_t
782ft5xx6_generic_read_single( ft5xx6_t * ctx, uint8_t reg_addr );
783
813ft5xx6_generic_read_multiple( ft5xx6_t * ctx, uint8_t reg_addr,
814 uint8_t * data_out, uint16_t n_bytes );
815
835void
837
857void
859
883
907void
909
932void
934
961
962#ifdef __cplusplus
963}
964#endif
965#endif // FT5XX6_H
966
967 // ft5xx6
968 // middlewaregroup
969
970// ------------------------------------------------------------------------ END
API for Digital input driver.
API for I2C master driver.
Pin and port name type definitions.
hal_pin_name_t pin_name_t
Definition drv_name.h:74
const ft5xx6_controller_t FT5X26_CONTROLLER
FT5x26 Touch Controllers Descriptor.
ft5xx6_run_mode_t
FT5xx6 Run Mode Settings.
Definition ft5xx6.h:536
@ FT5XX6_RUN_MODE_AUTO_CAL
Definition ft5xx6.h:541
@ FT5XX6_RUN_MODE_WORK
Definition ft5xx6.h:538
@ FT5XX6_RUN_MODE_CAL
Definition ft5xx6.h:539
@ FT5XX6_RUN_MODE_FACT
Definition ft5xx6.h:540
@ FT5XX6_RUN_MODE_CFG
Definition ft5xx6.h:537
const ft5xx6_controller_t FT5X16_CONTROLLER
FT5x16 Touch Controllers Descriptor.
const ft5xx6_controller_t FT5X46_CONTROLLER
FT5x46 Touch Controllers Descriptor.
ft5xx6_dev_mode_t
FT5xx6 Device Mode Settings.
Definition ft5xx6.h:524
@ FT5XX6_DEV_MODE_SYS_INFO
Definition ft5xx6.h:526
@ FT5XX6_DEV_MODE_NORMAL
Definition ft5xx6.h:525
@ FT5XX6_DEV_MODE_TEST
Definition ft5xx6.h:527
const ft5xx6_controller_t FT5X06_CONTROLLER
FT5x06 Touch Controllers Descriptor.
#define FT5XX6_GESTURE_ITEMS_MAX
FT5xx6 Gesture Items Limit Setting.
Definition ft5xx6.h:424
void ft5xx6_run_mode_setup(ft5xx6_t *ctx, ft5xx6_run_mode_t mode)
FT5xx6 Run Mode Setup Function.
uint8_t ft5xx6_generic_read_single(ft5xx6_t *ctx, uint8_t reg_addr)
FT5xx6 Generic Single Read Function.
void ft5xx6_press_coordinates(ft5xx6_t *ctx, tp_touch_item_t *touch_item)
FT5xx6 Pressure Coordinates Check Function.
tp_err_t ft5xx6_init(ft5xx6_t *ctx, ft5xx6_cfg_t *cfg, tp_drv_t *drv)
FT5xx6 Initialization Function.
void ft5xx6_cfg_setup(ft5xx6_cfg_t *cfg, const ft5xx6_controller_t *controller)
FT5xx6 Configuration Object Setup Function.
tp_event_t ft5xx6_press_detect(ft5xx6_t *ctx)
FT5xx6 Touch Pressure Detect Function.
void ft5xx6_dev_mode_setup(ft5xx6_t *ctx, ft5xx6_dev_mode_t mode)
FT5xx6 Device Mode Setup Function.
void ft5xx6_gesture(ft5xx6_t *ctx, tp_event_t *event)
FT5xx6 Gesture Check Function.
void ft5xx6_generic_write(ft5xx6_t *ctx, uint8_t reg_addr, uint8_t data_in)
FT5xx6 Generic Write Function.
void ft5xx6_default_cfg(ft5xx6_t *ctx)
FT5xx6 Default Configuration Function.
tp_err_t ft5xx6_process(ft5xx6_t *ctx)
FT5xx6 Process 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.
Digital input driver context structure, consisted of the following fields :
Definition drv_digital_in.h:73
FT5xx6 Configuration Object.
Definition ft5xx6.h:571
const ft5xx6_controller_t * controller
Definition ft5xx6.h:576
i2c_master_config_t i2c_cfg
Definition ft5xx6.h:574
pin_name_t int_pin
Definition ft5xx6.h:572
FT5xx6 Gesture Items.
Definition ft5xx6.h:561
FT5xx6 Gesture Item Definition.
Definition ft5xx6.h:550
tp_event_t value
Definition ft5xx6.h:552
uint8_t key
Definition ft5xx6.h:551
FT5xx6 Context Object.
Definition ft5xx6.h:585
i2c_master_t i2c
Definition ft5xx6.h:586
tp_event_t gesture
Definition ft5xx6.h:594
tp_touch_item_t touch
Definition ft5xx6.h:593
const ft5xx6_controller_t * controller
Definition ft5xx6.h:590
tp_event_t press_det
Definition ft5xx6.h:592
digital_in_t int_pin
Definition ft5xx6.h:588
I2C Master initialization configuration structure, consisted of the following fields :
Definition drv_i2c_master.h:97
I2C Master driver context structure, consisted of the following fields :
Definition drv_i2c_master.h:121
Touch Panel Driver Interface Items.
Definition tp.h:199
Touch Item Definition.
Definition tp.h:151
tp_event_t
Touch Panel Event Code Definition.
Definition tp.h:81
tp_err_t
Touch Panel Error Code Definition.
Definition tp.h:65