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 memset(buf, 0, sizeof(uint8_t) * 2); /* clear the buffer */
682 if (handle->iic_read(handle->iic_addr, MAX30205_REG_TEMP, (uint8_t *)buf, 2) != 0) /* read two bytes */
683 {
684 handle->debug_print("max30205: read failed.\n"); /* read failed */
685
686 return 1; /* return error */
687 }
688 if ((handle->reg & (1 << 5)) != 0) /* extended format */
689 {
690 *raw = (int16_t)(((uint16_t)buf[0]) << 8 | buf[1]); /* get raw data */
691 *s = (float)(*raw) * 0.00390625f + 64.0f; /* convert raw data to real data */
692 }
693 else /* normal format */
694 {
695 *raw = (int16_t)(((uint16_t)buf[0]) << 8 | buf[1]); /* get raw data */
696 *s = (float)(*raw) * 0.00390625f; /* convert raw data to real data */
697 }
698
699 return 0; /* success return 0 */
700}
701
714{
715 uint8_t buf[2];
716
717 if (handle == NULL) /* check handle */
718 {
719 return 2; /* return error */
720 }
721 if (handle->inited != 1) /* check handle initialization */
722 {
723 return 3; /* return error */
724 }
725
726 buf[0] = (threshold >> 8) & 0xFF; /* MSB */
727 buf[1] = threshold & 0xFF; /* LSB */
728 if (handle->iic_write(handle->iic_addr, MAX30205_REG_THYST, (uint8_t *)buf, 2) != 0) /* write to register */
729 {
730 handle->debug_print("max30205: set interrupt low threshold failed.\n"); /* set interrupt low threshold failed */
731
732 return 1; /* return error */
733 }
734 else
735 {
736 return 0; /* success return 0 */
737 }
738}
739
751uint8_t max30205_get_interrupt_low_threshold(max30205_handle_t *handle, int16_t *threshold)
752{
753 uint8_t buf[2];
754
755 if (handle == NULL) /* check handle */
756 {
757 return 2; /* return error */
758 }
759 if (handle->inited != 1) /* check handle initialization */
760 {
761 return 3; /* return error */
762 }
763
764 memset(buf, 0, sizeof(uint8_t) * 2); /* clear the buffer */
765 if (handle->iic_read(handle->iic_addr, MAX30205_REG_THYST, (uint8_t *)buf, 2) != 0) /* read 2 bytes */
766 {
767 handle->debug_print("max30205: read failed.\n"); /* read thyst failed */
768
769 return 1; /* return error */
770 }
771 *threshold = (int16_t)(((uint16_t)buf[0]) << 8 | buf[1]); /* get raw data */
772
773 return 0; /* success return 0 */
774}
775
788{
789 uint8_t buf[2];
790
791 if (handle == NULL) /* check handle */
792 {
793 return 2; /* return error */
794 }
795 if (handle->inited != 1) /* check handle initialization */
796 {
797 return 3; /* return error */
798 }
799
800 buf[0] = (threshold >> 8) & 0xFF; /* MSB */
801 buf[1] = threshold & 0xFF; /* LSB */
802 if (handle->iic_write(handle->iic_addr, MAX30205_REG_TOS, (uint8_t *)buf, 2) != 0) /* write to register */
803 {
804 handle->debug_print("max30205: set interrupt high threshold failed.\n"); /* set interrupt high threshold failed */
805
806 return 1; /* return error */
807 }
808 else
809 {
810 return 0; /* success return 0 */
811 }
812}
813
826{
827 uint8_t buf[2];
828
829 if (handle == NULL) /* check handle */
830 {
831 return 2; /* return error */
832 }
833 if (handle->inited != 1) /* check handle initialization */
834 {
835 return 3; /* return error */
836 }
837
838 memset(buf, 0, sizeof(uint8_t) * 2); /* clear the buffer */
839 if (handle->iic_read(handle->iic_addr, MAX30205_REG_TOS, (uint8_t *)buf, 2) != 0) /* read 2 bytes */
840 {
841 handle->debug_print("max30205: read failed.\n"); /* read tos failed */
842
843 return 1; /* return error */
844 }
845 *threshold = (int16_t)(((uint16_t)buf[0]) << 8 | buf[1]); /* get raw data */
846
847 return 0; /* success return 0 */
848}
849
861uint8_t max30205_convert_to_register(max30205_handle_t *handle, float s, int16_t *reg)
862{
863 if (handle == NULL) /* check handle */
864 {
865 return 2; /* return error */
866 }
867 if (handle->inited != 1) /* check handle initialization */
868 {
869 return 3; /* return error */
870 }
871
872 if ((handle->reg & (1 << 5)) != 0) /* extended format */
873 {
874 *reg = (int16_t)((s - 64.0f) / 0.00390625f); /* convert real data to register data */
875 }
876 else /* normal format */
877 {
878 *reg = (int16_t)(s / 0.00390625f); /* convert real data to register data */
879 }
880
881 return 0; /* success return 0 */
882}
883
896uint8_t max30205_convert_to_data(max30205_handle_t *handle, int16_t reg, float *s)
897{
898 if (handle == NULL) /* check handle */
899 {
900 return 2; /* return error */
901 }
902 if (handle->inited != 1) /* check handle initialization */
903 {
904 return 3; /* return error */
905 }
906
907 if ((handle->reg & (1 << 5)) != 0) /* extended format */
908 {
909 *s = (float)(reg) * 0.00390625f + 64.0f; /* convert raw data to real data */
910 }
911 else /* normal format */
912 {
913 *s = (float)(reg) * 0.00390625f; /* convert raw data to real data */
914 }
915
916 return 0; /* success return 0 */
917}
918
930{
931 uint8_t reg;
932
933 if (handle == NULL) /* check handle */
934 {
935 return 2; /* return error */
936 }
937 if (handle->inited != 1) /* check handle initialization */
938 {
939 return 3; /* return error */
940 }
941
942 reg = handle->reg | 0x01; /* set shutdown bit */
943 if (handle->iic_write(handle->iic_addr, MAX30205_REG_CONF, (uint8_t *)&reg, 1) != 0) /* write to conf register */
944 {
945 handle->debug_print("max30205: power down failed.\n"); /* power down failed */
946
947 return 1; /* return error */
948 }
949 else
950 {
951 return 0; /* success return 0 */
952 }
953}
954
968uint8_t max30205_set_reg(max30205_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
969{
970 if (handle == NULL) /* check handle */
971 {
972 return 2; /* return error */
973 }
974 if (handle->inited != 1) /* check handle initialization */
975 {
976 return 3; /* return error */
977 }
978
979 if (handle->iic_write(handle->iic_addr, reg, buf, len) != 0) /* write data */
980 {
981 handle->debug_print("max30205: write failed.\n"); /* write failed */
982
983 return 1; /* return error */
984 }
985 else
986 {
987 return 0; /* success return 0 */
988 }
989}
990
1004uint8_t max30205_get_reg(max30205_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
1005{
1006 if (handle == NULL) /* check handle */
1007 {
1008 return 2; /* return error */
1009 }
1010 if (handle->inited != 1) /* check handle initialization */
1011 {
1012 return 3; /* return error */
1013 }
1014
1015 if (handle->iic_read(handle->iic_addr, reg, buf, len) != 0) /* read data */
1016 {
1017 handle->debug_print("max30205: read failed.\n"); /* read failed */
1018
1019 return 1; /* return error */
1020 }
1021 else
1022 {
1023 return 0; /* success return 0 */
1024 }
1025}
1026
1036{
1037 if (info == NULL) /* check handle */
1038 {
1039 return 2; /* return error */
1040 }
1041
1042 memset(info, 0, sizeof(max30205_info_t)); /* initialize max30205 info structure */
1043 strncpy(info->chip_name, CHIP_NAME, 32); /* copy chip name */
1044 strncpy(info->manufacturer_name, MANUFACTURER_NAME, 32); /* copy manufacturer name */
1045 strncpy(info->interface, "IIC", 8); /* copy interface name */
1046 info->supply_voltage_min_v = SUPPLY_VOLTAGE_MIN; /* set minimal supply voltage */
1047 info->supply_voltage_max_v = SUPPLY_VOLTAGE_MAX; /* set maximum supply voltage */
1048 info->max_current_ma = MAX_CURRENT; /* set maximum current */
1049 info->temperature_max = TEMPERATURE_MAX; /* set minimal temperature */
1050 info->temperature_min = TEMPERATURE_MIN; /* set maximum temperature */
1051 info->driver_version = DRIVER_VERSION; /* set driver version */
1052
1053 return 0; /* success return 0 */
1054}
#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]