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
39#ifdef PREINIT_SUPPORTED
40#include "preinit.h"
41#endif
42
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
45 #include "delays.h"
46 #endif
47#endif
48
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
52
53
54
55
81#define PROXFUSION3_DEVICE_INFO 0x00
82
87#define PROXFUSION3_SYS_FLAGS 0x02
88
93#define PROXFUSION3_GESTURE_FLAGS 0x03
94
99#define PROXFUSION3_CH_PROX_STATE 0x04
100#define PROXFUSION3_CH_TOUCH_STATE 0x05
101
106#define PROXFUSION3_ACF_CH0 0x08
107#define PROXFUSION3_ACF_CH1 0x0A
108#define PROXFUSION3_ACF_CH2 0x0C
109#define PROXFUSION3_ACF_CH3 0x0E
110#define PROXFUSION3_ACF_CH4 0x10
111#define PROXFUSION3_ACF_CH5 0x12
112#define PROXFUSION3_ACF_CH6 0x14
113#define PROXFUSION3_ACF_CH7 0x16
114
119#define PROXFUSION3_LTA_CH0 0x09
120#define PROXFUSION3_LTA_CH1 0x0B
121#define PROXFUSION3_LTA_CH2 0x0D
122#define PROXFUSION3_LTA_CH3 0x0F
123#define PROXFUSION3_LTA_CH4 0x11
124#define PROXFUSION3_LTA_CH5 0x13
125#define PROXFUSION3_LTA_CH6 0x15
126#define PROXFUSION3_LTA_CH7 0x17
127
132#define PROXFUSION3_DELTA_CH0 0x18
133#define PROXFUSION3_DELTA_CH1 0x19
134#define PROXFUSION3_DELTA_CH2 0x1A
135#define PROXFUSION3_DELTA_CH3 0x1B
136#define PROXFUSION3_DELTA_CH4 0x1C
137#define PROXFUSION3_DELTA_CH5 0x1D
138#define PROXFUSION3_DELTA_CH6 0x1E
139#define PROXFUSION3_DELTA_CH7 0x1F
140
145#define PROXFUSION3_REFDELTA_CH0 0x20
146#define PROXFUSION3_REFDELTA_CH1 0x21
147#define PROXFUSION3_REFDELTA_CH2 0x22
148#define PROXFUSION3_REFDELTA_CH3 0x23
149#define PROXFUSION3_REFDELTA_CH4 0x24
150#define PROXFUSION3_REFDELTA_CH5 0x25
151#define PROXFUSION3_REFDELTA_CH6 0x26
152#define PROXFUSION3_REFDELTA_CH7 0x27
153
158#define PROXFUSION3_COORDINATES 0x30
159
164#define PROXFUSION3_CAP_ABS_BASE 0x31
165#define PROXFUSION3_CAP_ABS_CS 0x32
166#define PROXFUSION3_CAP_ABS_CS_CAP0 0x33
167#define PROXFUSION3_CAP_ABS_CS_CAP1 0x34
168
173#define PROXFUSION3_PMU_SETTINGS 0x80
174#define PROXFUSION3_ACTIVE_CHANNELS 0x81
175#define PROXFUSION3_CH_RESEED 0x82
176
181#define PROXFUSION3_REPORT_RATES 0x83
182#define PROXFUSION3_ULP_MODE_RATES 0x84
183#define PROXFUSION3_TIMEOUT_PERIODS 0x85
184
189#define PROXFUSION3_GEN_SETINGS 0x86
190#define PROXFUSION3_REF_SETTINGS 0x87
191#define PROXFUSION3_EVENT_SETTINGS 0x88
192
197#define PROXFUSION3_SLIDER0_CH 0x89
198#define PROXFUSION3_TAP_SETTINGS 0x8A
199#define PROXFUSION3_SWIPE_SETTINGS 0x8B
200
205#define PROXFUSION3_CH0_SETTINGS 0x8C
206#define PROXFUSION3_CH1_SETTINGS 0x93
207#define PROXFUSION3_CH3_SETTINGS 0x9A
208#define PROXFUSION3_CH4_SETTINGS 0xA1
209#define PROXFUSION3_CH5_SETTINGS 0xA8
210#define PROXFUSION3_CH6_SETTINGS 0xAF
211#define PROXFUSION3_CH7_SETTINGS 0xB6
212#define PROXFUSION3_CH8_SETTINGS 0xBD
213#define PROXFUSION3_CHx_REF_ASSOC 0x92
214#define PROXFUSION3_CH6_PROX_SETTINGS 0xB7
215#define PROXFUSION3_CH6_ATI_MIRROR 0xB9
216#define PROXFUSION3_CH7_ATI_MIRROR 0xC0
217#define PROXFUSION3_ATI_TARGETS 0x8E
218
223#define PROXFUSION3_ENG_DIRECT_ADDRESS 0xF0
224#define PROXFUSION3_ENG_DIRECT_DATA 0xF1
225#define PROXFUSION3_ENG_I2C_SETTINGS 0xF2
226#define PROXFUSION3_ENG_LAST_CONV_LSB 0xF3
227#define PROXFUSION3_ENG_LAST_CONV_MSB 0xF4
228#define PROXFUSION3_ENG_PXS_DETECTION 0xF5
229
230 // proxfusion3_reg
231
246#define PROXFUSION3_PRODUCT_NUM 0x4F
247#define PROXFUSION3_SW_NUM_V1 0x02
248#define PROXFUSION3_SW_NUM_V2 0x03
249
254#define PROXFUSION3_NP_SEG_ACTIVE_BIT 0x01
255#define PROXFUSION3_GO_TO_NP_BIT 0x02
256#define PROXFUSION3_IN_ATI_BIT 0x04
257#define PROXFUSION3_NP_MODE_BITS 0x00
258#define PROXFUSION3_LP_MODE_BITS 0x08
259#define PROXFUSION3_ULP_MODE_BITS 0x10
260#define PROXFUSION3_HALT_MODE_BITS 0x18
261#define PROXFUSION3_SHOW_RESET_BIT 0x80
262
267#define PROXFUSION3_PROX_EVENT_BIT 0x01
268#define PROXFUSION3_TOUCH_EVENT_BIT 0x02
269#define PROXFUSION3_DEEP_EVENT_BIT 0x04
270#define PROXFUSION3_GESTURE_EVENT_BIT 0x08
271#define PROXFUSION3_MOV_EVENT_BIT 0x10
272#define PROXFUSION3_REF_EVENT_BIT 0x20
273#define PROXFUSION3_SYS_EVENT_BIT 0x40
274#define PROXFUSION3_LP_EVENT_BIT 0x80
275
280#define PROXFUSION3_TAP0_BIT 0x01
281#define PROXFUSION3_HOLD0_BIT 0x02
282#define PROXFUSION3_SWIPE_UP_BIT 0x04
283#define PROXFUSION3_SWIPE_DOWN_BIT 0x08
284#define PROXFUSION3_TAP1_BIT 0x10
285#define PROXFUSION3_HOLD1_BIT 0x20
286#define PROXFUSION3_SWIPE_LEFT_BIT 0x40
287#define PROXFUSION3_SWIPE_RIGHT_BIT 0x80
288
293#define PROXFUSION3_ACK_RESET_BIT 0x01
294#define PROXFUSION3_SOFT_RESET_BIT 0x02
295#define PROXFUSION3_REDO_ATI_BIT 0x04
296#define PROXFUSION3_EVENT_MODE_BIT 0x20
297
302#define PROXFUSION3_DISABLE_CH6_ATI 0xA0
303#define PROXFUSION3_ENABLE_ABSCAP_UI 0x08
304#define PROXFUSION3_ENABLE_4MHZ_FOSC 0x80
305#define PROXFUSION3_DISABLE_AUTO_MODE 0x20
306
312#define PROXFUSION3_PMU_GENERAL_SETTINGS 0x41
313#define PROXFUSION3_I2C_GENERAL_SETTINGS 0x00
314#define PROXFUSION3_SYS_CHB_ACTIVE 0xFF
315#define PROXFUSION3_ACF_LTA_FILTER_SETTINGS 0xC4
316#define PROXFUSION3_LTA_CHB_RESEED_ENABLED 0xFF
317#define PROXFUSION3_UIS_GLOBAL_EVENTS_MASK 0x00
318
324#define PROXFUSION3_PMU_REPORT_RATE_NP 0x10
325#define PROXFUSION3_PMU_REPORT_RATE_LP 0xA0
326#define PROXFUSION3_PMU_REPORT_RATE_ULP 0x0D
327#define PROXFUSION3_PMU_MODE_TIMOUT 0x0A
328#define PROXFUSION3_I2C_WINDOW_TIMEOUT 0x14
329#define PROXFUSION3_LTA_HALT_TIMEOUT 0x14
330
336#define PROXFUSION3_PXS_GENERAL_SETTINGS0 0x00
337#define PROXFUSION3_PXS_GENERAL_SETTINGS1 0x00
338#define PROXFUSION3_UIS_ABSOLUTE_CAPACITANCE 0x00
339#define PROXFUSION3_UIS_DCF_GENERAL_SETTINGS 0x11
340#define PROXFUSION3_GEM_CHB_BLOCK_NFOLLOW 0x00
341#define PROXFUSION3_MOV_CHB_MOVEMENT_CHANNEL 0x00
342#define PROXFUSION3_UIS_CHB_SLIDER0 0x78
343#define PROXFUSION3_UIS_CHB_SLIDER1 0x06
344#define PROXFUSION3_UIS_GESTURE_TAP_TIMEOUT 0x40
345#define PROXFUSION3_UIS_GESTURE_SWIPE_TIMEOUT 0xBB
346#define PROXFUSION3_UIS_GESTURE_THRESHOLD 0x80
347#define PROXFUSION3_LTA_CHB_RESEED 0x00
348
354#define PROXFUSION3_PXS_CRXSEL_CH0 0xFF
355#define PROXFUSION3_PXS_CTXSEL_CH0 0xFF
356#define PROXFUSION3_PXS_PROXCTRL_CH0 0xA3
357#define PROXFUSION3_PXS_PROXCFG0_CH0 0x40
358#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH0 0x06
359#define PROXFUSION3_ATI_BASE_AND_TARGET_CH0 0x90
360#define PROXFUSION3_ATI_MIRROR_CH0 0x2C
361#define PROXFUSION3_ATI_PCC_CH0 0xCD
362#define PROXFUSION3_PXS_PROX_THRESHOLD_CH0 0x04
363#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH0 0x09
364#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH0 0x10
365#define PROXFUSION3_PXS_HYSTERESIS_CH0 0x04
366#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH0 0x00
367#define PROXFUSION3_DCF_WEIGHT_CH0 0x00
368
374#define PROXFUSION3_PXS_CRXSEL_CH1 0x3A
375#define PROXFUSION3_PXS_CTXSEL_CH1 0xFF
376#define PROXFUSION3_PXS_PROXCTRL_CH1 0xA3
377#define PROXFUSION3_PXS_PROXCFG0_CH1 0x40
378#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH1 0x06
379#define PROXFUSION3_ATI_BASE_AND_TARGET_CH1 0x90
380#define PROXFUSION3_ATI_MIRROR_CH1 0x29
381#define PROXFUSION3_ATI_PCC_CH1 0xC6
382#define PROXFUSION3_PXS_PROX_THRESHOLD_CH1 0x04
383#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH1 0x09
384#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH1 0x10
385#define PROXFUSION3_PXS_HYSTERESIS_CH1 0x04
386#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH1 0x00
387#define PROXFUSION3_DCF_WEIGHT_CH1 0x00
388
394#define PROXFUSION3_PXS_CRXSEL_CH2 0xC5
395#define PROXFUSION3_PXS_CTXSEL_CH2 0xFF
396#define PROXFUSION3_PXS_PROXCTRL_CH2 0xA3
397#define PROXFUSION3_PXS_PROXCFG0_CH2 0x40
398#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH2 0x06
399#define PROXFUSION3_ATI_BASE_AND_TARGET_CH2 0x90
400#define PROXFUSION3_ATI_MIRROR_CH2 0x29
401#define PROXFUSION3_ATI_PCC_CH2 0xC0
402#define PROXFUSION3_PXS_PROX_THRESHOLD_CH2 0x04
403#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH2 0x09
404#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH2 0x10
405#define PROXFUSION3_PXS_HYSTERESIS_CH2 0x04
406#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH2 0x00
407#define PROXFUSION3_DCF_WEIGHT_CH2 0x00
408
414#define PROXFUSION3_PXS_CRXSEL_CH3 0x90
415#define PROXFUSION3_PXS_CTXSEL_CH3 0xFF
416#define PROXFUSION3_PXS_PROXCTRL_CH3 0xA3
417#define PROXFUSION3_PXS_PROXCFG0_CH3 0x40
418#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH3 0x06
419#define PROXFUSION3_ATI_BASE_AND_TARGET_CH3 0x90
420#define PROXFUSION3_ATI_MIRROR_CH3 0x1E
421#define PROXFUSION3_ATI_PCC_CH3 0xC8
422#define PROXFUSION3_PXS_PROX_THRESHOLD_CH3 0x0A
423#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH3 0x10
424#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH3 0x30
425#define PROXFUSION3_PXS_HYSTERESIS_CH3 0x04
426#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH3 0x00
427#define PROXFUSION3_DCF_WEIGHT_CH3 0x00
428
434#define PROXFUSION3_PXS_CRXSEL_CH4 0x42
435#define PROXFUSION3_PXS_CTXSEL_CH4 0xFF
436#define PROXFUSION3_PXS_PROXCTRL_CH4 0xA3
437#define PROXFUSION3_PXS_PROXCFG0_CH4 0x40
438#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH4 0x06
439#define PROXFUSION3_ATI_BASE_AND_TARGET_CH4 0x90
440#define PROXFUSION3_ATI_MIRROR_CH4 0x1E
441#define PROXFUSION3_ATI_PCC_CH4 0xCA
442#define PROXFUSION3_PXS_PROX_THRESHOLD_CH4 0x0A
443#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH4 0x10
444#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH4 0x30
445#define PROXFUSION3_PXS_HYSTERESIS_CH4 0x04
446#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH4 0x00
447#define PROXFUSION3_DCF_WEIGHT_CH4 0x00
448
454#define PROXFUSION3_PXS_CRXSEL_CH5 0x21
455#define PROXFUSION3_PXS_CTXSEL_CH5 0xFF
456#define PROXFUSION3_PXS_PROXCTRL_CH5 0xA3
457#define PROXFUSION3_PXS_PROXCFG0_CH5 0x40
458#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH5 0x06
459#define PROXFUSION3_ATI_BASE_AND_TARGET_CH5 0x90
460#define PROXFUSION3_ATI_MIRROR_CH5 0x1E
461#define PROXFUSION3_ATI_PCC_CH5 0xD0
462#define PROXFUSION3_PXS_PROX_THRESHOLD_CH5 0x0A
463#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH5 0x10
464#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH5 0x30
465#define PROXFUSION3_PXS_HYSTERESIS_CH5 0x04
466#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH5 0x00
467#define PROXFUSION3_DCF_WEIGHT_CH5 0x00
468
474#define PROXFUSION3_PXS_CRXSEL_CH6 0x0C
475#define PROXFUSION3_PXS_CTXSEL_CH6 0xFF
476#define PROXFUSION3_PXS_PROXCTRL_CH6 0xA3
477#define PROXFUSION3_PXS_PROXCFG0_CH6 0x40
478#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH6 0x06
479#define PROXFUSION3_ATI_BASE_AND_TARGET_CH6 0x90
480#define PROXFUSION3_ATI_MIRROR_CH6 0x26
481#define PROXFUSION3_ATI_PCC_CH6 0xCB
482#define PROXFUSION3_PXS_PROX_THRESHOLD_CH6 0x0A
483#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH6 0x10
484#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH6 0x30
485#define PROXFUSION3_PXS_HYSTERESIS_CH6 0x04
486#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH6 0x00
487#define PROXFUSION3_DCF_WEIGHT_CH6 0x00
488
494#define PROXFUSION3_PXS_CRXSEL_CH7 0x01
495#define PROXFUSION3_PXS_CTXSEL_CH7 0xFF
496#define PROXFUSION3_PXS_PROXCTRL_CH7 0xA3
497#define PROXFUSION3_PXS_PROXCFG0_CH7 0xDE
498#define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH7 0x01
499#define PROXFUSION3_ATI_BASE_AND_TARGET_CH7 0xD0
500#define PROXFUSION3_ATI_MIRROR_CH7 0x57
501#define PROXFUSION3_ATI_PCC_CH7 0x60
502#define PROXFUSION3_PXS_PROX_THRESHOLD_CH7 0x0A
503#define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH7 0x08
504#define PROXFUSION3_PXS_DEEP_THRESHOLD_CH7 0x1A
505#define PROXFUSION3_PXS_HYSTERESIS_CH7 0x04
506#define PROXFUSION3_DCF_CHB_ASSOCIATION_CH7 0x00
507#define PROXFUSION3_DCF_WEIGHT_CH7 0x00
508
509//
515#define PROXFUSION3_CH0_CRX 0x8C
516#define PROXFUSION3_CH1_CRX 0x93
517#define PROXFUSION3_CH2_CRX 0x9A
518#define PROXFUSION3_CH3_CRX 0xA1
519#define PROXFUSION3_CH4_CRX 0xA8
520#define PROXFUSION3_CH5_CRX 0xAF
521#define PROXFUSION3_CH6_CRX 0xB6
522#define PROXFUSION3_CH7_CRX 0xBD
523
528#define PROXFUSION3_TOUCH_NUMB_1 0x13
529#define PROXFUSION3_TOUCH_NUMB_2 0x27
530#define PROXFUSION3_TOUCH_NUMB_3 0x4E
531#define PROXFUSION3_TOUCH_NUMB_4 0x0C
532#define PROXFUSION3_TOUCH_NUMB_5 0x30
533#define PROXFUSION3_TOUCH_NUMB_6 0x70
534#define PROXFUSION3_TOUCH_NUMB_7 0x60
535#define PROXFUSION3_TOUCH_NUMB_8 0x40
536
541#define PROXFUSION3_TOUCH_CRX_0 0x01
542#define PROXFUSION3_TOUCH_CRX_1 0x02
543#define PROXFUSION3_TOUCH_CRX_2 0x04
544#define PROXFUSION3_TOUCH_CRX_3 0x08
545#define PROXFUSION3_TOUCH_CRX_4 0x10
546#define PROXFUSION3_TOUCH_CRX_5 0x20
547#define PROXFUSION3_TOUCH_CRX_6 0x40
548#define PROXFUSION3_TOUCH_CRX_7 0x80
549
554#define PROXFUSION3_TOUCH_POS_NO_TOUCH 0x00
555#define PROXFUSION3_TOUCH_POS_1 0x01
556#define PROXFUSION3_TOUCH_POS_2 0x02
557#define PROXFUSION3_TOUCH_POS_3 0x03
558#define PROXFUSION3_TOUCH_POS_4 0x04
559#define PROXFUSION3_TOUCH_POS_5 0x05
560#define PROXFUSION3_TOUCH_POS_6 0x06
561#define PROXFUSION3_TOUCH_POS_7 0x07
562#define PROXFUSION3_TOUCH_POS_8 0x08
563
568#define PROXFUSION3_CH0_PT_T 0x90
569#define PROXFUSION3_CH1_PT_T 0x97
570#define PROXFUSION3_CH2_PT_T 0x9E
571#define PROXFUSION3_CH3_PT_T 0xA5
572#define PROXFUSION3_CH4_PT_T 0xAC
573#define PROXFUSION3_CH5_PT_T 0xB3
574#define PROXFUSION3_CH6_PT_T 0xBA
575#define PROXFUSION3_CH7_PT_T 0xC1
576
581#define PROXFUSION3_CH0_DT_T 0x91
582#define PROXFUSION3_CH1_DT_T 0x98
583#define PROXFUSION3_CH2_DT_T 0x9F
584#define PROXFUSION3_CH3_DT_T 0xA6
585#define PROXFUSION3_CH4_DT_T 0xAD
586#define PROXFUSION3_CH5_DT_T 0xB4
587#define PROXFUSION3_CH6_DT_T 0xBB
588#define PROXFUSION3_CH7_DT_T 0xC2
589
594#define PROXFUSION3_EVENT_NO_TOUCH 0x00
595#define PROXFUSION3_EVENT_TOUCH 0x01
596
602#define PROXFUSION3_SET_DEV_ADDR 0x44
603
609#define PROXFUSION3_SET_PIN_STATE_LOW 0x00
610#define PROXFUSION3_SET_PIN_STATE_HIGH 0x01
611
617#define PROXFUSION3_PROX_THRESHOLD 10
618#define PROXFUSION3_TOUCH_THRESHOLD_CH0 22
619#define PROXFUSION3_TOUCH_THRESHOLD_CH1 20
620#define PROXFUSION3_TOUCH_THRESHOLD_CH2 10
621#define PROXFUSION3_TOUCH_THRESHOLD_CH3 10
622#define PROXFUSION3_TOUCH_THRESHOLD_CH4 22
623#define PROXFUSION3_TOUCH_THRESHOLD_CH5 20
624#define PROXFUSION3_TOUCH_THRESHOLD_CH6 12
625#define PROXFUSION3_TOUCH_THRESHOLD_CH7 10
626#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH0 32
627#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH1 26
628#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH2 26
629#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH3 26
630#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH4 32
631#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH5 26
632#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH6 26
633#define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH7 26
634#define PROXFUSION3_TOUCH_CH_RX_THRESHOLD_7 16384
635
636
637 // proxfusion3_set
638
653#define PROXFUSION3_MAP_MIKROBUS( cfg, mikrobus ) \
654 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
655 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
656 cfg.gp = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
657 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
658
659 // proxfusion3_map
660 // proxfusion3
661
666typedef struct
667{
668 // Output pins
669
670 digital_out_t int_pin;
672 // Input pins
673
674 digital_in_t gp;
676 // Modules
677
678 i2c_master_t i2c;
680 // I2C slave address
681
685
690typedef struct
691{
692 pin_name_t scl;
693 pin_name_t sda;
695 pin_name_t gp;
696 pin_name_t int_pin;
698 uint32_t i2c_speed;
699 uint8_t i2c_address;
702
721
739
756
769void proxfusion3_set_state_int_pin ( proxfusion3_t *ctx, uint8_t pin_state );
770
784
802err_t proxfusion3_generic_write ( proxfusion3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len );
803
821err_t proxfusion3_generic_read ( proxfusion3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len );
822
837void proxfusion3_write_reg ( proxfusion3_t *ctx, uint8_t reg, uint16_t tx_data );
838
852uint16_t proxfusion3_read_reg ( proxfusion3_t *ctx, uint8_t reg );
853
870err_t proxfusion3_get_version_info ( proxfusion3_t *ctx, uint8_t *product_number, uint8_t *software_version );
871
887
902
917
932
947
963
986void proxfusion3_set_event ( proxfusion3_t *ctx, uint8_t event );
987
1003
1018uint16_t proxfusion3_read_channel_delta ( proxfusion3_t *ctx, uint8_t channel );
1019
1035
1058
1074
1097void proxfusion3_set_even_mode ( proxfusion3_t *ctx, uint8_t mode );
1098
1113
1129
1130#ifdef __cplusplus
1131}
1132#endif
1133#endif // PROXFUSION3_H
1134
1135 // proxfusion3
1136
1137// ------------------------------------------------------------------------ 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:691
pin_name_t gp
Definition proxfusion3.h:695
uint32_t i2c_speed
Definition proxfusion3.h:698
pin_name_t scl
Definition proxfusion3.h:692
pin_name_t int_pin
Definition proxfusion3.h:696
pin_name_t sda
Definition proxfusion3.h:693
uint8_t i2c_address
Definition proxfusion3.h:699
ProxFusion 3 Click context object.
Definition proxfusion3.h:667
i2c_master_t i2c
Definition proxfusion3.h:678
digital_out_t int_pin
Definition proxfusion3.h:670
uint8_t slave_address
Definition proxfusion3.h:682
digital_in_t gp
Definition proxfusion3.h:674