LibDriver MAX30205
Loading...
Searching...
No Matches
driver_max30205.c
Go to the documentation of this file.
1
37
38#include "driver_max30205.h"
39
43#define CHIP_NAME "Maxim Integrated MAX30205"
44#define MANUFACTURER_NAME "Maxim Integrated"
45#define SUPPLY_VOLTAGE_MIN 2.7f
46#define SUPPLY_VOLTAGE_MAX 3.3f
47#define MAX_CURRENT 20.0f
48#define TEMPERATURE_MIN 0.0f
49#define TEMPERATURE_MAX 50.0f
50#define DRIVER_VERSION 2000
51
55#define MAX30205_REG_TEMP 0x00
56#define MAX30205_REG_CONF 0x01
57#define MAX30205_REG_THYST 0x02
58#define MAX30205_REG_TOS 0x03
59
71{
72 if (handle == NULL) /* check handle */
73 {
74 return 2; /* return error */
75 }
76 if (handle->debug_print == NULL) /* check debug_print */
77 {
78 return 3; /* return error */
79 }
80 if (handle->iic_init == NULL) /* check iic_init */
81 {
82 handle->debug_print("max30205: iic_init is null.\n"); /* iic_init is null */
83
84 return 3; /* return error */
85 }
86 if (handle->iic_deinit == NULL) /* check iic_deinit */
87 {
88 handle->debug_print("max30205: iic_deinit is null.\n"); /* iic_deinit is null */
89
90 return 3; /* return error */
91 }
92 if (handle->iic_read == NULL) /* check iic_read */
93 {
94 handle->debug_print("max30205: iic_read is null.\n"); /* iic_read is null */
95
96 return 3; /* return error */
97 }
98 if (handle->iic_write == NULL) /* check iic_write */
99 {
100 handle->debug_print("max30205: iic_write is null.\n"); /* iic_write is null */
101
102 return 3; /* return error */
103 }
104 if (handle->delay_ms == NULL) /* check delay_ms */
105 {
106 handle->debug_print("max30205: delay_ms is null.\n"); /* delay_ms is null */
107
108 return 3; /* return error */
109 }
110
111 if (handle->iic_init() != 0) /* init iic */
112 {
113 handle->debug_print("max30205: iic init failed.\n"); /* iic init failed */
114
115 return 1; /* return error */
116 }
117 handle->inited = 1; /* flag finish initialization */
118 handle->reg = 0; /* initialize register */
119
120 return 0; /* success return 0 */
121}
122
134{
135 uint8_t reg;
136
137 if (handle == NULL) /* check handle */
138 {
139 return 2; /* return error */
140 }
141 if (handle->inited != 1) /* check handle initialization */
142 {
143 return 3; /* return error */
144 }
145
146 reg = handle->reg | 0x01; /* power down */
147 if (handle->iic_write(handle->iic_addr, MAX30205_REG_CONF, (uint8_t *)&reg, 1) != 0) /* write to conf register */
148 {
149 handle->debug_print("max30205: power down failed.\n"); /* power down failed */
150
151 return 1; /* return error */
152 }
153 if (handle->iic_deinit() != 0) /* iic deinit */
154 {
155 handle->debug_print("max30205: iic deinit failed.\n"); /* iic deinit failed */
156
157 return 1; /* return error */
158 }
159 handle->inited = 0; /* flag close */
160
161 return 0; /* success return 0 */
162}
163
174{
175 if (handle == NULL) /* check handle */
176 {
177 return 2; /* return error */
178 }
179
180 handle->iic_addr = (uint8_t)addr_pin; /* set iic address */
181
182 return 0; /* success return 0 */
183}
184
195{
196 if (handle == NULL) /* check handle */
197 {
198 return 2; /* return error */
199 }
200
201 *addr_pin = (max30205_address_t)handle->iic_addr; /* get iic address */
202
203 return 0; /* success return 0 */
204}
205
217{
218 if (handle == NULL) /* check handle */
219 {
220 return 2; /* return error */
221 }
222 if (handle->inited != 1) /* check handle initialization */
223 {
224 return 3; /* return error */
225 }
226
227 if (format != 0) /* if extended format */
228 {
229 handle->reg = handle->reg | (1 << 5); /* set extended format */
230 }
231 else
232 {
233 handle->reg = handle->reg & (~(1 << 5)); /* set normal format */
234 }
235
236 return 0; /* success return 0 */
237}
238
250{
251 if (handle == NULL) /* check handle */
252 {
253 return 2; /* return error */
254 }
255 if (handle->inited != 1) /* check handle initialization */
256 {
257 return 3; /* return error */
258 }
259
260 if ((handle->reg & (1 << 5)) != 0) /* get format */
261 {
262 *format = MAX30205_DATA_FORMAT_EXTENDED; /* get format extended */
263 }
264 else
265 {
266 *format = MAX30205_DATA_FORMAT_NORMAL; /* get format normal */
267 }
268
269 return 0; /* success return 0 */
270}
271
283{
284 if (handle == NULL) /* check handle */
285 {
286 return 2; /* return error */
287 }
288 if (handle->inited != 1) /* check handle initialization */
289 {
290 return 3; /* return error */
291 }
292
293 if (mode != 0) /* check the mode */
294 {
295 handle->reg = handle->reg | (1 << 1); /* set interrupt mode */
296 }
297 else
298 {
299 handle->reg = handle->reg & (~(1 << 1)); /* set comparator mode */
300 }
301
302 return 0; /* success return 0 */
303}
304
316{
317 if (handle == NULL) /* check handle */
318 {
319 return 2; /* return error */
320 }
321 if (handle->inited != 1) /* check handle initialization */
322 {
323 return 3; /* return error */
324 }
325
326 if ((handle->reg & (1 << 1)) != 0) /* get interrupt mode */
327 {
328 *mode = MAX30205_INTERRUPT_MODE_INTERRUPT; /* interrupt mode */
329 }
330 else
331 {
332 *mode = MAX30205_INTERRUPT_MODE_COMPARATOR; /* comparator mode */
333 }
334
335 return 0; /* success return 0 */
336}
337
349{
350 if (handle == NULL) /* check handle */
351 {
352 return 2; /* return error */
353 }
354 if (handle->inited != 1) /* check handle initialization */
355 {
356 return 3; /* return error */
357 }
358
359 handle->reg = handle->reg & (~(3 << 3)); /* clear fault queue */
360 handle->reg = (uint8_t)(handle->reg |
361 (fault_queue << 3)); /* set fault queue */
362
363 return 0; /* success return 0 */
364}
365
377{
378 if (handle == NULL) /* check handle */
379 {
380 return 2; /* return error */
381 }
382 if (handle->inited != 1) /* check handle initialization */
383 {
384 return 3; /* return error */
385 }
386
387 *fault_queue = (max30205_fault_queue_t)((handle->reg >> 3) & 0x03); /* get fault queue */
388
389 return 0; /* success return 0 */
390}
391
403{
404 if (handle == NULL) /* check handle */
405 {
406 return 2; /* return error */
407 }
408 if (handle->inited != 1) /* check handle initialization */
409 {
410 return 3; /* return error */
411 }
412
413 if (polarity != 0) /* check the polarity */
414 {
415 handle->reg = handle->reg | (1 << 2); /* set active high */
416 }
417 else
418 {
419 handle->reg = handle->reg & (~(1 << 2)); /* set active low */
420 }
421
422 return 0; /* success return 0 */
423}
424
436{
437 if (handle == NULL) /* check handle */
438 {
439 return 2; /* return error */
440 }
441 if (handle->inited != 1) /* check handle initialization */
442 {
443 return 3; /* return error */
444 }
445
446 if ((handle->reg & (1 << 2)) != 0) /* active high */
447 {
448 *polarity = MAX30205_PIN_POLARITY_HIGH; /* high polarity */
449 }
450 else /* active low */
451 {
452 *polarity = MAX30205_PIN_POLARITY_LOW; /* low polarity */
453 }
454
455 return 0; /* success return 0 */
456}
457
469{
470 if (handle == NULL) /* check handle */
471 {
472 return 2; /* return error */
473 }
474 if (handle->inited != 1) /* check handle initialization */
475 {
476 return 3; /* return error */
477 }
478
479 if (bus_timeout != 0) /* check the bus timeout */
480 {
481 handle->reg = handle->reg | (1 << 6); /* disable bus timeout */
482 }
483 else
484 {
485 handle->reg = handle->reg & (~(1 << 6)); /* enable bus timeout */
486 }
487
488 return 0; /* success return 0 */
489}
490
502{
503 if (handle == NULL) /* check handle */
504 {
505 return 2; /* return error */
506 }
507 if (handle->inited != 1) /* check handle initialization */
508 {
509 return 3; /* return error */
510 }
511
512 if ((handle->reg & (1 << 6)) != 0) /* disable bus timeout */
513 {
514 *bus_timeout = MAX30205_BUS_TIMEOUT_DISABLE; /* bus timeout disable */
515 }
516 else /* enable bus timeout */
517 {
518 *bus_timeout = MAX30205_BUS_TIMEOUT_ENABLE; /* bus timeout enable */
519 }
520
521 return 0; /* success return 0 */
522}
523
535{
536 uint8_t reg;
537
538 if (handle == NULL) /* check handle */
539 {
540 return 2; /* return error */
541 }
542 if (handle->inited != 1) /* check handle initialization */
543 {
544 return 3; /* return error */
545 }
546
547 reg = handle->reg & (~(1 << 0)); /* exit shutdown mode */
548 reg = reg & (~(1 << 7)); /* set continuous read bit */
549 if (handle->iic_write(handle->iic_addr, MAX30205_REG_CONF, (uint8_t *)&reg, 1) != 0) /* write conf register */
550 {
551 handle->debug_print("max30205: start continuous read failed.\n"); /* start continuous read failed */
552
553 return 1; /* return error */
554 }
555 else
556 {
557 return 0; /* success return 0 */
558 }
559}
560
572{
573 uint8_t reg;
574
575 if (handle == NULL) /* check handle */
576 {
577 return 2; /* return error */
578 }
579 if (handle->inited != 1) /* check handle initialization */
580 {
581 return 3; /* return error */
582 }
583
584 reg = handle->reg | (1 << 0); /* enter shutdown mode */
585 reg = reg | (1 << 7); /* set continuous read bit */
586
587 if (handle->iic_write(handle->iic_addr, MAX30205_REG_CONF, (uint8_t *)&reg, 1) != 0) /* write conf register */
588 {
589 handle->debug_print("max30205: stop continuous read failed.\n"); /* stop continuous read failed */
590
591 return 1; /* return error */
592 }
593 else
594 {
595 return 0; /* success return 0 */
596 }
597}
598
612uint8_t max30205_continuous_read(max30205_handle_t *handle, int16_t *raw, float *s)
613{
614 uint8_t buf[2];
615
616 if (handle == NULL) /* check handle */
617 {
618 return 2; /* return error */
619 }
620 if (handle->inited != 1) /* check handle initialization */
621 {
622 return 3; /* return error */
623 }
624
625 memset(buf, 0, sizeof(uint8_t) * 2); /* clear the buffer */
626 if (handle->iic_read(handle->iic_addr, MAX30205_REG_TEMP, (uint8_t *)buf, 2) != 0) /* read two bytes */
627 {
628 handle->debug_print("max30205: read failed.\n"); /* read temp failed */
629
630 return 1; /* return error */
631 }
632 if ((handle->reg & (1 << 5)) != 0) /* extended format */
633 {
634 *raw = (int16_t)(((uint16_t)buf[0]) << 8 | buf[1]); /* get raw data */
635 *s = (float)(*raw) * 0.00390625f + 64.0f; /* convert raw data to real data */
636 }
637 else /* normal format */
638 {
639 *raw = (int16_t)(((uint16_t)buf[0]) << 8 | buf[1]); /* get raw data */
640 *s = (float)(*raw) * 0.00390625f; /* convert raw data to real data */
641 }
642
643 return 0; /* success return 0 */
644}
645
658uint8_t max30205_single_read(max30205_handle_t *handle, int16_t *raw, float *s)
659{
660 uint8_t buf[2];
661 uint8_t reg;
662
663 if (handle == NULL) /* check handle */
664 {
665 return 2; /* return error */
666 }
667 if (handle->inited != 1) /* check handle initialization */
668 {
669 return 3; /* return error */
670 }
671
672 reg = handle->reg | (1 << 0); /* enter shutdown mode */
673 reg = reg | (1 << 7); /* set single read bit */
674 if (handle->iic_write(handle->iic_addr, MAX30205_REG_CONF, (uint8_t *)&reg, 1) != 0) /* write conf */
675 {
676 handle->debug_print("max30205: write failed.\n"); /* write failed */
677
678 return 1; /* return error */
679 }
680 handle->delay_ms(50); /* delay 50 ms */
681 handle->reg &= ~(1 << 7); /* clear shot bit */
682 memset(buf, 0, sizeof(uint8_t) * 2); /* clear the buffer */
683 if (handle->iic_read(handle->iic_addr, MAX30205_REG_TEMP, (uint8_t *)buf, 2) != 0) /* read two bytes */
684 {
685 handle->debug_print("max30205: read failed.\n"); /* read failed */
686
687 return 1; /* return error */
688 }
689 if ((handle->reg & (1 << 5)) != 0) /* extended format */
690 {
691 *raw = (int16_t)(((uint16_t)buf[0]) << 8 | buf[1]); /* get raw data */
692 *s = (float)(*raw) * 0.00390625f + 64.0f; /* convert raw data to real data */
693 }
694 else /* normal format */
695 {
696 *raw = (int16_t)(((uint16_t)buf[0]) << 8 | buf[1]); /* get raw data */
697 *s = (float)(*raw) * 0.00390625f; /* convert raw data to real data */
698 }
699
700 return 0; /* success return 0 */
701}
702
715{
716 uint8_t buf[2];
717
718 if (handle == NULL) /* check handle */
719 {
720 return 2; /* return error */
721 }
722 if (handle->inited != 1) /* check handle initialization */
723 {
724 return 3; /* return error */
725 }
726
727 buf[0] = (threshold >> 8) & 0xFF; /* MSB */
728 buf[1] = threshold & 0xFF; /* LSB */
729 if (handle->iic_write(handle->iic_addr, MAX30205_REG_THYST, (uint8_t *)buf, 2) != 0) /* write to register */
730 {
731 handle->debug_print("max30205: set interrupt low threshold failed.\n"); /* set interrupt low threshold failed */
732
733 return 1; /* return error */
734 }
735 else
736 {
737 return 0; /* success return 0 */
738 }
739}
740
752uint8_t max30205_get_interrupt_low_threshold(max30205_handle_t *handle, int16_t *threshold)
753{
754 uint8_t buf[2];
755
756 if (handle == NULL) /* check handle */
757 {
758 return 2; /* return error */
759 }
760 if (handle->inited != 1) /* check handle initialization */
761 {
762 return 3; /* return error */
763 }
764
765 memset(buf, 0, sizeof(uint8_t) * 2); /* clear the buffer */
766 if (handle->iic_read(handle->iic_addr, MAX30205_REG_THYST, (uint8_t *)buf, 2) != 0) /* read 2 bytes */
767 {
768 handle->debug_print("max30205: read failed.\n"); /* read thyst failed */
769
770 return 1; /* return error */
771 }
772 *threshold = (int16_t)(((uint16_t)buf[0]) << 8 | buf[1]); /* get raw data */
773
774 return 0; /* success return 0 */
775}
776
789{
790 uint8_t buf[2];
791
792 if (handle == NULL) /* check handle */
793 {
794 return 2; /* return error */
795 }
796 if (handle->inited != 1) /* check handle initialization */
797 {
798 return 3; /* return error */
799 }
800
801 buf[0] = (threshold >> 8) & 0xFF; /* MSB */
802 buf[1] = threshold & 0xFF; /* LSB */
803 if (handle->iic_write(handle->iic_addr, MAX30205_REG_TOS, (uint8_t *)buf, 2) != 0) /* write to register */
804 {
805 handle->debug_print("max30205: set interrupt high threshold failed.\n"); /* set interrupt high threshold failed */
806
807 return 1; /* return error */
808 }
809 else
810 {
811 return 0; /* success return 0 */
812 }
813}
814
827{
828 uint8_t buf[2];
829
830 if (handle == NULL) /* check handle */
831 {
832 return 2; /* return error */
833 }
834 if (handle->inited != 1) /* check handle initialization */
835 {
836 return 3; /* return error */
837 }
838
839 memset(buf, 0, sizeof(uint8_t) * 2); /* clear the buffer */
840 if (handle->iic_read(handle->iic_addr, MAX30205_REG_TOS, (uint8_t *)buf, 2) != 0) /* read 2 bytes */
841 {
842 handle->debug_print("max30205: read failed.\n"); /* read tos failed */
843
844 return 1; /* return error */
845 }
846 *threshold = (int16_t)(((uint16_t)buf[0]) << 8 | buf[1]); /* get raw data */
847
848 return 0; /* success return 0 */
849}
850
862uint8_t max30205_convert_to_register(max30205_handle_t *handle, float s, int16_t *reg)
863{
864 if (handle == NULL) /* check handle */
865 {
866 return 2; /* return error */
867 }
868 if (handle->inited != 1) /* check handle initialization */
869 {
870 return 3; /* return error */
871 }
872
873 if ((handle->reg & (1 << 5)) != 0) /* extended format */
874 {
875 *reg = (int16_t)((s - 64.0f) / 0.00390625f); /* convert real data to register data */
876 }
877 else /* normal format */
878 {
879 *reg = (int16_t)(s / 0.00390625f); /* convert real data to register data */
880 }
881
882 return 0; /* success return 0 */
883}
884
897uint8_t max30205_convert_to_data(max30205_handle_t *handle, int16_t reg, float *s)
898{
899 if (handle == NULL) /* check handle */
900 {
901 return 2; /* return error */
902 }
903 if (handle->inited != 1) /* check handle initialization */
904 {
905 return 3; /* return error */
906 }
907
908 if ((handle->reg & (1 << 5)) != 0) /* extended format */
909 {
910 *s = (float)(reg) * 0.00390625f + 64.0f; /* convert raw data to real data */
911 }
912 else /* normal format */
913 {
914 *s = (float)(reg) * 0.00390625f; /* convert raw data to real data */
915 }
916
917 return 0; /* success return 0 */
918}
919
931{
932 uint8_t reg;
933
934 if (handle == NULL) /* check handle */
935 {
936 return 2; /* return error */
937 }
938 if (handle->inited != 1) /* check handle initialization */
939 {
940 return 3; /* return error */
941 }
942
943 reg = handle->reg | 0x01; /* set shutdown bit */
944 if (handle->iic_write(handle->iic_addr, MAX30205_REG_CONF, (uint8_t *)&reg, 1) != 0) /* write to conf register */
945 {
946 handle->debug_print("max30205: power down failed.\n"); /* power down failed */
947
948 return 1; /* return error */
949 }
950 else
951 {
952 return 0; /* success return 0 */
953 }
954}
955
969uint8_t max30205_set_reg(max30205_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
970{
971 if (handle == NULL) /* check handle */
972 {
973 return 2; /* return error */
974 }
975 if (handle->inited != 1) /* check handle initialization */
976 {
977 return 3; /* return error */
978 }
979
980 if (handle->iic_write(handle->iic_addr, reg, buf, len) != 0) /* write data */
981 {
982 handle->debug_print("max30205: write failed.\n"); /* write failed */
983
984 return 1; /* return error */
985 }
986 else
987 {
988 return 0; /* success return 0 */
989 }
990}
991
1005uint8_t max30205_get_reg(max30205_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
1006{
1007 if (handle == NULL) /* check handle */
1008 {
1009 return 2; /* return error */
1010 }
1011 if (handle->inited != 1) /* check handle initialization */
1012 {
1013 return 3; /* return error */
1014 }
1015
1016 if (handle->iic_read(handle->iic_addr, reg, buf, len) != 0) /* read data */
1017 {
1018 handle->debug_print("max30205: read failed.\n"); /* read failed */
1019
1020 return 1; /* return error */
1021 }
1022 else
1023 {
1024 return 0; /* success return 0 */
1025 }
1026}
1027
1037{
1038 if (info == NULL) /* check handle */
1039 {
1040 return 2; /* return error */
1041 }
1042
1043 memset(info, 0, sizeof(max30205_info_t)); /* initialize max30205 info structure */
1044 strncpy(info->chip_name, CHIP_NAME, 32); /* copy chip name */
1045 strncpy(info->manufacturer_name, MANUFACTURER_NAME, 32); /* copy manufacturer name */
1046 strncpy(info->interface, "IIC", 8); /* copy interface name */
1047 info->supply_voltage_min_v = SUPPLY_VOLTAGE_MIN; /* set minimal supply voltage */
1048 info->supply_voltage_max_v = SUPPLY_VOLTAGE_MAX; /* set maximum supply voltage */
1049 info->max_current_ma = MAX_CURRENT; /* set maximum current */
1050 info->temperature_max = TEMPERATURE_MAX; /* set minimal temperature */
1051 info->temperature_min = TEMPERATURE_MIN; /* set maximum temperature */
1052 info->driver_version = DRIVER_VERSION; /* set driver version */
1053
1054 return 0; /* success return 0 */
1055}
#define MAX30205_REG_TEMP
chip register definition
#define MAX30205_REG_CONF
#define MAX_CURRENT
#define MAX30205_REG_TOS
#define SUPPLY_VOLTAGE_MAX
#define MAX30205_REG_THYST
#define TEMPERATURE_MAX
#define MANUFACTURER_NAME
#define TEMPERATURE_MIN
#define SUPPLY_VOLTAGE_MIN
#define CHIP_NAME
chip information definition
#define DRIVER_VERSION
driver max30205 header file
max30205_bus_timeout_t
max30205 bus timeout enumeration definition
struct max30205_handle_s max30205_handle_t
max30205 handle structure definition
uint8_t max30205_set_data_format(max30205_handle_t *handle, max30205_data_format_t format)
set the chip data format
uint8_t max30205_get_addr_pin(max30205_handle_t *handle, max30205_address_t *addr_pin)
get the iic address pin
uint8_t max30205_get_bus_timeout(max30205_handle_t *handle, max30205_bus_timeout_t *bus_timeout)
get the iic bus timeout
uint8_t max30205_start_continuous_read(max30205_handle_t *handle)
start reading data
struct max30205_info_s max30205_info_t
max30205 information structure definition
uint8_t max30205_get_data_format(max30205_handle_t *handle, max30205_data_format_t *format)
get the chip data format
uint8_t max30205_set_addr_pin(max30205_handle_t *handle, max30205_address_t addr_pin)
set the iic address pin
uint8_t max30205_info(max30205_info_t *info)
get chip's information
max30205_address_t
max30205 address enumeration definition
max30205_data_format_t
max30205 data format enumeration definition
uint8_t max30205_deinit(max30205_handle_t *handle)
close the chip
uint8_t max30205_set_bus_timeout(max30205_handle_t *handle, max30205_bus_timeout_t bus_timeout)
set the iic bus timeout
uint8_t max30205_continuous_read(max30205_handle_t *handle, int16_t *raw, float *s)
read data continuously
uint8_t max30205_power_down(max30205_handle_t *handle)
chip powers down
uint8_t max30205_single_read(max30205_handle_t *handle, int16_t *raw, float *s)
read data once
uint8_t max30205_init(max30205_handle_t *handle)
initialize the chip
uint8_t max30205_stop_continuous_read(max30205_handle_t *handle)
stop reading data
@ MAX30205_BUS_TIMEOUT_DISABLE
@ MAX30205_BUS_TIMEOUT_ENABLE
@ MAX30205_DATA_FORMAT_NORMAL
@ MAX30205_DATA_FORMAT_EXTENDED
uint8_t max30205_get_reg(max30205_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
get the chip register
uint8_t max30205_set_reg(max30205_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
set the chip register
max30205_interrupt_mode_t
max30205 interrupt mode enumeration definition
uint8_t max30205_set_fault_queue(max30205_handle_t *handle, max30205_fault_queue_t fault_queue)
set the chip fault queue
uint8_t max30205_get_interrupt_mode(max30205_handle_t *handle, max30205_interrupt_mode_t *mode)
get the chip interrupt mode
uint8_t max30205_set_interrupt_mode(max30205_handle_t *handle, max30205_interrupt_mode_t mode)
set the chip interrupt mode
uint8_t max30205_get_pin_polarity(max30205_handle_t *handle, max30205_pin_polarity_t *polarity)
get the interrupt pin polarity
uint8_t max30205_get_interrupt_low_threshold(max30205_handle_t *handle, int16_t *threshold)
get the chip interrupt low threshold
uint8_t max30205_set_interrupt_low_threshold(max30205_handle_t *handle, int16_t threshold)
set the chip interrupt low threshold
uint8_t max30205_convert_to_data(max30205_handle_t *handle, int16_t reg, float *s)
convert a register raw data to a converted temperature data
max30205_fault_queue_t
max30205 fault queue enumeration definition
uint8_t max30205_set_pin_polarity(max30205_handle_t *handle, max30205_pin_polarity_t polarity)
set the interrupt pin polarity
uint8_t max30205_convert_to_register(max30205_handle_t *handle, float s, int16_t *reg)
convert a temperature value to a register raw data
max30205_pin_polarity_t
max30205 pin enumeration definition
uint8_t max30205_set_interrupt_high_threshold(max30205_handle_t *handle, int16_t threshold)
set the chip interrupt high threshold
uint8_t max30205_get_interrupt_high_threshold(max30205_handle_t *handle, int16_t *threshold)
get the chip interrupt high threshold
uint8_t max30205_get_fault_queue(max30205_handle_t *handle, max30205_fault_queue_t *fault_queue)
get the chip fault queue
@ MAX30205_INTERRUPT_MODE_INTERRUPT
@ MAX30205_INTERRUPT_MODE_COMPARATOR
@ MAX30205_PIN_POLARITY_LOW
@ MAX30205_PIN_POLARITY_HIGH
void(* delay_ms)(uint32_t ms)
void(* debug_print)(const char *const fmt,...)
uint8_t(* iic_init)(void)
uint8_t(* iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_read)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_deinit)(void)
char manufacturer_name[32]