LibDriver APDS9960
Loading...
Searching...
No Matches
driver_apds9960_interrupt.c
Go to the documentation of this file.
1
36
38
39static apds9960_handle_t gs_handle;
40
49{
50 if (apds9960_irq_handler(&gs_handle) != 0)
51 {
52 return 1;
53 }
54 else
55 {
56 return 0;
57 }
58}
59
72uint8_t apds9960_interrupt_init(void (*callback)(uint8_t type), uint16_t als_low_threshold, uint16_t als_high_threshold,
73 uint8_t proximity_low_threshold, uint8_t proximity_high_threshold)
74{
75 uint8_t res;
76 uint8_t reg;
77
78 /* link interface function */
86 DRIVER_APDS9960_LINK_RECEIVE_CALLBACK(&gs_handle, callback);
87
88 /* init the apds9960 */
89 res = apds9960_init(&gs_handle);
90 if (res != 0)
91 {
92 apds9960_interface_debug_print("apds9960: init failed.\n");
93
94 return 1;
95 }
96
97 /* power on */
99 if (res != 0)
100 {
101 apds9960_interface_debug_print("apds9960: set conf failed.\n");
102 (void)apds9960_deinit(&gs_handle);
103
104 return 1;
105 }
106
107 /* disable wait time */
109 if (res != 0)
110 {
111 apds9960_interface_debug_print("apds9960: set conf failed.\n");
112 (void)apds9960_deinit(&gs_handle);
113
114 return 1;
115 }
116
117 /* disable proximity detect */
119 if (res != 0)
120 {
121 apds9960_interface_debug_print("apds9960: set conf failed.\n");
122 (void)apds9960_deinit(&gs_handle);
123
124 return 1;
125 }
126
127 /* disable als */
129 if (res != 0)
130 {
131 apds9960_interface_debug_print("apds9960: set conf failed.\n");
132 (void)apds9960_deinit(&gs_handle);
133
134 return 1;
135 }
136
137 /* disable als interrupt */
139 if (res != 0)
140 {
141 apds9960_interface_debug_print("apds9960: set conf failed.\n");
142 (void)apds9960_deinit(&gs_handle);
143
144 return 1;
145 }
146
147 /* disable proximity interrupt */
149 if (res != 0)
150 {
151 apds9960_interface_debug_print("apds9960: set conf failed.\n");
152 (void)apds9960_deinit(&gs_handle);
153
154 return 1;
155 }
156
157 /* disable gesture */
159 if (res != 0)
160 {
161 apds9960_interface_debug_print("apds9960: set conf failed.\n");
162 (void)apds9960_deinit(&gs_handle);
163
164 return 1;
165 }
166
167 /* convert adc integration time */
169 if (res != 0)
170 {
171 apds9960_interface_debug_print("apds9960: adc integration time convert to register failed.\n");
172 (void)apds9960_deinit(&gs_handle);
173
174 return 1;
175 }
176
177 /* set adc integration time */
178 res = apds9960_set_adc_integration_time(&gs_handle, reg);
179 if (res != 0)
180 {
181 apds9960_interface_debug_print("apds9960: set adc integration time failed.\n");
182 (void)apds9960_deinit(&gs_handle);
183
184 return 1;
185 }
186
187 /* disable wait long */
189 if (res != 0)
190 {
191 apds9960_interface_debug_print("apds9960: set wait long failed.\n");
192 (void)apds9960_deinit(&gs_handle);
193
194 return 1;
195 }
196
197 /* wait time convert to register */
199 if (res != 0)
200 {
201 apds9960_interface_debug_print("apds9960: wait time convert to register failed.\n");
202 (void)apds9960_deinit(&gs_handle);
203
204 return 1;
205 }
206
207 /* set wait time */
208 res = apds9960_set_wait_time(&gs_handle, reg);
209 if (res != 0)
210 {
211 apds9960_interface_debug_print("apds9960: set wait time failed.\n");
212 (void)apds9960_deinit(&gs_handle);
213
214 return 1;
215 }
216
217 /* set als interrupt low threshold */
218 res = apds9960_set_als_interrupt_low_threshold(&gs_handle, als_low_threshold);
219 if (res != 0)
220 {
221 apds9960_interface_debug_print("apds9960: set als interrupt low threshold failed.\n");
222 (void)apds9960_deinit(&gs_handle);
223
224 return 1;
225 }
226
227 /* set als interrupt high threshold */
228 res = apds9960_set_als_interrupt_high_threshold(&gs_handle, als_high_threshold);
229 if (res != 0)
230 {
231 apds9960_interface_debug_print("apds9960: set als interrupt high threshold failed.\n");
232 (void)apds9960_deinit(&gs_handle);
233
234 return 1;
235 }
236
237 /* set proximity interrupt low threshold */
238 res = apds9960_set_proximity_interrupt_low_threshold(&gs_handle, proximity_low_threshold);
239 if (res != 0)
240 {
241 apds9960_interface_debug_print("apds9960: set proximity interrupt low threshold failed.\n");
242 (void)apds9960_deinit(&gs_handle);
243
244 return 1;
245 }
246
247 /* set proximity interrupt high threshold */
248 res = apds9960_set_proximity_interrupt_high_threshold(&gs_handle, proximity_high_threshold);
249 if (res != 0)
250 {
251 apds9960_interface_debug_print("apds9960: set proximity interrupt high threshold failed.\n");
252 (void)apds9960_deinit(&gs_handle);
253
254 return 1;
255 }
256
257 /* proximity interrupt cycle */
259 if (res != 0)
260 {
261 apds9960_interface_debug_print("apds9960: set proximity interrupt cycle failed.\n");
262 (void)apds9960_deinit(&gs_handle);
263
264 return 1;
265 }
266
267 /* als interrupt cycle */
269 if (res != 0)
270 {
271 apds9960_interface_debug_print("apds9960: set als interrupt cycle failed.\n");
272 (void)apds9960_deinit(&gs_handle);
273
274 return 1;
275 }
276
277 /* set proximity pulse length */
279 if (res != 0)
280 {
281 apds9960_interface_debug_print("apds9960: set proximity pulse length failed.\n");
282 (void)apds9960_deinit(&gs_handle);
283
284 return 1;
285 }
286
287 /* set proximity pulse count */
289 if (res != 0)
290 {
291 apds9960_interface_debug_print("apds9960: set proximity pulse count failed.\n");
292 (void)apds9960_deinit(&gs_handle);
293
294 return 1;
295 }
296
297 /* set led current */
299 if (res != 0)
300 {
301 apds9960_interface_debug_print("apds9960: set led current failed.\n");
302 (void)apds9960_deinit(&gs_handle);
303
304 return 1;
305 }
306
307 /* set proximity gain */
309 if (res != 0)
310 {
311 apds9960_interface_debug_print("apds9960: set proximity gain failed.\n");
312 (void)apds9960_deinit(&gs_handle);
313
314 return 1;
315 }
316
317 /* set als color gain */
319 if (res != 0)
320 {
321 apds9960_interface_debug_print("apds9960: set als color gain failed.\n");
322 (void)apds9960_deinit(&gs_handle);
323
324 return 1;
325 }
326
327 /* set proximity saturation interrupt */
329 if (res != 0)
330 {
331 apds9960_interface_debug_print("apds9960: set saturation interrupt failed.\n");
332 (void)apds9960_deinit(&gs_handle);
333
334 return 1;
335 }
336
337 /* set clear photo diode saturation interrupt */
339 if (res != 0)
340 {
341 apds9960_interface_debug_print("apds9960: set saturation interrupt failed.\n");
342 (void)apds9960_deinit(&gs_handle);
343
344 return 1;
345 }
346
347 /* set led boost */
349 if (res != 0)
350 {
351 apds9960_interface_debug_print("apds9960: set led boost failed.\n");
352 (void)apds9960_deinit(&gs_handle);
353
354 return 1;
355 }
356
357 /* set proximity up right offset */
359 if (res != 0)
360 {
361 apds9960_interface_debug_print("apds9960: set proximity up right offset failed.\n");
362 (void)apds9960_deinit(&gs_handle);
363
364 return 1;
365 }
366
367 /* set proximity down left offset */
369 if (res != 0)
370 {
371 apds9960_interface_debug_print("apds9960: set proximity down left offset failed.\n");
372 (void)apds9960_deinit(&gs_handle);
373
374 return 1;
375 }
376
377 /* set proximity gain compensation */
379 if (res != 0)
380 {
381 apds9960_interface_debug_print("apds9960: set proximity gain compensation failed.\n");
382 (void)apds9960_deinit(&gs_handle);
383
384 return 1;
385 }
386
387 /* set sleep after interrupt */
389 if (res != 0)
390 {
391 apds9960_interface_debug_print("apds9960: set sleep after interrupt failed.\n");
392 (void)apds9960_deinit(&gs_handle);
393
394 return 1;
395 }
396
397 /* set proximity mask up */
399 if (res != 0)
400 {
401 apds9960_interface_debug_print("apds9960: set proximity mask failed.\n");
402 (void)apds9960_deinit(&gs_handle);
403
404 return 1;
405 }
406
407 /* set proximity mask down */
409 if (res != 0)
410 {
411 apds9960_interface_debug_print("apds9960: set proximity mask failed.\n");
412 (void)apds9960_deinit(&gs_handle);
413
414 return 1;
415 }
416
417 /* set proximity mask left */
419 if (res != 0)
420 {
421 apds9960_interface_debug_print("apds9960: set proximity mask failed.\n");
422 (void)apds9960_deinit(&gs_handle);
423
424 return 1;
425 }
426
427 /* set proximity mask right */
429 if (res != 0)
430 {
431 apds9960_interface_debug_print("apds9960: set proximity mask failed.\n");
432 (void)apds9960_deinit(&gs_handle);
433
434 return 1;
435 }
436
437 /* set gesture proximity enter threshold */
439 if (res != 0)
440 {
441 apds9960_interface_debug_print("apds9960: set gesture proximity enter threshold failed.\n");
442 (void)apds9960_deinit(&gs_handle);
443
444 return 1;
445 }
446
447 /* set gesture proximity exit threshold */
449 if (res != 0)
450 {
451 apds9960_interface_debug_print("apds9960: set gesture proximity exit threshold failed.\n");
452 (void)apds9960_deinit(&gs_handle);
453
454 return 1;
455 }
456
457 /* set gesture fifo threshold */
459 if (res != 0)
460 {
461 apds9960_interface_debug_print("apds9960: set gesture fifo threshold failed.\n");
462 (void)apds9960_deinit(&gs_handle);
463
464 return 1;
465 }
466
467 /* set gesture exit persistence */
469 if (res != 0)
470 {
471 apds9960_interface_debug_print("apds9960: set gesture exit persistence failed.\n");
472 (void)apds9960_deinit(&gs_handle);
473
474 return 1;
475 }
476
477 /* set gesture exit mask */
479 if (res != 0)
480 {
481 apds9960_interface_debug_print("apds9960: set gesture exit mask failed.\n");
482 (void)apds9960_deinit(&gs_handle);
483
484 return 1;
485 }
486
487 /* set gesture gain */
489 if (res != 0)
490 {
491 apds9960_interface_debug_print("apds9960: set gesture gain failed.\n");
492 (void)apds9960_deinit(&gs_handle);
493
494 return 1;
495 }
496
497 /* set gesture led current */
499 if (res != 0)
500 {
501 apds9960_interface_debug_print("apds9960: set gesture led current failed.\n");
502 (void)apds9960_deinit(&gs_handle);
503
504 return 1;
505 }
506
507 /* set gesture wait time */
509 if (res != 0)
510 {
511 apds9960_interface_debug_print("apds9960: set gesture wait time failed.\n");
512 (void)apds9960_deinit(&gs_handle);
513
514 return 1;
515 }
516
517 /* set gesture up offset */
519 if (res != 0)
520 {
521 apds9960_interface_debug_print("apds9960: set gesture up offset failed.\n");
522 (void)apds9960_deinit(&gs_handle);
523
524 return 1;
525 }
526
527 /* set gesture down offset */
529 if (res != 0)
530 {
531 apds9960_interface_debug_print("apds9960: set gesture down offset failed.\n");
532 (void)apds9960_deinit(&gs_handle);
533
534 return 1;
535 }
536
537 /* set gesture left offset */
539 if (res != 0)
540 {
541 apds9960_interface_debug_print("apds9960: set gesture left offset failed.\n");
542 (void)apds9960_deinit(&gs_handle);
543
544 return 1;
545 }
546
547 /* set gesture right offset */
549 if (res != 0)
550 {
551 apds9960_interface_debug_print("apds9960: set gesture right offset failed.\n");
552 (void)apds9960_deinit(&gs_handle);
553
554 return 1;
555 }
556
557 /* set gesture pulse length */
559 if (res != 0)
560 {
561 apds9960_interface_debug_print("apds9960: set gesture pulse length failed.\n");
562 (void)apds9960_deinit(&gs_handle);
563
564 return 1;
565 }
566
567 /* set gesture pulse count */
569 if (res != 0)
570 {
571 apds9960_interface_debug_print("apds9960: set gesture pulse count failed.\n");
572 (void)apds9960_deinit(&gs_handle);
573
574 return 1;
575 }
576
577 /* set gesture dimension */
579 if (res != 0)
580 {
581 apds9960_interface_debug_print("apds9960: set gesture dimension failed.\n");
582 (void)apds9960_deinit(&gs_handle);
583
584 return 1;
585 }
586
587 /* gesture fifo clear */
588 res = apds9960_gesture_fifo_clear(&gs_handle);
589 if (res != 0)
590 {
591 apds9960_interface_debug_print("apds9960: gesture fifo clear failed.\n");
592 (void)apds9960_deinit(&gs_handle);
593
594 return 1;
595 }
596
597 /* set gesture interrupt */
599 if (res != 0)
600 {
601 apds9960_interface_debug_print("apds9960: set gesture interrupt failed.\n");
602 (void)apds9960_deinit(&gs_handle);
603
604 return 1;
605 }
606
607 /* set gesture mode */
609 if (res != 0)
610 {
611 apds9960_interface_debug_print("apds9960: set gesture mode failed.\n");
612 (void)apds9960_deinit(&gs_handle);
613
614 return 1;
615 }
616
617 /* all non gesture interrupt clear */
619 if (res != 0)
620 {
621 apds9960_interface_debug_print("apds9960: all non gesture interrupt clear failed.\n");
622 (void)apds9960_deinit(&gs_handle);
623
624 return 1;
625 }
626
627 /* enable wait time */
629 if (res != 0)
630 {
631 apds9960_interface_debug_print("apds9960: set conf failed.\n");
632 (void)apds9960_deinit(&gs_handle);
633
634 return 1;
635 }
636
637 /* enable proximity detect */
639 if (res != 0)
640 {
641 apds9960_interface_debug_print("apds9960: set conf failed.\n");
642 (void)apds9960_deinit(&gs_handle);
643
644 return 1;
645 }
646
647 /* enable als */
649 if (res != 0)
650 {
651 apds9960_interface_debug_print("apds9960: set conf failed.\n");
652 (void)apds9960_deinit(&gs_handle);
653
654 return 1;
655 }
656
657 /* enable als interrupt */
659 if (res != 0)
660 {
661 apds9960_interface_debug_print("apds9960: set conf failed.\n");
662 (void)apds9960_deinit(&gs_handle);
663
664 return 1;
665 }
666
667 /* enable proximity interrupt */
669 if (res != 0)
670 {
671 apds9960_interface_debug_print("apds9960: set conf failed.\n");
672 (void)apds9960_deinit(&gs_handle);
673
674 return 1;
675 }
676
677 return 0;
678}
679
688{
689 if (apds9960_deinit(&gs_handle) != 0)
690 {
691 return 1;
692 }
693 else
694 {
695 return 0;
696 }
697}
698
710uint8_t apds9960_interrupt_read_rgbc(uint16_t *red, uint16_t *green, uint16_t *blue, uint16_t *clear)
711{
712 if (apds9960_read_rgbc(&gs_handle, red, green, blue, clear) != 0)
713 {
714 return 1;
715 }
716 else
717 {
718 return 0;
719 }
720}
721
730uint8_t apds9960_interrupt_read_proximity(uint8_t *proximity)
731{
732 if (apds9960_read_proximity(&gs_handle, proximity) != 0)
733 {
734 return 1;
735 }
736 else
737 {
738 return 0;
739 }
740}
driver apds9960 interrupt 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_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_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_read_proximity(apds9960_handle_t *handle, uint8_t *proximity)
read the proximity 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_read_rgbc(apds9960_handle_t *handle, uint16_t *red, uint16_t *green, uint16_t *blue, uint16_t *clear)
read the rgbc data
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_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
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_EXIT_PERSISTENCE
#define APDS9960_INTERRUPT_DEFAULT_SATURATION_INTERRUPT_PROXIMITY
#define APDS9960_INTERRUPT_DEFAULT_PROXIMITY_PULSE_LENGTH
#define APDS9960_INTERRUPT_DEFAULT_SATURATION_INTERRUPT_CLEAR_PHOTODIODE
#define APDS9960_INTERRUPT_DEFAULT_PROXIMITY_GAIN_COMPENSATION
#define APDS9960_INTERRUPT_DEFAULT_ADC_INTEGRATION_TIME
apds9960 interrupt example default definition
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_GAIN
uint8_t apds9960_interrupt_irq_handler(void)
interrupt irq
#define APDS9960_INTERRUPT_DEFAULT_LED_CURRENT
uint8_t apds9960_interrupt_read_rgbc(uint16_t *red, uint16_t *green, uint16_t *blue, uint16_t *clear)
interrupt example read rgbc
#define APDS9960_INTERRUPT_DEFAULT_WAIT_TIME
#define APDS9960_INTERRUPT_DEFAULT_PROXIMITY_GAIN
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_EXIT_MASK
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_UP_OFFSET
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_DIMENSION
#define APDS9960_INTERRUPT_DEFAULT_PROXIMITY_PULSE_COUNT
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_WAIT_TIME
#define APDS9960_INTERRUPT_DEFAULT_ALS_INTERRUPT_CYCLE
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_INTERRUPT
uint8_t apds9960_interrupt_init(void(*callback)(uint8_t type), uint16_t als_low_threshold, uint16_t als_high_threshold, uint8_t proximity_low_threshold, uint8_t proximity_high_threshold)
interrupt example init
#define APDS9960_INTERRUPT_DEFAULT_PROXIMITY_MASK_DOWN
#define APDS9960_INTERRUPT_DEFAULT_PROXIMITY_INTERRUPT_CYCLE
#define APDS9960_INTERRUPT_DEFAULT_ALS_COLOR_GAIN
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_LEFT_OFFSET
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_RIGHT_OFFSET
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_PULSE_LENGTH
#define APDS9960_INTERRUPT_DEFAULT_PROXIMITY_MASK_UP
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_PROXIMITY_ENTER_THRESHOLD
#define APDS9960_INTERRUPT_DEFAULT_PROXIMITY_UP_RIGHT_OFFSET
#define APDS9960_INTERRUPT_DEFAULT_PROXIMITY_MASK_RIGHT
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_LED_CURRENT
#define APDS9960_INTERRUPT_DEFAULT_SLEEP_AFTER_INTERRUPT
uint8_t apds9960_interrupt_read_proximity(uint8_t *proximity)
interrupt example read proximity
#define APDS9960_INTERRUPT_DEFAULT_PROXIMITY_MASK_LEFT
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_PULSE_COUNT
uint8_t apds9960_interrupt_deinit(void)
interrupt example deinit
#define APDS9960_INTERRUPT_DEFAULT_PROXIMITY_DOWN_LEFT_OFFSET
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_FIFO_THRESHOLD
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_DOWN_OFFSET
#define APDS9960_INTERRUPT_DEFAULT_LED_BOOST
#define APDS9960_INTERRUPT_DEFAULT_GESTURE_PROXIMITY_EXIT_THRESHOLD
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