LibDriver APDS9960
Loading...
Searching...
No Matches
driver_apds9960_basic.c
Go to the documentation of this file.
1
36
38
39static apds9960_handle_t gs_handle;
40
49{
50 uint8_t res;
51 uint8_t reg;
52
53 /* link interface function */
62
63 /* init the apds9960 */
64 res = apds9960_init(&gs_handle);
65 if (res != 0)
66 {
67 apds9960_interface_debug_print("apds9960: init failed.\n");
68
69 return 1;
70 }
71
72 /* power on */
74 if (res != 0)
75 {
76 apds9960_interface_debug_print("apds9960: set conf failed.\n");
77 (void)apds9960_deinit(&gs_handle);
78
79 return 1;
80 }
81
82 /* disable wait time */
84 if (res != 0)
85 {
86 apds9960_interface_debug_print("apds9960: set conf failed.\n");
87 (void)apds9960_deinit(&gs_handle);
88
89 return 1;
90 }
91
92 /* disable proximity detect */
94 if (res != 0)
95 {
96 apds9960_interface_debug_print("apds9960: set conf failed.\n");
97 (void)apds9960_deinit(&gs_handle);
98
99 return 1;
100 }
101
102 /* disable als */
104 if (res != 0)
105 {
106 apds9960_interface_debug_print("apds9960: set conf failed.\n");
107 (void)apds9960_deinit(&gs_handle);
108
109 return 1;
110 }
111
112 /* disable als interrupt */
114 if (res != 0)
115 {
116 apds9960_interface_debug_print("apds9960: set conf failed.\n");
117 (void)apds9960_deinit(&gs_handle);
118
119 return 1;
120 }
121
122 /* disable proximity interrupt */
124 if (res != 0)
125 {
126 apds9960_interface_debug_print("apds9960: set conf failed.\n");
127 (void)apds9960_deinit(&gs_handle);
128
129 return 1;
130 }
131
132 /* disable gesture */
134 if (res != 0)
135 {
136 apds9960_interface_debug_print("apds9960: set conf failed.\n");
137 (void)apds9960_deinit(&gs_handle);
138
139 return 1;
140 }
141
142 /* convert adc integration time */
144 if (res != 0)
145 {
146 apds9960_interface_debug_print("apds9960: adc integration time convert to register failed.\n");
147 (void)apds9960_deinit(&gs_handle);
148
149 return 1;
150 }
151
152 /* set adc integration time */
153 res = apds9960_set_adc_integration_time(&gs_handle, reg);
154 if (res != 0)
155 {
156 apds9960_interface_debug_print("apds9960: set adc integration time failed.\n");
157 (void)apds9960_deinit(&gs_handle);
158
159 return 1;
160 }
161
162 /* disable wait long */
164 if (res != 0)
165 {
166 apds9960_interface_debug_print("apds9960: set wait long failed.\n");
167 (void)apds9960_deinit(&gs_handle);
168
169 return 1;
170 }
171
172 /* wait time convert to register */
174 if (res != 0)
175 {
176 apds9960_interface_debug_print("apds9960: wait time convert to register failed.\n");
177 (void)apds9960_deinit(&gs_handle);
178
179 return 1;
180 }
181
182 /* set wait time */
183 res = apds9960_set_wait_time(&gs_handle, reg);
184 if (res != 0)
185 {
186 apds9960_interface_debug_print("apds9960: set wait time failed.\n");
187 (void)apds9960_deinit(&gs_handle);
188
189 return 1;
190 }
191
192 /* set als interrupt low threshold */
194 if (res != 0)
195 {
196 apds9960_interface_debug_print("apds9960: set als interrupt low threshold failed.\n");
197 (void)apds9960_deinit(&gs_handle);
198
199 return 1;
200 }
201
202 /* set als interrupt high threshold */
204 if (res != 0)
205 {
206 apds9960_interface_debug_print("apds9960: set als interrupt high threshold failed.\n");
207 (void)apds9960_deinit(&gs_handle);
208
209 return 1;
210 }
211
212 /* set proximity interrupt low threshold */
214 if (res != 0)
215 {
216 apds9960_interface_debug_print("apds9960: set proximity interrupt low threshold failed.\n");
217 (void)apds9960_deinit(&gs_handle);
218
219 return 1;
220 }
221
222 /* set proximity interrupt high threshold */
224 if (res != 0)
225 {
226 apds9960_interface_debug_print("apds9960: set proximity interrupt high threshold failed.\n");
227 (void)apds9960_deinit(&gs_handle);
228
229 return 1;
230 }
231
232 /* proximity interrupt cycle */
234 if (res != 0)
235 {
236 apds9960_interface_debug_print("apds9960: set proximity interrupt cycle failed.\n");
237 (void)apds9960_deinit(&gs_handle);
238
239 return 1;
240 }
241
242 /* als interrupt cycle */
244 if (res != 0)
245 {
246 apds9960_interface_debug_print("apds9960: set als interrupt cycle failed.\n");
247 (void)apds9960_deinit(&gs_handle);
248
249 return 1;
250 }
251
252 /* set proximity pulse length */
254 if (res != 0)
255 {
256 apds9960_interface_debug_print("apds9960: set proximity pulse length failed.\n");
257 (void)apds9960_deinit(&gs_handle);
258
259 return 1;
260 }
261
262 /* set proximity pulse count */
264 if (res != 0)
265 {
266 apds9960_interface_debug_print("apds9960: set proximity pulse count failed.\n");
267 (void)apds9960_deinit(&gs_handle);
268
269 return 1;
270 }
271
272 /* set led current */
274 if (res != 0)
275 {
276 apds9960_interface_debug_print("apds9960: set led current failed.\n");
277 (void)apds9960_deinit(&gs_handle);
278
279 return 1;
280 }
281
282 /* set proximity gain */
284 if (res != 0)
285 {
286 apds9960_interface_debug_print("apds9960: set proximity gain failed.\n");
287 (void)apds9960_deinit(&gs_handle);
288
289 return 1;
290 }
291
292 /* set als color gain */
294 if (res != 0)
295 {
296 apds9960_interface_debug_print("apds9960: set als color gain failed.\n");
297 (void)apds9960_deinit(&gs_handle);
298
299 return 1;
300 }
301
302 /* set proximity saturation interrupt */
304 if (res != 0)
305 {
306 apds9960_interface_debug_print("apds9960: set saturation interrupt failed.\n");
307 (void)apds9960_deinit(&gs_handle);
308
309 return 1;
310 }
311
312 /* set clear photo diode saturation interrupt */
314 if (res != 0)
315 {
316 apds9960_interface_debug_print("apds9960: set saturation interrupt failed.\n");
317 (void)apds9960_deinit(&gs_handle);
318
319 return 1;
320 }
321
322 /* set led boost */
324 if (res != 0)
325 {
326 apds9960_interface_debug_print("apds9960: set led boost failed.\n");
327 (void)apds9960_deinit(&gs_handle);
328
329 return 1;
330 }
331
332 /* set proximity up right offset */
334 if (res != 0)
335 {
336 apds9960_interface_debug_print("apds9960: set proximity up right offset failed.\n");
337 (void)apds9960_deinit(&gs_handle);
338
339 return 1;
340 }
341
342 /* set proximity down left offset */
344 if (res != 0)
345 {
346 apds9960_interface_debug_print("apds9960: set proximity down left offset failed.\n");
347 (void)apds9960_deinit(&gs_handle);
348
349 return 1;
350 }
351
352 /* set proximity gain compensation */
354 if (res != 0)
355 {
356 apds9960_interface_debug_print("apds9960: set proximity gain compensation failed.\n");
357 (void)apds9960_deinit(&gs_handle);
358
359 return 1;
360 }
361
362 /* set sleep after interrupt */
364 if (res != 0)
365 {
366 apds9960_interface_debug_print("apds9960: set sleep after interrupt failed.\n");
367 (void)apds9960_deinit(&gs_handle);
368
369 return 1;
370 }
371
372 /* set proximity mask up */
374 if (res != 0)
375 {
376 apds9960_interface_debug_print("apds9960: set proximity mask failed.\n");
377 (void)apds9960_deinit(&gs_handle);
378
379 return 1;
380 }
381
382 /* set proximity mask down */
384 if (res != 0)
385 {
386 apds9960_interface_debug_print("apds9960: set proximity mask failed.\n");
387 (void)apds9960_deinit(&gs_handle);
388
389 return 1;
390 }
391
392 /* set proximity mask left */
394 if (res != 0)
395 {
396 apds9960_interface_debug_print("apds9960: set proximity mask failed.\n");
397 (void)apds9960_deinit(&gs_handle);
398
399 return 1;
400 }
401
402 /* set proximity mask right */
404 if (res != 0)
405 {
406 apds9960_interface_debug_print("apds9960: set proximity mask failed.\n");
407 (void)apds9960_deinit(&gs_handle);
408
409 return 1;
410 }
411
412 /* set gesture proximity enter threshold */
414 if (res != 0)
415 {
416 apds9960_interface_debug_print("apds9960: set gesture proximity enter threshold failed.\n");
417 (void)apds9960_deinit(&gs_handle);
418
419 return 1;
420 }
421
422 /* set gesture proximity exit threshold */
424 if (res != 0)
425 {
426 apds9960_interface_debug_print("apds9960: set gesture proximity exit threshold failed.\n");
427 (void)apds9960_deinit(&gs_handle);
428
429 return 1;
430 }
431
432 /* set gesture fifo threshold */
434 if (res != 0)
435 {
436 apds9960_interface_debug_print("apds9960: set gesture fifo threshold failed.\n");
437 (void)apds9960_deinit(&gs_handle);
438
439 return 1;
440 }
441
442 /* set gesture exit persistence */
444 if (res != 0)
445 {
446 apds9960_interface_debug_print("apds9960: set gesture exit persistence failed.\n");
447 (void)apds9960_deinit(&gs_handle);
448
449 return 1;
450 }
451
452 /* set gesture exit mask */
454 if (res != 0)
455 {
456 apds9960_interface_debug_print("apds9960: set gesture exit mask failed.\n");
457 (void)apds9960_deinit(&gs_handle);
458
459 return 1;
460 }
461
462 /* set gesture gain */
464 if (res != 0)
465 {
466 apds9960_interface_debug_print("apds9960: set gesture gain failed.\n");
467 (void)apds9960_deinit(&gs_handle);
468
469 return 1;
470 }
471
472 /* set gesture led current */
474 if (res != 0)
475 {
476 apds9960_interface_debug_print("apds9960: set gesture led current failed.\n");
477 (void)apds9960_deinit(&gs_handle);
478
479 return 1;
480 }
481
482 /* set gesture wait time */
484 if (res != 0)
485 {
486 apds9960_interface_debug_print("apds9960: set gesture wait time failed.\n");
487 (void)apds9960_deinit(&gs_handle);
488
489 return 1;
490 }
491
492 /* set gesture up offset */
494 if (res != 0)
495 {
496 apds9960_interface_debug_print("apds9960: set gesture up offset failed.\n");
497 (void)apds9960_deinit(&gs_handle);
498
499 return 1;
500 }
501
502 /* set gesture down offset */
504 if (res != 0)
505 {
506 apds9960_interface_debug_print("apds9960: set gesture down offset failed.\n");
507 (void)apds9960_deinit(&gs_handle);
508
509 return 1;
510 }
511
512 /* set gesture left offset */
514 if (res != 0)
515 {
516 apds9960_interface_debug_print("apds9960: set gesture left offset failed.\n");
517 (void)apds9960_deinit(&gs_handle);
518
519 return 1;
520 }
521
522 /* set gesture right offset */
524 if (res != 0)
525 {
526 apds9960_interface_debug_print("apds9960: set gesture right offset failed.\n");
527 (void)apds9960_deinit(&gs_handle);
528
529 return 1;
530 }
531
532 /* set gesture pulse length */
534 if (res != 0)
535 {
536 apds9960_interface_debug_print("apds9960: set gesture pulse length failed.\n");
537 (void)apds9960_deinit(&gs_handle);
538
539 return 1;
540 }
541
542 /* set gesture pulse count */
544 if (res != 0)
545 {
546 apds9960_interface_debug_print("apds9960: set gesture pulse count failed.\n");
547 (void)apds9960_deinit(&gs_handle);
548
549 return 1;
550 }
551
552 /* set gesture dimension */
554 if (res != 0)
555 {
556 apds9960_interface_debug_print("apds9960: set gesture dimension failed.\n");
557 (void)apds9960_deinit(&gs_handle);
558
559 return 1;
560 }
561
562 /* gesture fifo clear */
563 res = apds9960_gesture_fifo_clear(&gs_handle);
564 if (res != 0)
565 {
566 apds9960_interface_debug_print("apds9960: gesture fifo clear failed.\n");
567 (void)apds9960_deinit(&gs_handle);
568
569 return 1;
570 }
571
572 /* set gesture interrupt */
574 if (res != 0)
575 {
576 apds9960_interface_debug_print("apds9960: set gesture interrupt failed.\n");
577 (void)apds9960_deinit(&gs_handle);
578
579 return 1;
580 }
581
582 /* set gesture mode */
584 if (res != 0)
585 {
586 apds9960_interface_debug_print("apds9960: set gesture mode failed.\n");
587 (void)apds9960_deinit(&gs_handle);
588
589 return 1;
590 }
591
592 /* all non gesture interrupt clear */
594 if (res != 0)
595 {
596 apds9960_interface_debug_print("apds9960: all non gesture interrupt clear failed.\n");
597 (void)apds9960_deinit(&gs_handle);
598
599 return 1;
600 }
601
602 /* enable wait time */
604 if (res != 0)
605 {
606 apds9960_interface_debug_print("apds9960: set conf failed.\n");
607 (void)apds9960_deinit(&gs_handle);
608
609 return 1;
610 }
611
612 /* enable proximity detect */
614 if (res != 0)
615 {
616 apds9960_interface_debug_print("apds9960: set conf failed.\n");
617 (void)apds9960_deinit(&gs_handle);
618
619 return 1;
620 }
621
622 /* enable als */
624 if (res != 0)
625 {
626 apds9960_interface_debug_print("apds9960: set conf failed.\n");
627 (void)apds9960_deinit(&gs_handle);
628
629 return 1;
630 }
631
632 return 0;
633}
634
643{
644 if (apds9960_deinit(&gs_handle) != 0)
645 {
646 return 1;
647 }
648 else
649 {
650 return 0;
651 }
652}
653
665uint8_t apds9960_basic_read_rgbc(uint16_t *red, uint16_t *green, uint16_t *blue, uint16_t *clear)
666{
667 if (apds9960_read_rgbc(&gs_handle, red, green, blue, clear) != 0)
668 {
669 return 1;
670 }
671 else
672 {
673 return 0;
674 }
675}
676
685uint8_t apds9960_basic_read_proximity(uint8_t *proximity)
686{
687 if (apds9960_read_proximity(&gs_handle, proximity) != 0)
688 {
689 return 1;
690 }
691 else
692 {
693 return 0;
694 }
695}
driver apds9960 basic 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_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_BASIC_DEFAULT_GESTURE_GAIN
#define APDS9960_BASIC_DEFAULT_GESTURE_PROXIMITY_ENTER_THRESHOLD
#define APDS9960_BASIC_DEFAULT_GESTURE_RIGHT_OFFSET
#define APDS9960_BASIC_DEFAULT_PROXIMITY_INTERRUPT_CYCLE
#define APDS9960_BASIC_DEFAULT_GESTURE_PULSE_COUNT
#define APDS9960_BASIC_DEFAULT_SATURATION_INTERRUPT_PROXIMITY
#define APDS9960_BASIC_DEFAULT_ALS_INTERRUPT_CYCLE
#define APDS9960_BASIC_DEFAULT_WAIT_TIME
#define APDS9960_BASIC_DEFAULT_ADC_INTEGRATION_TIME
apds9960 basic example default definition
#define APDS9960_BASIC_DEFAULT_PROXIMITY_MASK_UP
#define APDS9960_BASIC_DEFAULT_PROXIMITY_MASK_DOWN
#define APDS9960_BASIC_DEFAULT_PROXIMITY_INTERRUPT_HIGH_THRESHOLD
#define APDS9960_BASIC_DEFAULT_PROXIMITY_UP_RIGHT_OFFSET
#define APDS9960_BASIC_DEFAULT_SLEEP_AFTER_INTERRUPT
#define APDS9960_BASIC_DEFAULT_PROXIMITY_MASK_LEFT
#define APDS9960_BASIC_DEFAULT_PROXIMITY_DOWN_LEFT_OFFSET
#define APDS9960_BASIC_DEFAULT_GESTURE_INTERRUPT
#define APDS9960_BASIC_DEFAULT_ALS_COLOR_GAIN
#define APDS9960_BASIC_DEFAULT_GESTURE_DIMENSION
#define APDS9960_BASIC_DEFAULT_PROXIMITY_INTERRUPT_LOW_THRESHOLD
#define APDS9960_BASIC_DEFAULT_PROXIMITY_PULSE_COUNT
#define APDS9960_BASIC_DEFAULT_ALS_INTERRUPT_HIGH_THRESHOLD
uint8_t apds9960_basic_deinit(void)
basic example deinit
#define APDS9960_BASIC_DEFAULT_GESTURE_PULSE_LENGTH
#define APDS9960_BASIC_DEFAULT_GESTURE_LEFT_OFFSET
#define APDS9960_BASIC_DEFAULT_ALS_INTERRUPT_LOW_THRESHOLD
#define APDS9960_BASIC_DEFAULT_GESTURE_PROXIMITY_EXIT_THRESHOLD
#define APDS9960_BASIC_DEFAULT_PROXIMITY_MASK_RIGHT
#define APDS9960_BASIC_DEFAULT_GESTURE_DOWN_OFFSET
#define APDS9960_BASIC_DEFAULT_GESTURE_EXIT_MASK
#define APDS9960_BASIC_DEFAULT_SATURATION_INTERRUPT_CLEAR_PHOTODIODE
#define APDS9960_BASIC_DEFAULT_GESTURE_EXIT_PERSISTENCE
#define APDS9960_BASIC_DEFAULT_PROXIMITY_GAIN_COMPENSATION
#define APDS9960_BASIC_DEFAULT_GESTURE_WAIT_TIME
#define APDS9960_BASIC_DEFAULT_LED_BOOST
#define APDS9960_BASIC_DEFAULT_PROXIMITY_GAIN
#define APDS9960_BASIC_DEFAULT_GESTURE_UP_OFFSET
#define APDS9960_BASIC_DEFAULT_GESTURE_LED_CURRENT
uint8_t apds9960_basic_init(void)
basic example init
#define APDS9960_BASIC_DEFAULT_PROXIMITY_PULSE_LENGTH
uint8_t apds9960_basic_read_proximity(uint8_t *proximity)
basic example read proximity
uint8_t apds9960_basic_read_rgbc(uint16_t *red, uint16_t *green, uint16_t *blue, uint16_t *clear)
basic example read rgbc
#define APDS9960_BASIC_DEFAULT_GESTURE_FIFO_THRESHOLD
#define APDS9960_BASIC_DEFAULT_LED_CURRENT
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_receive_callback(uint8_t type)
interface receive callback
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