proxfusion3 2.0.0.0
proxfusion3.h
Go to the documentation of this file.
1/****************************************************************************
2** Copyright (C) 2020 MikroElektronika d.o.o.
3** Contact: https://www.mikroe.com/contact
4**
5** Permission is hereby granted, free of charge, to any person obtaining a copy
6** of this software and associated documentation files (the "Software"), to deal
7** in the Software without restriction, including without limitation the rights
8** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9** copies of the Software, and to permit persons to whom the Software is
10** furnished to do so, subject to the following conditions:
11** The above copyright notice and this permission notice shall be
12** included in all copies or substantial portions of the Software.
13**
14** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
19** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20** USE OR OTHER DEALINGS IN THE SOFTWARE.
21****************************************************************************/
22
28#ifndef PROXFUSION3_H
29#define PROXFUSION3_H
30
31#ifdef __cplusplus
32extern "C"{
33#endif
34
35#include "drv_digital_out.h"
36#include "drv_digital_in.h"
37#include "drv_i2c_master.h"
38
39
40
41
67#define PROXFUSION3_DEVICE_INFO 0x00
68
73#define PROXFUSION3_SYS_FLAGS 0x02
74
79#define PROXFUSION3_GESTURE_FLAGS 0x03
80
85#define PROXFUSION3_CH_PROX_STATE 0x04
86#define PROXFUSION3_CH_TOUCH_STATE 0x05
87
92#define PROXFUSION3_ACF_CH0 0x08
93#define PROXFUSION3_ACF_CH1 0x0A
94#define PROXFUSION3_ACF_CH2 0x0C
95#define PROXFUSION3_ACF_CH3 0x0E
96#define PROXFUSION3_ACF_CH4 0x10
97#define PROXFUSION3_ACF_CH5 0x12
98#define PROXFUSION3_ACF_CH6 0x14
99#define PROXFUSION3_ACF_CH7 0x16
100
105#define PROXFUSION3_LTA_CH0 0x09
106#define PROXFUSION3_LTA_CH1 0x0B
107#define PROXFUSION3_LTA_CH2 0x0D
108#define PROXFUSION3_LTA_CH3 0x0F
109#define PROXFUSION3_LTA_CH4 0x11
110#define PROXFUSION3_LTA_CH5 0x13
111#define PROXFUSION3_LTA_CH6 0x15
112#define PROXFUSION3_LTA_CH7 0x17
113
118#define PROXFUSION3_DELTA_CH0 0x18
119#define PROXFUSION3_DELTA_CH1 0x19
120#define PROXFUSION3_DELTA_CH2 0x1A
121#define PROXFUSION3_DELTA_CH3 0x1B
122#define PROXFUSION3_DELTA_CH4 0x1C
123#define PROXFUSION3_DELTA_CH5 0x1D
124#define PROXFUSION3_DELTA_CH6 0x1E
125#define PROXFUSION3_DELTA_CH7 0x1F
126
131#define PROXFUSION3_REFDELTA_CH0 0x20
132#define PROXFUSION3_REFDELTA_CH1 0x21
133#define PROXFUSION3_REFDELTA_CH2 0x22
134#define PROXFUSION3_REFDELTA_CH3 0x23
135#define PROXFUSION3_REFDELTA_CH4 0x24
136#define PROXFUSION3_REFDELTA_CH5 0x25
137#define PROXFUSION3_REFDELTA_CH6 0x26
138#define PROXFUSION3_REFDELTA_CH7 0x27
139
144#define PROXFUSION3_COORDINATES 0x30
145
150#define PROXFUSION3_CAP_ABS_BASE 0x31
151#define PROXFUSION3_CAP_ABS_CS 0x32
152#define PROXFUSION3_CAP_ABS_CS_CAP0 0x33
153#define PROXFUSION3_CAP_ABS_CS_CAP1 0x34
154
159#define PROXFUSION3_PMU_SETTINGS 0x80
160#define PROXFUSION3_ACTIVE_CHANNELS 0x81
161#define PROXFUSION3_CH_RESEED 0x82
162
167#define PROXFUSION3_REPORT_RATES 0x83
168#define PROXFUSION3_ULP_MODE_RATES 0x84
169#define PROXFUSION3_TIMEOUT_PERIODS 0x85
170
175#define PROXFUSION3_GEN_SETINGS 0x86
176#define PROXFUSION3_REF_SETTINGS 0x87
177#define PROXFUSION3_EVENT_SETTINGS 0x88
178
183#define PROXFUSION3_SLIDER0_CH 0x89
184#define PROXFUSION3_TAP_SETTINGS 0x8A
185#define PROXFUSION3_SWIPE_SETTINGS 0x8B
186
191#define PROXFUSION3_CH0_SETTINGS 0x8C
192#define PROXFUSION3_CH1_SETTINGS 0x93
193#define PROXFUSION3_CH3_SETTINGS 0x9A
194#define PROXFUSION3_CH4_SETTINGS 0xA1
195#define PROXFUSION3_CH5_SETTINGS 0xA8
196#define PROXFUSION3_CH6_SETTINGS 0xAF
197#define PROXFUSION3_CH7_SETTINGS 0xB6
198#define PROXFUSION3_CH8_SETTINGS 0xBD
199#define PROXFUSION3_CHx_REF_ASSOC 0x92
200#define PROXFUSION3_CH6_PROX_SETTINGS 0xB7
201#define PROXFUSION3_CH6_ATI_MIRROR 0xB9
202#define PROXFUSION3_CH7_ATI_MIRROR 0xC0
203#define PROXFUSION3_ATI_TARGETS 0x8E
204
209#define PROXFUSION3_ENG_DIRECT_ADDRESS 0xF0
210#define PROXFUSION3_ENG_DIRECT_DATA 0xF1
211#define PROXFUSION3_ENG_I2C_SETTINGS 0xF2
212#define PROXFUSION3_ENG_LAST_CONV_LSB 0xF3
213#define PROXFUSION3_ENG_LAST_CONV_MSB 0xF4
214#define PROXFUSION3_ENG_PXS_DETECTION 0xF5
215 // proxfusion3_reg
217
232#define PROXFUSION3_PRODUCT_NUM 0x4F
233#define PROXFUSION3_SW_NUM_V1 0x02
234#define PROXFUSION3_SW_NUM_V2 0x03
235
240#define PROXFUSION3_NP_SEG_ACTIVE_BIT 0x01
241#define PROXFUSION3_GO_TO_NP_BIT 0x02
242#define PROXFUSION3_IN_ATI_BIT 0x04
243#define PROXFUSION3_NP_MODE_BITS 0x00
244#define PROXFUSION3_LP_MODE_BITS 0x08
245#define PROXFUSION3_ULP_MODE_BITS 0x10
246#define PROXFUSION3_HALT_MODE_BITS 0x18
247#define PROXFUSION3_SHOW_RESET_BIT 0x80
248
253#define PROXFUSION3_PROX_EVENT_BIT 0x01
254#define PROXFUSION3_TOUCH_EVENT_BIT 0x02
255#define PROXFUSION3_DEEP_EVENT_BIT 0x04
256#define PROXFUSION3_GESTURE_EVENT_BIT 0x08
257#define PROXFUSION3_MOV_EVENT_BIT 0x10
258#define PROXFUSION3_REF_EVENT_BIT 0x20
259#define PROXFUSION3_SYS_EVENT_BIT 0x40
260#define PROXFUSION3_LP_EVENT_BIT 0x80
261
266#define PROXFUSION3_TAP0_BIT 0x01
267#define PROXFUSION3_HOLD0_BIT 0x02
268#define PROXFUSION3_SWIPE_UP_BIT 0x04
269#define PROXFUSION3_SWIPE_DOWN_BIT 0x08
270#define PROXFUSION3_TAP1_BIT 0x10
271#define PROXFUSION3_HOLD1_BIT 0x20
272#define PROXFUSION3_SWIPE_LEFT_BIT 0x40
273#define PROXFUSION3_SWIPE_RIGHT_BIT 0x80
274
279#define PROXFUSION3_ACK_RESET_BIT 0x01
280#define PROXFUSION3_SOFT_RESET_BIT 0x02
281#define PROXFUSION3_REDO_ATI_BIT 0x04
282#define PROXFUSION3_EVENT_MODE_BIT 0x20
283
288#define PROXFUSION3_DISABLE_CH6_ATI 0xA0
289#define PROXFUSION3_ENABLE_ABSCAP_UI 0x08
290#define PROXFUSION3_ENABLE_4MHZ_FOSC 0x80
291#define PROXFUSION3_DISABLE_AUTO_MODE 0x20
292
298#define PROXFUSION3_PMU_GENERAL_SETTINGS 0x41
299#define PROXFUSION3_I2C_GENERAL_SETTINGS 0x00
300#define PROXFUSION3_SYS_CHB_ACTIVE 0xFF
301#define PROXFUSION3_ACF_LTA_FILTER_SETTINGS 0xC4
302#define PROXFUSION3_LTA_CHB_RESEED_ENABLED 0xFF
303#define PROXFUSION3_UIS_GLOBAL_EVENTS_MASK 0x00
304
310#define PROXFUSION3_PMU_REPORT_RATE_NP 0x10
311#define PROXFUSION3_PMU_REPORT_RATE_LP 0xA0
312#define PROXFUSION3_PMU_REPORT_RATE_ULP 0x0D
313#define PROXFUSION3_PMU_MODE_TIMOUT 0x0A
314#define PROXFUSION3_I2C_WINDOW_TIMEOUT 0x14
315#define PROXFUSION3_LTA_HALT_TIMEOUT 0x14
316
322#define PROXFUSION3_PXS_GENERAL_SETTINGS0 0x00
323#define PROXFUSION3_PXS_GENERAL_SETTINGS1 0x00
324#define PROXFUSION3_UIS_ABSOLUTE_CAPACITANCE 0x00
325#define PROXFUSION3_UIS_DCF_GENERAL_SETTINGS 0x11
326#define PROXFUSION3_GEM_CHB_BLOCK_NFOLLOW 0x00
327#define PROXFUSION3_MOV_CHB_MOVEMENT_CHANNEL 0x00
328#define PROXFUSION3_UIS_CHB_SLIDER0 0x78
329#define PROXFUSION3_UIS_CHB_SLIDER1 0x06
330#define PROXFUSION3_UIS_GESTURE_TAP_TIMEOUT 0x40
331#define PROXFUSION3_UIS_GESTURE_SWIPE_TIMEOUT 0xBB
332#define PROXFUSION3_UIS_GESTURE_THRESHOLD 0x80
333#define PROXFUSION3_LTA_CHB_RESEED 0x00
334
340#define PROXFUSION3_PXS_CRXSEL_CH0 0xFF
341#define PROXFUSION3_PXS_CTXSEL_CH0 0xFF
342#define PROXFUSION3_PXS_PROXCTRL_CH0 0xA3
343#define PROXFUSION3_PXS_PROXCFG0_CH0 0x40
344#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH0 0x06
345#define PROXFUSION3_ATI_BASE_AND_TARGET_CH0 0x90
346#define PROXFUSION3_ATI_MIRROR_CH0 0x2C
347#define PROXFUSION3_ATI_PCC_CH0 0xCD
348#define PROXFUSION3_PXS_PROX_THRESHOLD_CH0 0x04
349#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH0 0x09
350#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH0 0x10
351#define PROXFUSION3_PXS_HYSTERESIS_CH0 0x04
352#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH0 0x00
353#define PROXFUSION3_DCF_WEIGHT_CH0 0x00
354
360#define PROXFUSION3_PXS_CRXSEL_CH1 0x3A
361#define PROXFUSION3_PXS_CTXSEL_CH1 0xFF
362#define PROXFUSION3_PXS_PROXCTRL_CH1 0xA3
363#define PROXFUSION3_PXS_PROXCFG0_CH1 0x40
364#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH1 0x06
365#define PROXFUSION3_ATI_BASE_AND_TARGET_CH1 0x90
366#define PROXFUSION3_ATI_MIRROR_CH1 0x29
367#define PROXFUSION3_ATI_PCC_CH1 0xC6
368#define PROXFUSION3_PXS_PROX_THRESHOLD_CH1 0x04
369#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH1 0x09
370#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH1 0x10
371#define PROXFUSION3_PXS_HYSTERESIS_CH1 0x04
372#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH1 0x00
373#define PROXFUSION3_DCF_WEIGHT_CH1 0x00
374
380#define PROXFUSION3_PXS_CRXSEL_CH2 0xC5
381#define PROXFUSION3_PXS_CTXSEL_CH2 0xFF
382#define PROXFUSION3_PXS_PROXCTRL_CH2 0xA3
383#define PROXFUSION3_PXS_PROXCFG0_CH2 0x40
384#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH2 0x06
385#define PROXFUSION3_ATI_BASE_AND_TARGET_CH2 0x90
386#define PROXFUSION3_ATI_MIRROR_CH2 0x29
387#define PROXFUSION3_ATI_PCC_CH2 0xC0
388#define PROXFUSION3_PXS_PROX_THRESHOLD_CH2 0x04
389#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH2 0x09
390#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH2 0x10
391#define PROXFUSION3_PXS_HYSTERESIS_CH2 0x04
392#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH2 0x00
393#define PROXFUSION3_DCF_WEIGHT_CH2 0x00
394
400#define PROXFUSION3_PXS_CRXSEL_CH3 0x90
401#define PROXFUSION3_PXS_CTXSEL_CH3 0xFF
402#define PROXFUSION3_PXS_PROXCTRL_CH3 0xA3
403#define PROXFUSION3_PXS_PROXCFG0_CH3 0x40
404#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH3 0x06
405#define PROXFUSION3_ATI_BASE_AND_TARGET_CH3 0x90
406#define PROXFUSION3_ATI_MIRROR_CH3 0x1E
407#define PROXFUSION3_ATI_PCC_CH3 0xC8
408#define PROXFUSION3_PXS_PROX_THRESHOLD_CH3 0x0A
409#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH3 0x10
410#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH3 0x30
411#define PROXFUSION3_PXS_HYSTERESIS_CH3 0x04
412#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH3 0x00
413#define PROXFUSION3_DCF_WEIGHT_CH3 0x00
414
420#define PROXFUSION3_PXS_CRXSEL_CH4 0x42
421#define PROXFUSION3_PXS_CTXSEL_CH4 0xFF
422#define PROXFUSION3_PXS_PROXCTRL_CH4 0xA3
423#define PROXFUSION3_PXS_PROXCFG0_CH4 0x40
424#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH4 0x06
425#define PROXFUSION3_ATI_BASE_AND_TARGET_CH4 0x90
426#define PROXFUSION3_ATI_MIRROR_CH4 0x1E
427#define PROXFUSION3_ATI_PCC_CH4 0xCA
428#define PROXFUSION3_PXS_PROX_THRESHOLD_CH4 0x0A
429#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH4 0x10
430#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH4 0x30
431#define PROXFUSION3_PXS_HYSTERESIS_CH4 0x04
432#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH4 0x00
433#define PROXFUSION3_DCF_WEIGHT_CH4 0x00
434
440#define PROXFUSION3_PXS_CRXSEL_CH5 0x21
441#define PROXFUSION3_PXS_CTXSEL_CH5 0xFF
442#define PROXFUSION3_PXS_PROXCTRL_CH5 0xA3
443#define PROXFUSION3_PXS_PROXCFG0_CH5 0x40
444#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH5 0x06
445#define PROXFUSION3_ATI_BASE_AND_TARGET_CH5 0x90
446#define PROXFUSION3_ATI_MIRROR_CH5 0x1E
447#define PROXFUSION3_ATI_PCC_CH5 0xD0
448#define PROXFUSION3_PXS_PROX_THRESHOLD_CH5 0x0A
449#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH5 0x10
450#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH5 0x30
451#define PROXFUSION3_PXS_HYSTERESIS_CH5 0x04
452#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH5 0x00
453#define PROXFUSION3_DCF_WEIGHT_CH5 0x00
454
460#define PROXFUSION3_PXS_CRXSEL_CH6 0x0C
461#define PROXFUSION3_PXS_CTXSEL_CH6 0xFF
462#define PROXFUSION3_PXS_PROXCTRL_CH6 0xA3
463#define PROXFUSION3_PXS_PROXCFG0_CH6 0x40
464#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH6 0x06
465#define PROXFUSION3_ATI_BASE_AND_TARGET_CH6 0x90
466#define PROXFUSION3_ATI_MIRROR_CH6 0x26
467#define PROXFUSION3_ATI_PCC_CH6 0xCB
468#define PROXFUSION3_PXS_PROX_THRESHOLD_CH6 0x0A
469#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH6 0x10
470#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH6 0x30
471#define PROXFUSION3_PXS_HYSTERESIS_CH6 0x04
472#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH6 0x00
473#define PROXFUSION3_DCF_WEIGHT_CH6 0x00
474
480#define PROXFUSION3_PXS_CRXSEL_CH7 0x01
481#define PROXFUSION3_PXS_CTXSEL_CH7 0xFF
482#define PROXFUSION3_PXS_PROXCTRL_CH7 0xA3
483#define PROXFUSION3_PXS_PROXCFG0_CH7 0xDE
484#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH7 0x01
485#define PROXFUSION3_ATI_BASE_AND_TARGET_CH7 0xD0
486#define PROXFUSION3_ATI_MIRROR_CH7 0x57
487#define PROXFUSION3_ATI_PCC_CH7 0x60
488#define PROXFUSION3_PXS_PROX_THRESHOLD_CH7 0x0A
489#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH7 0x08
490#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH7 0x1A
491#define PROXFUSION3_PXS_HYSTERESIS_CH7 0x04
492#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH7 0x00
493#define PROXFUSION3_DCF_WEIGHT_CH7 0x00
494
495//
501#define PROXFUSION3_CH0_CRX 0x8C
502#define PROXFUSION3_CH1_CRX 0x93
503#define PROXFUSION3_CH2_CRX 0x9A
504#define PROXFUSION3_CH3_CRX 0xA1
505#define PROXFUSION3_CH4_CRX 0xA8
506#define PROXFUSION3_CH5_CRX 0xAF
507#define PROXFUSION3_CH6_CRX 0xB6
508#define PROXFUSION3_CH7_CRX 0xBD
509
514#define PROXFUSION3_TOUCH_NUMB_1 0x13
515#define PROXFUSION3_TOUCH_NUMB_2 0x27
516#define PROXFUSION3_TOUCH_NUMB_3 0x4E
517#define PROXFUSION3_TOUCH_NUMB_4 0x0C
518#define PROXFUSION3_TOUCH_NUMB_5 0x30
519#define PROXFUSION3_TOUCH_NUMB_6 0x70
520#define PROXFUSION3_TOUCH_NUMB_7 0x60
521#define PROXFUSION3_TOUCH_NUMB_8 0x40
522
527#define PROXFUSION3_TOUCH_CRX_0 0x01
528#define PROXFUSION3_TOUCH_CRX_1 0x02
529#define PROXFUSION3_TOUCH_CRX_2 0x04
530#define PROXFUSION3_TOUCH_CRX_3 0x08
531#define PROXFUSION3_TOUCH_CRX_4 0x10
532#define PROXFUSION3_TOUCH_CRX_5 0x20
533#define PROXFUSION3_TOUCH_CRX_6 0x40
534#define PROXFUSION3_TOUCH_CRX_7 0x80
535
540#define PROXFUSION3_TOUCH_POS_NO_TOUCH 0x00
541#define PROXFUSION3_TOUCH_POS_1 0x01
542#define PROXFUSION3_TOUCH_POS_2 0x02
543#define PROXFUSION3_TOUCH_POS_3 0x03
544#define PROXFUSION3_TOUCH_POS_4 0x04
545#define PROXFUSION3_TOUCH_POS_5 0x05
546#define PROXFUSION3_TOUCH_POS_6 0x06
547#define PROXFUSION3_TOUCH_POS_7 0x07
548#define PROXFUSION3_TOUCH_POS_8 0x08
549
554#define PROXFUSION3_CH0_PT_T 0x90
555#define PROXFUSION3_CH1_PT_T 0x97
556#define PROXFUSION3_CH2_PT_T 0x9E
557#define PROXFUSION3_CH3_PT_T 0xA5
558#define PROXFUSION3_CH4_PT_T 0xAC
559#define PROXFUSION3_CH5_PT_T 0xB3
560#define PROXFUSION3_CH6_PT_T 0xBA
561#define PROXFUSION3_CH7_PT_T 0xC1
562
567#define PROXFUSION3_CH0_DT_T 0x91
568#define PROXFUSION3_CH1_DT_T 0x98
569#define PROXFUSION3_CH2_DT_T 0x9F
570#define PROXFUSION3_CH3_DT_T 0xA6
571#define PROXFUSION3_CH4_DT_T 0xAD
572#define PROXFUSION3_CH5_DT_T 0xB4
573#define PROXFUSION3_CH6_DT_T 0xBB
574#define PROXFUSION3_CH7_DT_T 0xC2
575
580#define PROXFUSION3_EVENT_NO_TOUCH 0x00
581#define PROXFUSION3_EVENT_TOUCH 0x01
582
588#define PROXFUSION3_SET_DEV_ADDR 0x44
589
595#define PROXFUSION3_SET_PIN_STATE_LOW 0x00
596#define PROXFUSION3_SET_PIN_STATE_HIGH 0x01
597
603#define PROXFUSION3_PROX_THRESHOLD 10
604#define PROXFUSION3_TOUCH_THRESHOLD_CH0 22
605#define PROXFUSION3_TOUCH_THRESHOLD_CH1 20
606#define PROXFUSION3_TOUCH_THRESHOLD_CH2 10
607#define PROXFUSION3_TOUCH_THRESHOLD_CH3 10
608#define PROXFUSION3_TOUCH_THRESHOLD_CH4 22
609#define PROXFUSION3_TOUCH_THRESHOLD_CH5 20
610#define PROXFUSION3_TOUCH_THRESHOLD_CH6 12
611#define PROXFUSION3_TOUCH_THRESHOLD_CH7 10
612#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH0 32
613#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH1 26
614#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH2 26
615#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH3 26
616#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH4 32
617#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH5 26
618#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH6 26
619#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH7 26
620#define PROXFUSION3_TOUCH_CH_RX_THRESHOLD_7 16384
621
622 // proxfusion3_set
624
639#define PROXFUSION3_MAP_MIKROBUS( cfg, mikrobus ) \
640 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
641 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
642 cfg.gp = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
643 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
644 // proxfusion3_map // proxfusion3
647
652typedef struct
653{
654 // Output pins
655
656 digital_out_t int_pin;
658 // Input pins
659
660 digital_in_t gp;
662 // Modules
663
664 i2c_master_t i2c;
666 // I2C slave address
667
671
676typedef struct
677{
678 pin_name_t scl;
679 pin_name_t sda;
681 pin_name_t gp;
682 pin_name_t int_pin;
684 uint32_t i2c_speed;
685 uint8_t i2c_address;
688
707
725
742
755void proxfusion3_set_state_int_pin ( proxfusion3_t *ctx, uint8_t pin_state );
756
770
788err_t proxfusion3_generic_write ( proxfusion3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len );
789
807err_t proxfusion3_generic_read ( proxfusion3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len );
808
823void proxfusion3_write_reg ( proxfusion3_t *ctx, uint8_t reg, uint16_t tx_data );
824
838uint16_t proxfusion3_read_reg ( proxfusion3_t *ctx, uint8_t reg );
839
856err_t proxfusion3_get_version_info ( proxfusion3_t *ctx, uint8_t *product_number, uint8_t *software_version );
857
873
888
903
918
933
949
972void proxfusion3_set_event ( proxfusion3_t *ctx, uint8_t event );
973
989
1004uint16_t proxfusion3_read_channel_delta ( proxfusion3_t *ctx, uint8_t channel );
1005
1021
1044
1060
1083void proxfusion3_set_even_mode ( proxfusion3_t *ctx, uint8_t mode );
1084
1099
1115
1116#ifdef __cplusplus
1117}
1118#endif
1119#endif // PROXFUSION3_H
1120 // proxfusion3
1122
1123// ------------------------------------------------------------------------ END
err_t proxfusion3_get_version_info(proxfusion3_t *ctx, uint8_t *product_number, uint8_t *software_version)
ProxFusion 3 get version info data function.
void proxfusion3_enable_channels(proxfusion3_t *ctx)
ProxFusion 3 enable channels function.
uint8_t proxfusion3_get_events(proxfusion3_t *ctx)
ProxFusion 3 get events function.
err_t proxfusion3_default_cfg(proxfusion3_t *ctx)
ProxFusion 3 default configuration function.
void proxfusion3_set_state_int_pin(proxfusion3_t *ctx, uint8_t pin_state)
ProxFusion 3 INT pin setting function.
void proxfusion3_channel_remap(proxfusion3_t *ctx)
ProxFusion 3 channel remap function.
void proxfusion3_adjust_deep_touch_thresholds(proxfusion3_t *ctx)
ProxFusion 3 adjust deep touch thresholds function.
void proxfusion3_set_event(proxfusion3_t *ctx, uint8_t event)
ProxFusion 3 set event function.
uint8_t proxfusion3_check_touch_event(proxfusion3_t *ctx)
ProxFusion 3 check touch event function.
err_t proxfusion3_init(proxfusion3_t *ctx, proxfusion3_cfg_t *cfg)
ProxFusion 3 initialization function.
void proxfusion3_set_even_mode(proxfusion3_t *ctx, uint8_t mode)
ProxFusion 3 set even mode function.
void proxfusion3_en_abs_cap(proxfusion3_t *ctx)
ProxFusion 3 enables the absolute capacitiance function.
uint8_t proxfusion3_get_touch(proxfusion3_t *ctx)
ProxFusion 3 get touch function.
float proxfusion3_get_absolute_measurement(proxfusion3_t *ctx)
ProxFusion 3 get absolute measurement function.
uint8_t proxfusion3_get_gestures(proxfusion3_t *ctx)
ProxFusion 3 get gestures function.
void proxfusion3_sw_reset(proxfusion3_t *ctx)
ProxFusion 3 software reset function.
void proxfusion3_write_reg(proxfusion3_t *ctx, uint8_t reg, uint16_t tx_data)
ProxFusion 3 I2C register writing function.
err_t proxfusion3_generic_read(proxfusion3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
ProxFusion 3 I2C reading function.
void proxfusion3_auto_tune(proxfusion3_t *ctx)
ProxFusion 3 auto tune function.
uint8_t proxfusion3_get_state_gp_pin(proxfusion3_t *ctx)
ProxFusion 3 get state of GP pin function.
uint16_t proxfusion3_read_channel_delta(proxfusion3_t *ctx, uint8_t channel)
ProxFusion 3 read channel delta function.
void proxfusion3_adjust_touch_thresholds(proxfusion3_t *ctx)
ProxFusion 3 adjust touch thresholds function.
void proxfusion3_cfg_setup(proxfusion3_cfg_t *cfg)
ProxFusion 3 configuration object setup function.
err_t proxfusion3_generic_write(proxfusion3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
ProxFusion 3 I2C writing function.
uint16_t proxfusion3_read_reg(proxfusion3_t *ctx, uint8_t reg)
ProxFusion 3 I2C register reading function.
ProxFusion 3 Click configuration object.
Definition: proxfusion3.h:677
pin_name_t gp
Definition: proxfusion3.h:681
uint32_t i2c_speed
Definition: proxfusion3.h:684
pin_name_t scl
Definition: proxfusion3.h:678
pin_name_t int_pin
Definition: proxfusion3.h:682
pin_name_t sda
Definition: proxfusion3.h:679
uint8_t i2c_address
Definition: proxfusion3.h:685
ProxFusion 3 Click context object.
Definition: proxfusion3.h:653
i2c_master_t i2c
Definition: proxfusion3.h:664
digital_out_t int_pin
Definition: proxfusion3.h:656
uint8_t slave_address
Definition: proxfusion3.h:668
digital_in_t gp
Definition: proxfusion3.h:660