LibDriver APDS9960
Loading...
Searching...
No Matches
driver_apds9960_gesture.c
Go to the documentation of this file.
1
36
38
39static apds9960_handle_t gs_handle;
40static uint8_t gs_data[32][4];
41static void (*a_callback)(uint8_t type) = NULL;
42
51{
52 if (apds9960_irq_handler(&gs_handle) != 0)
53 {
54 return 1;
55 }
56 else
57 {
58 return 0;
59 }
60}
61
67static void a_gesture_callback(uint8_t type)
68{
69 switch (type)
70 {
72 {
73 uint8_t res;
74 uint8_t len;
75
76 /* read gesture fifo */
77 len = 32;
78 res = apds9960_read_gesture_fifo(&gs_handle, gs_data, (uint8_t *)&len);
79 if (res != 0)
80 {
81 apds9960_interface_debug_print("apds9960: read gesture fifo failed.\n");
82
83 return;
84 }
85
86 /* gesture decode */
87 if (len >= 4)
88 {
89 res = apds9960_gesture_decode(&gs_handle, gs_data, len);
90 if (res != 0)
91 {
92 apds9960_interface_debug_print("apds9960: gesture decode failed.\n");
93
94 return;
95 }
96 }
97
98 break;
99 }
100 default :
101 {
102 if (a_callback != NULL)
103 {
104 a_callback(type);
105 }
106
107 break;
108 }
109 }
110}
111
120uint8_t apds9960_gesture_init(void (*callback)(uint8_t type))
121{
122 uint8_t res;
123 uint8_t reg;
124
125 /* link interface function */
133 DRIVER_APDS9960_LINK_RECEIVE_CALLBACK(&gs_handle, a_gesture_callback);
134 a_callback = callback;
135
136 /* init the apds9960 */
137 res = apds9960_init(&gs_handle);
138 if (res != 0)
139 {
140 apds9960_interface_debug_print("apds9960: init failed.\n");
141
142 return 1;
143 }
144
145 /* power on */
147 if (res != 0)
148 {
149 apds9960_interface_debug_print("apds9960: set conf failed.\n");
150 (void)apds9960_deinit(&gs_handle);
151
152 return 1;
153 }
154
155 /* disable wait time */
157 if (res != 0)
158 {
159 apds9960_interface_debug_print("apds9960: set conf failed.\n");
160 (void)apds9960_deinit(&gs_handle);
161
162 return 1;
163 }
164
165 /* disable proximity detect */
167 if (res != 0)
168 {
169 apds9960_interface_debug_print("apds9960: set conf failed.\n");
170 (void)apds9960_deinit(&gs_handle);
171
172 return 1;
173 }
174
175 /* disable als */
177 if (res != 0)
178 {
179 apds9960_interface_debug_print("apds9960: set conf failed.\n");
180 (void)apds9960_deinit(&gs_handle);
181
182 return 1;
183 }
184
185 /* disable als interrupt */
187 if (res != 0)
188 {
189 apds9960_interface_debug_print("apds9960: set conf failed.\n");
190 (void)apds9960_deinit(&gs_handle);
191
192 return 1;
193 }
194
195 /* disable proximity interrupt */
197 if (res != 0)
198 {
199 apds9960_interface_debug_print("apds9960: set conf failed.\n");
200 (void)apds9960_deinit(&gs_handle);
201
202 return 1;
203 }
204
205 /* disable gesture */
207 if (res != 0)
208 {
209 apds9960_interface_debug_print("apds9960: set conf failed.\n");
210 (void)apds9960_deinit(&gs_handle);
211
212 return 1;
213 }
214
215 /* convert adc integration time */
217 if (res != 0)
218 {
219 apds9960_interface_debug_print("apds9960: adc integration time convert to register failed.\n");
220 (void)apds9960_deinit(&gs_handle);
221
222 return 1;
223 }
224
225 /* set adc integration time */
226 res = apds9960_set_adc_integration_time(&gs_handle, reg);
227 if (res != 0)
228 {
229 apds9960_interface_debug_print("apds9960: set adc integration time failed.\n");
230 (void)apds9960_deinit(&gs_handle);
231
232 return 1;
233 }
234
235 /* disable wait long */
237 if (res != 0)
238 {
239 apds9960_interface_debug_print("apds9960: set wait long failed.\n");
240 (void)apds9960_deinit(&gs_handle);
241
242 return 1;
243 }
244
245 /* wait time convert to register */
247 if (res != 0)
248 {
249 apds9960_interface_debug_print("apds9960: wait time convert to register failed.\n");
250 (void)apds9960_deinit(&gs_handle);
251
252 return 1;
253 }
254
255 /* set wait time */
256 res = apds9960_set_wait_time(&gs_handle, reg);
257 if (res != 0)
258 {
259 apds9960_interface_debug_print("apds9960: set wait time failed.\n");
260 (void)apds9960_deinit(&gs_handle);
261
262 return 1;
263 }
264
265 /* set als interrupt low threshold */
267 if (res != 0)
268 {
269 apds9960_interface_debug_print("apds9960: set als interrupt low threshold failed.\n");
270 (void)apds9960_deinit(&gs_handle);
271
272 return 1;
273 }
274
275 /* set als interrupt high threshold */
277 if (res != 0)
278 {
279 apds9960_interface_debug_print("apds9960: set als interrupt high threshold failed.\n");
280 (void)apds9960_deinit(&gs_handle);
281
282 return 1;
283 }
284
285 /* set proximity interrupt low threshold */
287 if (res != 0)
288 {
289 apds9960_interface_debug_print("apds9960: set proximity interrupt low threshold failed.\n");
290 (void)apds9960_deinit(&gs_handle);
291
292 return 1;
293 }
294
295 /* set proximity interrupt high threshold */
297 if (res != 0)
298 {
299 apds9960_interface_debug_print("apds9960: set proximity interrupt high threshold failed.\n");
300 (void)apds9960_deinit(&gs_handle);
301
302 return 1;
303 }
304
305 /* proximity interrupt cycle */
307 if (res != 0)
308 {
309 apds9960_interface_debug_print("apds9960: set proximity interrupt cycle failed.\n");
310 (void)apds9960_deinit(&gs_handle);
311
312 return 1;
313 }
314
315 /* als interrupt cycle */
317 if (res != 0)
318 {
319 apds9960_interface_debug_print("apds9960: set als interrupt cycle failed.\n");
320 (void)apds9960_deinit(&gs_handle);
321
322 return 1;
323 }
324
325 /* set proximity pulse length */
327 if (res != 0)
328 {
329 apds9960_interface_debug_print("apds9960: set proximity pulse length failed.\n");
330 (void)apds9960_deinit(&gs_handle);
331
332 return 1;
333 }
334
335 /* set proximity pulse count */
337 if (res != 0)
338 {
339 apds9960_interface_debug_print("apds9960: set proximity pulse count failed.\n");
340 (void)apds9960_deinit(&gs_handle);
341
342 return 1;
343 }
344
345 /* set led current */
347 if (res != 0)
348 {
349 apds9960_interface_debug_print("apds9960: set led current failed.\n");
350 (void)apds9960_deinit(&gs_handle);
351
352 return 1;
353 }
354
355 /* set proximity gain */
357 if (res != 0)
358 {
359 apds9960_interface_debug_print("apds9960: set proximity gain failed.\n");
360 (void)apds9960_deinit(&gs_handle);
361
362 return 1;
363 }
364
365 /* set als color gain */
367 if (res != 0)
368 {
369 apds9960_interface_debug_print("apds9960: set als color gain failed.\n");
370 (void)apds9960_deinit(&gs_handle);
371
372 return 1;
373 }
374
375 /* set proximity saturation interrupt */
377 if (res != 0)
378 {
379 apds9960_interface_debug_print("apds9960: set saturation interrupt failed.\n");
380 (void)apds9960_deinit(&gs_handle);
381
382 return 1;
383 }
384
385 /* set clear photo diode saturation interrupt */
387 if (res != 0)
388 {
389 apds9960_interface_debug_print("apds9960: set saturation interrupt failed.\n");
390 (void)apds9960_deinit(&gs_handle);
391
392 return 1;
393 }
394
395 /* set led boost */
397 if (res != 0)
398 {
399 apds9960_interface_debug_print("apds9960: set led boost failed.\n");
400 (void)apds9960_deinit(&gs_handle);
401
402 return 1;
403 }
404
405 /* set proximity up right offset */
407 if (res != 0)
408 {
409 apds9960_interface_debug_print("apds9960: set proximity up right offset failed.\n");
410 (void)apds9960_deinit(&gs_handle);
411
412 return 1;
413 }
414
415 /* set proximity down left offset */
417 if (res != 0)
418 {
419 apds9960_interface_debug_print("apds9960: set proximity down left offset failed.\n");
420 (void)apds9960_deinit(&gs_handle);
421
422 return 1;
423 }
424
425 /* set proximity gain compensation */
427 if (res != 0)
428 {
429 apds9960_interface_debug_print("apds9960: set proximity gain compensation failed.\n");
430 (void)apds9960_deinit(&gs_handle);
431
432 return 1;
433 }
434
435 /* set sleep after interrupt */
437 if (res != 0)
438 {
439 apds9960_interface_debug_print("apds9960: set sleep after interrupt failed.\n");
440 (void)apds9960_deinit(&gs_handle);
441
442 return 1;
443 }
444
445 /* set proximity mask up */
447 if (res != 0)
448 {
449 apds9960_interface_debug_print("apds9960: set proximity mask failed.\n");
450 (void)apds9960_deinit(&gs_handle);
451
452 return 1;
453 }
454
455 /* set proximity mask down */
457 if (res != 0)
458 {
459 apds9960_interface_debug_print("apds9960: set proximity mask failed.\n");
460 (void)apds9960_deinit(&gs_handle);
461
462 return 1;
463 }
464
465 /* set proximity mask left */
467 if (res != 0)
468 {
469 apds9960_interface_debug_print("apds9960: set proximity mask failed.\n");
470 (void)apds9960_deinit(&gs_handle);
471
472 return 1;
473 }
474
475 /* set proximity mask right */
477 if (res != 0)
478 {
479 apds9960_interface_debug_print("apds9960: set proximity mask failed.\n");
480 (void)apds9960_deinit(&gs_handle);
481
482 return 1;
483 }
484
485 /* set gesture proximity enter threshold */
487 if (res != 0)
488 {
489 apds9960_interface_debug_print("apds9960: set gesture proximity enter threshold failed.\n");
490 (void)apds9960_deinit(&gs_handle);
491
492 return 1;
493 }
494
495 /* set gesture proximity exit threshold */
497 if (res != 0)
498 {
499 apds9960_interface_debug_print("apds9960: set gesture proximity exit threshold failed.\n");
500 (void)apds9960_deinit(&gs_handle);
501
502 return 1;
503 }
504
505 /* set gesture fifo threshold */
507 if (res != 0)
508 {
509 apds9960_interface_debug_print("apds9960: set gesture fifo threshold failed.\n");
510 (void)apds9960_deinit(&gs_handle);
511
512 return 1;
513 }
514
515 /* set gesture exit persistence */
517 if (res != 0)
518 {
519 apds9960_interface_debug_print("apds9960: set gesture exit persistence failed.\n");
520 (void)apds9960_deinit(&gs_handle);
521
522 return 1;
523 }
524
525 /* set gesture exit mask */
527 if (res != 0)
528 {
529 apds9960_interface_debug_print("apds9960: set gesture exit mask failed.\n");
530 (void)apds9960_deinit(&gs_handle);
531
532 return 1;
533 }
534
535 /* set gesture gain */
537 if (res != 0)
538 {
539 apds9960_interface_debug_print("apds9960: set gesture gain failed.\n");
540 (void)apds9960_deinit(&gs_handle);
541
542 return 1;
543 }
544
545 /* set gesture led current */
547 if (res != 0)
548 {
549 apds9960_interface_debug_print("apds9960: set gesture led current failed.\n");
550 (void)apds9960_deinit(&gs_handle);
551
552 return 1;
553 }
554
555 /* set gesture wait time */
557 if (res != 0)
558 {
559 apds9960_interface_debug_print("apds9960: set gesture wait time failed.\n");
560 (void)apds9960_deinit(&gs_handle);
561
562 return 1;
563 }
564
565 /* set gesture up offset */
567 if (res != 0)
568 {
569 apds9960_interface_debug_print("apds9960: set gesture up offset failed.\n");
570 (void)apds9960_deinit(&gs_handle);
571
572 return 1;
573 }
574
575 /* set gesture down offset */
577 if (res != 0)
578 {
579 apds9960_interface_debug_print("apds9960: set gesture down offset failed.\n");
580 (void)apds9960_deinit(&gs_handle);
581
582 return 1;
583 }
584
585 /* set gesture left offset */
587 if (res != 0)
588 {
589 apds9960_interface_debug_print("apds9960: set gesture left offset failed.\n");
590 (void)apds9960_deinit(&gs_handle);
591
592 return 1;
593 }
594
595 /* set gesture right offset */
597 if (res != 0)
598 {
599 apds9960_interface_debug_print("apds9960: set gesture right offset failed.\n");
600 (void)apds9960_deinit(&gs_handle);
601
602 return 1;
603 }
604
605 /* set gesture pulse length */
607 if (res != 0)
608 {
609 apds9960_interface_debug_print("apds9960: set gesture pulse length failed.\n");
610 (void)apds9960_deinit(&gs_handle);
611
612 return 1;
613 }
614
615 /* set gesture pulse count */
617 if (res != 0)
618 {
619 apds9960_interface_debug_print("apds9960: set gesture pulse count failed.\n");
620 (void)apds9960_deinit(&gs_handle);
621
622 return 1;
623 }
624
625 /* set gesture dimension */
627 if (res != 0)
628 {
629 apds9960_interface_debug_print("apds9960: set gesture dimension failed.\n");
630 (void)apds9960_deinit(&gs_handle);
631
632 return 1;
633 }
634
635 /* gesture fifo clear */
636 res = apds9960_gesture_fifo_clear(&gs_handle);
637 if (res != 0)
638 {
639 apds9960_interface_debug_print("apds9960: gesture fifo clear failed.\n");
640 (void)apds9960_deinit(&gs_handle);
641
642 return 1;
643 }
644
645 /* set gesture interrupt */
647 if (res != 0)
648 {
649 apds9960_interface_debug_print("apds9960: set gesture interrupt failed.\n");
650 (void)apds9960_deinit(&gs_handle);
651
652 return 1;
653 }
654
655 /* set gesture mode */
657 if (res != 0)
658 {
659 apds9960_interface_debug_print("apds9960: set gesture mode failed.\n");
660 (void)apds9960_deinit(&gs_handle);
661
662 return 1;
663 }
664
665 /* all non gesture interrupt clear */
667 if (res != 0)
668 {
669 apds9960_interface_debug_print("apds9960: all non gesture interrupt clear failed.\n");
670 (void)apds9960_deinit(&gs_handle);
671
672 return 1;
673 }
674
675 /* enable wait time */
677 if (res != 0)
678 {
679 apds9960_interface_debug_print("apds9960: set conf failed.\n");
680 (void)apds9960_deinit(&gs_handle);
681
682 return 1;
683 }
684
685 /* enable proximity detect */
687 if (res != 0)
688 {
689 apds9960_interface_debug_print("apds9960: set conf failed.\n");
690 (void)apds9960_deinit(&gs_handle);
691
692 return 1;
693 }
694
695 /* enable gesture */
697 if (res != 0)
698 {
699 apds9960_interface_debug_print("apds9960: set conf failed.\n");
700 (void)apds9960_deinit(&gs_handle);
701
702 return 1;
703 }
704
705 return 0;
706}
707
716{
717 if (apds9960_deinit(&gs_handle) != 0)
718 {
719 return 1;
720 }
721 else
722 {
723 a_callback = NULL;
724
725 return 0;
726 }
727}
driver apds9960 gesture header file
uint8_t apds9960_set_gesture_dimension(apds9960_handle_t *handle, apds9960_gesture_dimension_select_t s)
set the gesture dimension
uint8_t apds9960_set_gesture_gain(apds9960_handle_t *handle, apds9960_gesture_gain_control_t gain)
set the gesture gain
uint8_t apds9960_read_gesture_fifo(apds9960_handle_t *handle, uint8_t(*data)[4], uint8_t *len)
read data from the gesture fifo
uint8_t apds9960_set_als_interrupt_high_threshold(apds9960_handle_t *handle, uint16_t threshold)
set the als interrupt high threshold
uint8_t apds9960_deinit(apds9960_handle_t *handle)
close the chip
uint8_t apds9960_set_gesture_wait_time(apds9960_handle_t *handle, apds9960_gesture_wait_time_t t)
set the gesture wait time
uint8_t apds9960_set_gesture_exit_persistence(apds9960_handle_t *handle, apds9960_gesture_exit_persistence_t persistence)
set the gesture exit persistence
uint8_t apds9960_gesture_decode(apds9960_handle_t *handle, uint8_t(*data)[4], uint8_t len)
decode gestures from the fifo data
uint8_t apds9960_set_proximity_pulse_length(apds9960_handle_t *handle, apds9960_proximity_pulse_length_t len)
set the proximity pulse length
uint8_t apds9960_set_saturation_interrupt(apds9960_handle_t *handle, apds9960_saturation_interrupt_t saturation, apds9960_bool_t enable)
set the saturation interrupt
uint8_t apds9960_set_proximity_down_left_offset(apds9960_handle_t *handle, int8_t offset)
set the proximity down left offset
uint8_t apds9960_set_als_interrupt_cycle(apds9960_handle_t *handle, apds9960_als_interrupt_cycle_t cycle)
set the als interrupt cycle
uint8_t apds9960_gesture_fifo_clear(apds9960_handle_t *handle)
clear the gesture fifo status
uint8_t apds9960_wait_time_convert_to_register(apds9960_handle_t *handle, float ms, uint8_t *reg)
convert the wait time to the register raw data
uint8_t apds9960_set_proximity_gain(apds9960_handle_t *handle, apds9960_proximity_gain_t gain)
set the proximity gain
uint8_t apds9960_adc_integration_time_convert_to_register(apds9960_handle_t *handle, float ms, uint8_t *reg)
convert the adc integration time to the register raw data
uint8_t apds9960_init(apds9960_handle_t *handle)
initialize the chip
uint8_t apds9960_set_proximity_interrupt_cycle(apds9960_handle_t *handle, apds9960_proximity_interrupt_cycle_t cycle)
set the proximity interrupt cycle
uint8_t apds9960_set_gesture_right_offset(apds9960_handle_t *handle, int8_t offset)
set the gesture right offset
uint8_t apds9960_set_gesture_fifo_threshold(apds9960_handle_t *handle, apds9960_gesture_fifo_threshold_t threshold)
set the gesture fifo threshold
uint8_t apds9960_set_proximity_pulse_count(apds9960_handle_t *handle, uint16_t count)
set the proximity pulse count
uint8_t apds9960_set_proximity_up_right_offset(apds9960_handle_t *handle, int8_t offset)
set the proximity up right offset
uint8_t apds9960_set_gesture_pulse_length(apds9960_handle_t *handle, apds9960_gesture_pulse_length_t len)
set the gesture pulse length
uint8_t apds9960_irq_handler(apds9960_handle_t *handle)
irq handler
uint8_t apds9960_set_proximity_gain_compensation(apds9960_handle_t *handle, apds9960_bool_t enable)
enable or disable the proximity gain compensation
uint8_t apds9960_set_gesture_led_current(apds9960_handle_t *handle, apds9960_gesture_led_current_t current)
set the gesture led current
uint8_t apds9960_set_gesture_pulse_count(apds9960_handle_t *handle, uint16_t count)
set the gesture pulse count
uint8_t apds9960_set_wait_long(apds9960_handle_t *handle, apds9960_bool_t enable)
enable or disable the wait long
uint8_t apds9960_set_gesture_exit_mask(apds9960_handle_t *handle, uint8_t mask)
set the gesture exit mask
uint8_t apds9960_set_als_color_gain(apds9960_handle_t *handle, apds9960_als_color_gain_t gain)
set the als color gain
uint8_t apds9960_set_gesture_proximity_enter_threshold(apds9960_handle_t *handle, uint8_t threshold)
set the gesture proximity enter threshold
uint8_t apds9960_set_gesture_mode(apds9960_handle_t *handle, apds9960_bool_t enable)
enable or disable the gesture mode
uint8_t apds9960_set_led_boost(apds9960_handle_t *handle, apds9960_led_boost_t boost)
set the led boost
struct apds9960_handle_s apds9960_handle_t
apds9960 handle structure definition
uint8_t apds9960_set_sleep_after_interrupt(apds9960_handle_t *handle, apds9960_bool_t enable)
enable or disable sleeping after interrupt
uint8_t apds9960_all_non_gesture_interrupt_clear(apds9960_handle_t *handle)
clear the all not gesture interrupt
uint8_t apds9960_set_conf(apds9960_handle_t *handle, apds9960_conf_t conf, apds9960_bool_t enable)
set the configuration
uint8_t apds9960_set_als_interrupt_low_threshold(apds9960_handle_t *handle, uint16_t threshold)
set the als interrupt low threshold
uint8_t apds9960_set_gesture_up_offset(apds9960_handle_t *handle, int8_t offset)
set the gesture up offset
uint8_t apds9960_set_gesture_interrupt(apds9960_handle_t *handle, apds9960_bool_t enable)
enable or disable the gesture interrupt
uint8_t apds9960_set_proximity_interrupt_low_threshold(apds9960_handle_t *handle, uint8_t threshold)
set the proximity interrupt low threshold
uint8_t apds9960_set_gesture_left_offset(apds9960_handle_t *handle, int8_t offset)
set the gesture left offset
uint8_t apds9960_set_adc_integration_time(apds9960_handle_t *handle, uint8_t integration_time)
set the adc integration time
uint8_t apds9960_set_led_current(apds9960_handle_t *handle, apds9960_led_current_t current)
set the led current
uint8_t apds9960_set_proximity_interrupt_high_threshold(apds9960_handle_t *handle, uint8_t threshold)
set the proximity interrupt high threshold
uint8_t apds9960_set_wait_time(apds9960_handle_t *handle, uint8_t wait_time)
set the wait time
uint8_t apds9960_set_gesture_proximity_exit_threshold(apds9960_handle_t *handle, uint8_t threshold)
set the gesture proximity exit threshold
uint8_t apds9960_set_proximity_mask(apds9960_handle_t *handle, apds9960_proximity_mask_t mask, apds9960_bool_t enable)
enable or disable the proximity mask
uint8_t apds9960_set_gesture_down_offset(apds9960_handle_t *handle, int8_t offset)
set the gesture down offset
@ APDS9960_INTERRUPT_STATUS_GVALID
@ APDS9960_BOOL_FALSE
@ APDS9960_BOOL_TRUE
@ APDS9960_PROXIMITY_MASK_RIGHT
@ APDS9960_PROXIMITY_MASK_DOWN
@ APDS9960_PROXIMITY_MASK_UP
@ APDS9960_PROXIMITY_MASK_LEFT
@ APDS9960_SATURATION_INTERRUPT_PROXIMITY
@ APDS9960_SATURATION_INTERRUPT_CLEAR_PHOTODIODE
@ APDS9960_CONF_WAIT_ENABLE
@ APDS9960_CONF_ALS_ENABLE
@ APDS9960_CONF_PROXIMITY_DETECT_ENABLE
@ APDS9960_CONF_GESTURE_ENABLE
@ APDS9960_CONF_PROXIMITY_INTERRUPT_ENABLE
@ APDS9960_CONF_ALS_INTERRUPT_ENABLE
@ APDS9960_CONF_POWER_ON
uint8_t apds9960_gesture_irq_handler(void)
gesture irq
#define APDS9960_GESTURE_DEFAULT_ADC_INTEGRATION_TIME
apds9960 gesture example default definition
#define APDS9960_GESTURE_DEFAULT_GESTURE_PULSE_LENGTH
#define APDS9960_GESTURE_DEFAULT_GESTURE_PROXIMITY_EXIT_THRESHOLD
#define APDS9960_GESTURE_DEFAULT_ALS_INTERRUPT_LOW_THRESHOLD
#define APDS9960_GESTURE_DEFAULT_ALS_COLOR_GAIN
#define APDS9960_GESTURE_DEFAULT_GESTURE_WAIT_TIME
#define APDS9960_GESTURE_DEFAULT_SLEEP_AFTER_INTERRUPT
#define APDS9960_GESTURE_DEFAULT_GESTURE_GAIN
#define APDS9960_GESTURE_DEFAULT_PROXIMITY_MASK_UP
#define APDS9960_GESTURE_DEFAULT_PROXIMITY_DOWN_LEFT_OFFSET
#define APDS9960_GESTURE_DEFAULT_ALS_INTERRUPT_CYCLE
#define APDS9960_GESTURE_DEFAULT_GESTURE_RIGHT_OFFSET
#define APDS9960_GESTURE_DEFAULT_PROXIMITY_MASK_LEFT
#define APDS9960_GESTURE_DEFAULT_GESTURE_LED_CURRENT
#define APDS9960_GESTURE_DEFAULT_PROXIMITY_INTERRUPT_CYCLE
#define APDS9960_GESTURE_DEFAULT_PROXIMITY_PULSE_LENGTH
#define APDS9960_GESTURE_DEFAULT_GESTURE_PROXIMITY_ENTER_THRESHOLD
#define APDS9960_GESTURE_DEFAULT_SATURATION_INTERRUPT_CLEAR_PHOTODIODE
#define APDS9960_GESTURE_DEFAULT_PROXIMITY_GAIN_COMPENSATION
#define APDS9960_GESTURE_DEFAULT_ALS_INTERRUPT_HIGH_THRESHOLD
#define APDS9960_GESTURE_DEFAULT_PROXIMITY_MASK_RIGHT
#define APDS9960_GESTURE_DEFAULT_PROXIMITY_INTERRUPT_HIGH_THRESHOLD
#define APDS9960_GESTURE_DEFAULT_GESTURE_PULSE_COUNT
#define APDS9960_GESTURE_DEFAULT_PROXIMITY_GAIN
#define APDS9960_GESTURE_DEFAULT_GESTURE_LEFT_OFFSET
#define APDS9960_GESTURE_DEFAULT_GESTURE_DOWN_OFFSET
#define APDS9960_GESTURE_DEFAULT_PROXIMITY_INTERRUPT_LOW_THRESHOLD
#define APDS9960_GESTURE_DEFAULT_PROXIMITY_PULSE_COUNT
#define APDS9960_GESTURE_DEFAULT_LED_CURRENT
#define APDS9960_GESTURE_DEFAULT_GESTURE_EXIT_PERSISTENCE
#define APDS9960_GESTURE_DEFAULT_GESTURE_DIMENSION
#define APDS9960_GESTURE_DEFAULT_WAIT_TIME
#define APDS9960_GESTURE_DEFAULT_GESTURE_EXIT_MASK
#define APDS9960_GESTURE_DEFAULT_GESTURE_FIFO_THRESHOLD
#define APDS9960_GESTURE_DEFAULT_PROXIMITY_MASK_DOWN
uint8_t apds9960_gesture_init(void(*callback)(uint8_t type))
gesture example init
#define APDS9960_GESTURE_DEFAULT_LED_BOOST
#define APDS9960_GESTURE_DEFAULT_GESTURE_UP_OFFSET
uint8_t apds9960_gesture_deinit(void)
gesture example deinit
#define APDS9960_GESTURE_DEFAULT_SATURATION_INTERRUPT_PROXIMITY
#define APDS9960_GESTURE_DEFAULT_PROXIMITY_UP_RIGHT_OFFSET
uint8_t apds9960_interface_iic_init(void)
interface iic bus init
uint8_t apds9960_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
void apds9960_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t apds9960_interface_iic_deinit(void)
interface iic bus deinit
uint8_t apds9960_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
void apds9960_interface_debug_print(const char *const fmt,...)
interface print format data