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
32 extern "C"{
33 #endif
34 
35 #include "mikrosdk_version.h"
36 
37 #ifdef __GNUC__
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
40 #else
41 #include "delays.h"
42 #endif
43 #endif
44 
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_i2c_master.h"
48 
49 
50 
51 
77 #define PROXFUSION3_DEVICE_INFO 0x00
78 
83 #define PROXFUSION3_SYS_FLAGS 0x02
84 
89 #define PROXFUSION3_GESTURE_FLAGS 0x03
90 
95 #define PROXFUSION3_CH_PROX_STATE 0x04
96 #define PROXFUSION3_CH_TOUCH_STATE 0x05
97 
102 #define PROXFUSION3_ACF_CH0 0x08
103 #define PROXFUSION3_ACF_CH1 0x0A
104 #define PROXFUSION3_ACF_CH2 0x0C
105 #define PROXFUSION3_ACF_CH3 0x0E
106 #define PROXFUSION3_ACF_CH4 0x10
107 #define PROXFUSION3_ACF_CH5 0x12
108 #define PROXFUSION3_ACF_CH6 0x14
109 #define PROXFUSION3_ACF_CH7 0x16
110 
115 #define PROXFUSION3_LTA_CH0 0x09
116 #define PROXFUSION3_LTA_CH1 0x0B
117 #define PROXFUSION3_LTA_CH2 0x0D
118 #define PROXFUSION3_LTA_CH3 0x0F
119 #define PROXFUSION3_LTA_CH4 0x11
120 #define PROXFUSION3_LTA_CH5 0x13
121 #define PROXFUSION3_LTA_CH6 0x15
122 #define PROXFUSION3_LTA_CH7 0x17
123 
128 #define PROXFUSION3_DELTA_CH0 0x18
129 #define PROXFUSION3_DELTA_CH1 0x19
130 #define PROXFUSION3_DELTA_CH2 0x1A
131 #define PROXFUSION3_DELTA_CH3 0x1B
132 #define PROXFUSION3_DELTA_CH4 0x1C
133 #define PROXFUSION3_DELTA_CH5 0x1D
134 #define PROXFUSION3_DELTA_CH6 0x1E
135 #define PROXFUSION3_DELTA_CH7 0x1F
136 
141 #define PROXFUSION3_REFDELTA_CH0 0x20
142 #define PROXFUSION3_REFDELTA_CH1 0x21
143 #define PROXFUSION3_REFDELTA_CH2 0x22
144 #define PROXFUSION3_REFDELTA_CH3 0x23
145 #define PROXFUSION3_REFDELTA_CH4 0x24
146 #define PROXFUSION3_REFDELTA_CH5 0x25
147 #define PROXFUSION3_REFDELTA_CH6 0x26
148 #define PROXFUSION3_REFDELTA_CH7 0x27
149 
154 #define PROXFUSION3_COORDINATES 0x30
155 
160 #define PROXFUSION3_CAP_ABS_BASE 0x31
161 #define PROXFUSION3_CAP_ABS_CS 0x32
162 #define PROXFUSION3_CAP_ABS_CS_CAP0 0x33
163 #define PROXFUSION3_CAP_ABS_CS_CAP1 0x34
164 
169 #define PROXFUSION3_PMU_SETTINGS 0x80
170 #define PROXFUSION3_ACTIVE_CHANNELS 0x81
171 #define PROXFUSION3_CH_RESEED 0x82
172 
177 #define PROXFUSION3_REPORT_RATES 0x83
178 #define PROXFUSION3_ULP_MODE_RATES 0x84
179 #define PROXFUSION3_TIMEOUT_PERIODS 0x85
180 
185 #define PROXFUSION3_GEN_SETINGS 0x86
186 #define PROXFUSION3_REF_SETTINGS 0x87
187 #define PROXFUSION3_EVENT_SETTINGS 0x88
188 
193 #define PROXFUSION3_SLIDER0_CH 0x89
194 #define PROXFUSION3_TAP_SETTINGS 0x8A
195 #define PROXFUSION3_SWIPE_SETTINGS 0x8B
196 
201 #define PROXFUSION3_CH0_SETTINGS 0x8C
202 #define PROXFUSION3_CH1_SETTINGS 0x93
203 #define PROXFUSION3_CH3_SETTINGS 0x9A
204 #define PROXFUSION3_CH4_SETTINGS 0xA1
205 #define PROXFUSION3_CH5_SETTINGS 0xA8
206 #define PROXFUSION3_CH6_SETTINGS 0xAF
207 #define PROXFUSION3_CH7_SETTINGS 0xB6
208 #define PROXFUSION3_CH8_SETTINGS 0xBD
209 #define PROXFUSION3_CHx_REF_ASSOC 0x92
210 #define PROXFUSION3_CH6_PROX_SETTINGS 0xB7
211 #define PROXFUSION3_CH6_ATI_MIRROR 0xB9
212 #define PROXFUSION3_CH7_ATI_MIRROR 0xC0
213 #define PROXFUSION3_ATI_TARGETS 0x8E
214 
219 #define PROXFUSION3_ENG_DIRECT_ADDRESS 0xF0
220 #define PROXFUSION3_ENG_DIRECT_DATA 0xF1
221 #define PROXFUSION3_ENG_I2C_SETTINGS 0xF2
222 #define PROXFUSION3_ENG_LAST_CONV_LSB 0xF3
223 #define PROXFUSION3_ENG_LAST_CONV_MSB 0xF4
224 #define PROXFUSION3_ENG_PXS_DETECTION 0xF5
225  // proxfusion3_reg
227 
242 #define PROXFUSION3_PRODUCT_NUM 0x4F
243 #define PROXFUSION3_SW_NUM_V1 0x02
244 #define PROXFUSION3_SW_NUM_V2 0x03
245 
250 #define PROXFUSION3_NP_SEG_ACTIVE_BIT 0x01
251 #define PROXFUSION3_GO_TO_NP_BIT 0x02
252 #define PROXFUSION3_IN_ATI_BIT 0x04
253 #define PROXFUSION3_NP_MODE_BITS 0x00
254 #define PROXFUSION3_LP_MODE_BITS 0x08
255 #define PROXFUSION3_ULP_MODE_BITS 0x10
256 #define PROXFUSION3_HALT_MODE_BITS 0x18
257 #define PROXFUSION3_SHOW_RESET_BIT 0x80
258 
263 #define PROXFUSION3_PROX_EVENT_BIT 0x01
264 #define PROXFUSION3_TOUCH_EVENT_BIT 0x02
265 #define PROXFUSION3_DEEP_EVENT_BIT 0x04
266 #define PROXFUSION3_GESTURE_EVENT_BIT 0x08
267 #define PROXFUSION3_MOV_EVENT_BIT 0x10
268 #define PROXFUSION3_REF_EVENT_BIT 0x20
269 #define PROXFUSION3_SYS_EVENT_BIT 0x40
270 #define PROXFUSION3_LP_EVENT_BIT 0x80
271 
276 #define PROXFUSION3_TAP0_BIT 0x01
277 #define PROXFUSION3_HOLD0_BIT 0x02
278 #define PROXFUSION3_SWIPE_UP_BIT 0x04
279 #define PROXFUSION3_SWIPE_DOWN_BIT 0x08
280 #define PROXFUSION3_TAP1_BIT 0x10
281 #define PROXFUSION3_HOLD1_BIT 0x20
282 #define PROXFUSION3_SWIPE_LEFT_BIT 0x40
283 #define PROXFUSION3_SWIPE_RIGHT_BIT 0x80
284 
289 #define PROXFUSION3_ACK_RESET_BIT 0x01
290 #define PROXFUSION3_SOFT_RESET_BIT 0x02
291 #define PROXFUSION3_REDO_ATI_BIT 0x04
292 #define PROXFUSION3_EVENT_MODE_BIT 0x20
293 
298 #define PROXFUSION3_DISABLE_CH6_ATI 0xA0
299 #define PROXFUSION3_ENABLE_ABSCAP_UI 0x08
300 #define PROXFUSION3_ENABLE_4MHZ_FOSC 0x80
301 #define PROXFUSION3_DISABLE_AUTO_MODE 0x20
302 
308 #define PROXFUSION3_PMU_GENERAL_SETTINGS 0x41
309 #define PROXFUSION3_I2C_GENERAL_SETTINGS 0x00
310 #define PROXFUSION3_SYS_CHB_ACTIVE 0xFF
311 #define PROXFUSION3_ACF_LTA_FILTER_SETTINGS 0xC4
312 #define PROXFUSION3_LTA_CHB_RESEED_ENABLED 0xFF
313 #define PROXFUSION3_UIS_GLOBAL_EVENTS_MASK 0x00
314 
320 #define PROXFUSION3_PMU_REPORT_RATE_NP 0x10
321 #define PROXFUSION3_PMU_REPORT_RATE_LP 0xA0
322 #define PROXFUSION3_PMU_REPORT_RATE_ULP 0x0D
323 #define PROXFUSION3_PMU_MODE_TIMOUT 0x0A
324 #define PROXFUSION3_I2C_WINDOW_TIMEOUT 0x14
325 #define PROXFUSION3_LTA_HALT_TIMEOUT 0x14
326 
332 #define PROXFUSION3_PXS_GENERAL_SETTINGS0 0x00
333 #define PROXFUSION3_PXS_GENERAL_SETTINGS1 0x00
334 #define PROXFUSION3_UIS_ABSOLUTE_CAPACITANCE 0x00
335 #define PROXFUSION3_UIS_DCF_GENERAL_SETTINGS 0x11
336 #define PROXFUSION3_GEM_CHB_BLOCK_NFOLLOW 0x00
337 #define PROXFUSION3_MOV_CHB_MOVEMENT_CHANNEL 0x00
338 #define PROXFUSION3_UIS_CHB_SLIDER0 0x78
339 #define PROXFUSION3_UIS_CHB_SLIDER1 0x06
340 #define PROXFUSION3_UIS_GESTURE_TAP_TIMEOUT 0x40
341 #define PROXFUSION3_UIS_GESTURE_SWIPE_TIMEOUT 0xBB
342 #define PROXFUSION3_UIS_GESTURE_THRESHOLD 0x80
343 #define PROXFUSION3_LTA_CHB_RESEED 0x00
344 
350 #define PROXFUSION3_PXS_CRXSEL_CH0 0xFF
351 #define PROXFUSION3_PXS_CTXSEL_CH0 0xFF
352 #define PROXFUSION3_PXS_PROXCTRL_CH0 0xA3
353 #define PROXFUSION3_PXS_PROXCFG0_CH0 0x40
354 #define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH0 0x06
355 #define PROXFUSION3_ATI_BASE_AND_TARGET_CH0 0x90
356 #define PROXFUSION3_ATI_MIRROR_CH0 0x2C
357 #define PROXFUSION3_ATI_PCC_CH0 0xCD
358 #define PROXFUSION3_PXS_PROX_THRESHOLD_CH0 0x04
359 #define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH0 0x09
360 #define PROXFUSION3_PXS_DEEP_THRESHOLD_CH0 0x10
361 #define PROXFUSION3_PXS_HYSTERESIS_CH0 0x04
362 #define PROXFUSION3_DCF_CHB_ASSOCIATION_CH0 0x00
363 #define PROXFUSION3_DCF_WEIGHT_CH0 0x00
364 
370 #define PROXFUSION3_PXS_CRXSEL_CH1 0x3A
371 #define PROXFUSION3_PXS_CTXSEL_CH1 0xFF
372 #define PROXFUSION3_PXS_PROXCTRL_CH1 0xA3
373 #define PROXFUSION3_PXS_PROXCFG0_CH1 0x40
374 #define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH1 0x06
375 #define PROXFUSION3_ATI_BASE_AND_TARGET_CH1 0x90
376 #define PROXFUSION3_ATI_MIRROR_CH1 0x29
377 #define PROXFUSION3_ATI_PCC_CH1 0xC6
378 #define PROXFUSION3_PXS_PROX_THRESHOLD_CH1 0x04
379 #define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH1 0x09
380 #define PROXFUSION3_PXS_DEEP_THRESHOLD_CH1 0x10
381 #define PROXFUSION3_PXS_HYSTERESIS_CH1 0x04
382 #define PROXFUSION3_DCF_CHB_ASSOCIATION_CH1 0x00
383 #define PROXFUSION3_DCF_WEIGHT_CH1 0x00
384 
390 #define PROXFUSION3_PXS_CRXSEL_CH2 0xC5
391 #define PROXFUSION3_PXS_CTXSEL_CH2 0xFF
392 #define PROXFUSION3_PXS_PROXCTRL_CH2 0xA3
393 #define PROXFUSION3_PXS_PROXCFG0_CH2 0x40
394 #define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH2 0x06
395 #define PROXFUSION3_ATI_BASE_AND_TARGET_CH2 0x90
396 #define PROXFUSION3_ATI_MIRROR_CH2 0x29
397 #define PROXFUSION3_ATI_PCC_CH2 0xC0
398 #define PROXFUSION3_PXS_PROX_THRESHOLD_CH2 0x04
399 #define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH2 0x09
400 #define PROXFUSION3_PXS_DEEP_THRESHOLD_CH2 0x10
401 #define PROXFUSION3_PXS_HYSTERESIS_CH2 0x04
402 #define PROXFUSION3_DCF_CHB_ASSOCIATION_CH2 0x00
403 #define PROXFUSION3_DCF_WEIGHT_CH2 0x00
404 
410 #define PROXFUSION3_PXS_CRXSEL_CH3 0x90
411 #define PROXFUSION3_PXS_CTXSEL_CH3 0xFF
412 #define PROXFUSION3_PXS_PROXCTRL_CH3 0xA3
413 #define PROXFUSION3_PXS_PROXCFG0_CH3 0x40
414 #define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH3 0x06
415 #define PROXFUSION3_ATI_BASE_AND_TARGET_CH3 0x90
416 #define PROXFUSION3_ATI_MIRROR_CH3 0x1E
417 #define PROXFUSION3_ATI_PCC_CH3 0xC8
418 #define PROXFUSION3_PXS_PROX_THRESHOLD_CH3 0x0A
419 #define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH3 0x10
420 #define PROXFUSION3_PXS_DEEP_THRESHOLD_CH3 0x30
421 #define PROXFUSION3_PXS_HYSTERESIS_CH3 0x04
422 #define PROXFUSION3_DCF_CHB_ASSOCIATION_CH3 0x00
423 #define PROXFUSION3_DCF_WEIGHT_CH3 0x00
424 
430 #define PROXFUSION3_PXS_CRXSEL_CH4 0x42
431 #define PROXFUSION3_PXS_CTXSEL_CH4 0xFF
432 #define PROXFUSION3_PXS_PROXCTRL_CH4 0xA3
433 #define PROXFUSION3_PXS_PROXCFG0_CH4 0x40
434 #define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH4 0x06
435 #define PROXFUSION3_ATI_BASE_AND_TARGET_CH4 0x90
436 #define PROXFUSION3_ATI_MIRROR_CH4 0x1E
437 #define PROXFUSION3_ATI_PCC_CH4 0xCA
438 #define PROXFUSION3_PXS_PROX_THRESHOLD_CH4 0x0A
439 #define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH4 0x10
440 #define PROXFUSION3_PXS_DEEP_THRESHOLD_CH4 0x30
441 #define PROXFUSION3_PXS_HYSTERESIS_CH4 0x04
442 #define PROXFUSION3_DCF_CHB_ASSOCIATION_CH4 0x00
443 #define PROXFUSION3_DCF_WEIGHT_CH4 0x00
444 
450 #define PROXFUSION3_PXS_CRXSEL_CH5 0x21
451 #define PROXFUSION3_PXS_CTXSEL_CH5 0xFF
452 #define PROXFUSION3_PXS_PROXCTRL_CH5 0xA3
453 #define PROXFUSION3_PXS_PROXCFG0_CH5 0x40
454 #define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH5 0x06
455 #define PROXFUSION3_ATI_BASE_AND_TARGET_CH5 0x90
456 #define PROXFUSION3_ATI_MIRROR_CH5 0x1E
457 #define PROXFUSION3_ATI_PCC_CH5 0xD0
458 #define PROXFUSION3_PXS_PROX_THRESHOLD_CH5 0x0A
459 #define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH5 0x10
460 #define PROXFUSION3_PXS_DEEP_THRESHOLD_CH5 0x30
461 #define PROXFUSION3_PXS_HYSTERESIS_CH5 0x04
462 #define PROXFUSION3_DCF_CHB_ASSOCIATION_CH5 0x00
463 #define PROXFUSION3_DCF_WEIGHT_CH5 0x00
464 
470 #define PROXFUSION3_PXS_CRXSEL_CH6 0x0C
471 #define PROXFUSION3_PXS_CTXSEL_CH6 0xFF
472 #define PROXFUSION3_PXS_PROXCTRL_CH6 0xA3
473 #define PROXFUSION3_PXS_PROXCFG0_CH6 0x40
474 #define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH6 0x06
475 #define PROXFUSION3_ATI_BASE_AND_TARGET_CH6 0x90
476 #define PROXFUSION3_ATI_MIRROR_CH6 0x26
477 #define PROXFUSION3_ATI_PCC_CH6 0xCB
478 #define PROXFUSION3_PXS_PROX_THRESHOLD_CH6 0x0A
479 #define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH6 0x10
480 #define PROXFUSION3_PXS_DEEP_THRESHOLD_CH6 0x30
481 #define PROXFUSION3_PXS_HYSTERESIS_CH6 0x04
482 #define PROXFUSION3_DCF_CHB_ASSOCIATION_CH6 0x00
483 #define PROXFUSION3_DCF_WEIGHT_CH6 0x00
484 
490 #define PROXFUSION3_PXS_CRXSEL_CH7 0x01
491 #define PROXFUSION3_PXS_CTXSEL_CH7 0xFF
492 #define PROXFUSION3_PXS_PROXCTRL_CH7 0xA3
493 #define PROXFUSION3_PXS_PROXCFG0_CH7 0xDE
494 #define PROXFUSION3_PXS_PROXCFG1_TESTREG0_CH7 0x01
495 #define PROXFUSION3_ATI_BASE_AND_TARGET_CH7 0xD0
496 #define PROXFUSION3_ATI_MIRROR_CH7 0x57
497 #define PROXFUSION3_ATI_PCC_CH7 0x60
498 #define PROXFUSION3_PXS_PROX_THRESHOLD_CH7 0x0A
499 #define PROXFUSION3_PXS_TOUCH_THRESHOLD_CH7 0x08
500 #define PROXFUSION3_PXS_DEEP_THRESHOLD_CH7 0x1A
501 #define PROXFUSION3_PXS_HYSTERESIS_CH7 0x04
502 #define PROXFUSION3_DCF_CHB_ASSOCIATION_CH7 0x00
503 #define PROXFUSION3_DCF_WEIGHT_CH7 0x00
504 
505 //
511 #define PROXFUSION3_CH0_CRX 0x8C
512 #define PROXFUSION3_CH1_CRX 0x93
513 #define PROXFUSION3_CH2_CRX 0x9A
514 #define PROXFUSION3_CH3_CRX 0xA1
515 #define PROXFUSION3_CH4_CRX 0xA8
516 #define PROXFUSION3_CH5_CRX 0xAF
517 #define PROXFUSION3_CH6_CRX 0xB6
518 #define PROXFUSION3_CH7_CRX 0xBD
519 
524 #define PROXFUSION3_TOUCH_NUMB_1 0x13
525 #define PROXFUSION3_TOUCH_NUMB_2 0x27
526 #define PROXFUSION3_TOUCH_NUMB_3 0x4E
527 #define PROXFUSION3_TOUCH_NUMB_4 0x0C
528 #define PROXFUSION3_TOUCH_NUMB_5 0x30
529 #define PROXFUSION3_TOUCH_NUMB_6 0x70
530 #define PROXFUSION3_TOUCH_NUMB_7 0x60
531 #define PROXFUSION3_TOUCH_NUMB_8 0x40
532 
537 #define PROXFUSION3_TOUCH_CRX_0 0x01
538 #define PROXFUSION3_TOUCH_CRX_1 0x02
539 #define PROXFUSION3_TOUCH_CRX_2 0x04
540 #define PROXFUSION3_TOUCH_CRX_3 0x08
541 #define PROXFUSION3_TOUCH_CRX_4 0x10
542 #define PROXFUSION3_TOUCH_CRX_5 0x20
543 #define PROXFUSION3_TOUCH_CRX_6 0x40
544 #define PROXFUSION3_TOUCH_CRX_7 0x80
545 
550 #define PROXFUSION3_TOUCH_POS_NO_TOUCH 0x00
551 #define PROXFUSION3_TOUCH_POS_1 0x01
552 #define PROXFUSION3_TOUCH_POS_2 0x02
553 #define PROXFUSION3_TOUCH_POS_3 0x03
554 #define PROXFUSION3_TOUCH_POS_4 0x04
555 #define PROXFUSION3_TOUCH_POS_5 0x05
556 #define PROXFUSION3_TOUCH_POS_6 0x06
557 #define PROXFUSION3_TOUCH_POS_7 0x07
558 #define PROXFUSION3_TOUCH_POS_8 0x08
559 
564 #define PROXFUSION3_CH0_PT_T 0x90
565 #define PROXFUSION3_CH1_PT_T 0x97
566 #define PROXFUSION3_CH2_PT_T 0x9E
567 #define PROXFUSION3_CH3_PT_T 0xA5
568 #define PROXFUSION3_CH4_PT_T 0xAC
569 #define PROXFUSION3_CH5_PT_T 0xB3
570 #define PROXFUSION3_CH6_PT_T 0xBA
571 #define PROXFUSION3_CH7_PT_T 0xC1
572 
577 #define PROXFUSION3_CH0_DT_T 0x91
578 #define PROXFUSION3_CH1_DT_T 0x98
579 #define PROXFUSION3_CH2_DT_T 0x9F
580 #define PROXFUSION3_CH3_DT_T 0xA6
581 #define PROXFUSION3_CH4_DT_T 0xAD
582 #define PROXFUSION3_CH5_DT_T 0xB4
583 #define PROXFUSION3_CH6_DT_T 0xBB
584 #define PROXFUSION3_CH7_DT_T 0xC2
585 
590 #define PROXFUSION3_EVENT_NO_TOUCH 0x00
591 #define PROXFUSION3_EVENT_TOUCH 0x01
592 
598 #define PROXFUSION3_SET_DEV_ADDR 0x44
599 
605 #define PROXFUSION3_SET_PIN_STATE_LOW 0x00
606 #define PROXFUSION3_SET_PIN_STATE_HIGH 0x01
607 
613 #define PROXFUSION3_PROX_THRESHOLD 10
614 #define PROXFUSION3_TOUCH_THRESHOLD_CH0 22
615 #define PROXFUSION3_TOUCH_THRESHOLD_CH1 20
616 #define PROXFUSION3_TOUCH_THRESHOLD_CH2 10
617 #define PROXFUSION3_TOUCH_THRESHOLD_CH3 10
618 #define PROXFUSION3_TOUCH_THRESHOLD_CH4 22
619 #define PROXFUSION3_TOUCH_THRESHOLD_CH5 20
620 #define PROXFUSION3_TOUCH_THRESHOLD_CH6 12
621 #define PROXFUSION3_TOUCH_THRESHOLD_CH7 10
622 #define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH0 32
623 #define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH1 26
624 #define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH2 26
625 #define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH3 26
626 #define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH4 32
627 #define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH5 26
628 #define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH6 26
629 #define PROXFUSION3_DEEP_TOUCH_THRESHOLD_CH7 26
630 #define PROXFUSION3_TOUCH_CH_RX_THRESHOLD_7 16384
631 
632  // proxfusion3_set
634 
649 #define PROXFUSION3_MAP_MIKROBUS( cfg, mikrobus ) \
650  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
651  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
652  cfg.gp = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
653  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
654  // proxfusion3_map // proxfusion3
657 
662 typedef struct
663 {
664  // Output pins
665 
666  digital_out_t int_pin;
668  // Input pins
669 
670  digital_in_t gp;
672  // Modules
673 
674  i2c_master_t i2c;
676  // I2C slave address
677 
678  uint8_t slave_address;
680 } proxfusion3_t;
681 
686 typedef struct
687 {
688  pin_name_t scl;
689  pin_name_t sda;
691  pin_name_t gp;
692  pin_name_t int_pin;
694  uint32_t i2c_speed;
695  uint8_t i2c_address;
698 
717 
735 
752 
765 void proxfusion3_set_state_int_pin ( proxfusion3_t *ctx, uint8_t pin_state );
766 
780 
798 err_t proxfusion3_generic_write ( proxfusion3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len );
799 
817 err_t proxfusion3_generic_read ( proxfusion3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len );
818 
833 void proxfusion3_write_reg ( proxfusion3_t *ctx, uint8_t reg, uint16_t tx_data );
834 
848 uint16_t proxfusion3_read_reg ( proxfusion3_t *ctx, uint8_t reg );
849 
866 err_t proxfusion3_get_version_info ( proxfusion3_t *ctx, uint8_t *product_number, uint8_t *software_version );
867 
883 
898 
913 
928 
943 
959 
982 void proxfusion3_set_event ( proxfusion3_t *ctx, uint8_t event );
983 
999 
1014 uint16_t proxfusion3_read_channel_delta ( proxfusion3_t *ctx, uint8_t channel );
1015 
1031 
1054 
1070 
1093 void proxfusion3_set_even_mode ( proxfusion3_t *ctx, uint8_t mode );
1094 
1109 
1125 
1126 #ifdef __cplusplus
1127 }
1128 #endif
1129 #endif // PROXFUSION3_H
1130  // proxfusion3
1132 
1133 // ------------------------------------------------------------------------ END
proxfusion3_sw_reset
void proxfusion3_sw_reset(proxfusion3_t *ctx)
ProxFusion 3 software reset function.
proxfusion3_t::int_pin
digital_out_t int_pin
Definition: proxfusion3.h:666
proxfusion3_en_abs_cap
void proxfusion3_en_abs_cap(proxfusion3_t *ctx)
ProxFusion 3 enables the absolute capacitiance function.
proxfusion3_t
ProxFusion 3 Click context object.
Definition: proxfusion3.h:663
proxfusion3_get_events
uint8_t proxfusion3_get_events(proxfusion3_t *ctx)
ProxFusion 3 get events function.
proxfusion3_auto_tune
void proxfusion3_auto_tune(proxfusion3_t *ctx)
ProxFusion 3 auto tune function.
proxfusion3_cfg_t::scl
pin_name_t scl
Definition: proxfusion3.h:688
proxfusion3_t::gp
digital_in_t gp
Definition: proxfusion3.h:670
proxfusion3_cfg_setup
void proxfusion3_cfg_setup(proxfusion3_cfg_t *cfg)
ProxFusion 3 configuration object setup function.
proxfusion3_t::slave_address
uint8_t slave_address
Definition: proxfusion3.h:678
proxfusion3_set_state_int_pin
void proxfusion3_set_state_int_pin(proxfusion3_t *ctx, uint8_t pin_state)
ProxFusion 3 INT pin setting function.
proxfusion3_generic_write
err_t proxfusion3_generic_write(proxfusion3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
ProxFusion 3 I2C writing function.
proxfusion3_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: proxfusion3.h:694
proxfusion3_enable_channels
void proxfusion3_enable_channels(proxfusion3_t *ctx)
ProxFusion 3 enable channels function.
proxfusion3_get_state_gp_pin
uint8_t proxfusion3_get_state_gp_pin(proxfusion3_t *ctx)
ProxFusion 3 get state of GP pin function.
proxfusion3_set_even_mode
void proxfusion3_set_even_mode(proxfusion3_t *ctx, uint8_t mode)
ProxFusion 3 set even mode function.
proxfusion3_write_reg
void proxfusion3_write_reg(proxfusion3_t *ctx, uint8_t reg, uint16_t tx_data)
ProxFusion 3 I2C register writing function.
proxfusion3_channel_remap
void proxfusion3_channel_remap(proxfusion3_t *ctx)
ProxFusion 3 channel remap function.
proxfusion3_get_gestures
uint8_t proxfusion3_get_gestures(proxfusion3_t *ctx)
ProxFusion 3 get gestures function.
proxfusion3_set_event
void proxfusion3_set_event(proxfusion3_t *ctx, uint8_t event)
ProxFusion 3 set event function.
proxfusion3_generic_read
err_t proxfusion3_generic_read(proxfusion3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
ProxFusion 3 I2C reading function.
proxfusion3_cfg_t::i2c_address
uint8_t i2c_address
Definition: proxfusion3.h:695
proxfusion3_cfg_t::sda
pin_name_t sda
Definition: proxfusion3.h:689
proxfusion3_get_version_info
err_t proxfusion3_get_version_info(proxfusion3_t *ctx, uint8_t *product_number, uint8_t *software_version)
ProxFusion 3 get version info data function.
proxfusion3_cfg_t::int_pin
pin_name_t int_pin
Definition: proxfusion3.h:692
proxfusion3_get_touch
uint8_t proxfusion3_get_touch(proxfusion3_t *ctx)
ProxFusion 3 get touch function.
proxfusion3_init
err_t proxfusion3_init(proxfusion3_t *ctx, proxfusion3_cfg_t *cfg)
ProxFusion 3 initialization function.
proxfusion3_t::i2c
i2c_master_t i2c
Definition: proxfusion3.h:674
proxfusion3_read_channel_delta
uint16_t proxfusion3_read_channel_delta(proxfusion3_t *ctx, uint8_t channel)
ProxFusion 3 read channel delta function.
proxfusion3_cfg_t::gp
pin_name_t gp
Definition: proxfusion3.h:691
proxfusion3_check_touch_event
uint8_t proxfusion3_check_touch_event(proxfusion3_t *ctx)
ProxFusion 3 check touch event function.
proxfusion3_adjust_touch_thresholds
void proxfusion3_adjust_touch_thresholds(proxfusion3_t *ctx)
ProxFusion 3 adjust touch thresholds function.
proxfusion3_default_cfg
err_t proxfusion3_default_cfg(proxfusion3_t *ctx)
ProxFusion 3 default configuration function.
proxfusion3_read_reg
uint16_t proxfusion3_read_reg(proxfusion3_t *ctx, uint8_t reg)
ProxFusion 3 I2C register reading function.
proxfusion3_adjust_deep_touch_thresholds
void proxfusion3_adjust_deep_touch_thresholds(proxfusion3_t *ctx)
ProxFusion 3 adjust deep touch thresholds function.
proxfusion3_cfg_t
ProxFusion 3 Click configuration object.
Definition: proxfusion3.h:687
proxfusion3_get_absolute_measurement
float proxfusion3_get_absolute_measurement(proxfusion3_t *ctx)
ProxFusion 3 get absolute measurement function.