LibDriver STS3X
Loading...
Searching...
No Matches
driver_sts3x.c
Go to the documentation of this file.
1
36
37#include "driver_sts3x.h"
38
42#define CHIP_NAME "Sensirion STS3X"
43#define MANUFACTURER_NAME "Sensirion"
44#define SUPPLY_VOLTAGE_MIN 2.4f
45#define SUPPLY_VOLTAGE_MAX 5.5f
46#define MAX_CURRENT 1.5f
47#define TEMPERATURE_MIN -40.0f
48#define TEMPERATURE_MAX 125.0f
49#define DRIVER_VERSION 1000
50
54#define STS3X_COMMAND_FETCH_DATA 0xE000U
55#define STS3X_COMMAND_BREAK 0x3093U
56#define STS3X_COMMAND_SOFT_RESET 0x30A2U
57#define STS3X_COMMAND_HEATER_ENABLE 0x306DU
58#define STS3X_COMMAND_HEATER_DISABLE 0x3066U
59#define STS3X_COMMAND_READ_STATUS 0xF32DU
60#define STS3X_COMMAND_CLEAR_STATUS 0x3041U
61
71static uint8_t a_sts3x_write(sts3x_handle_t *handle, uint16_t cmd)
72{
73 if (handle->iic_write_address16(handle->iic_addr, cmd, NULL, 0) != 0) /* iic write */
74 {
75 return 1; /* return error */
76 }
77
78 return 0; /* success return 0 */
79}
80
92static uint8_t a_sts3x_read(sts3x_handle_t *handle, uint16_t reg, uint8_t *data, uint16_t len)
93{
94 if (handle->iic_read_address16(handle->iic_addr, reg, data, len) != 0) /* iic read */
95 {
96 return 1; /* return error */
97 }
98
99 return 0; /* success return 0 */
100}
101
109static uint8_t a_sts3x_crc(uint8_t *data, uint16_t len)
110{
111 const uint8_t POLYNOMIAL = 0x31;
112 uint8_t crc = 0xFF;
113 uint16_t i, j;
114
115 for (j = len; j != 0; --j) /* length-- */
116 {
117 crc ^= *data++; /* xor */
118 for (i = 8; i != 0; --i) /* 8 times */
119 {
120 crc = (crc & 0x80) ? (crc << 1) ^ POLYNOMIAL : (crc<<1); /* calculate crc */
121 }
122 }
123
124 return crc; /* return crc */
125}
126
138{
139 uint8_t res;
140 uint16_t command;
141
142 if (handle == NULL) /* check handle */
143 {
144 return 2; /* return error */
145 }
146 if (handle->debug_print == NULL) /* check debug_print */
147 {
148 return 3; /* return error */
149 }
150 if (handle->iic_init == NULL) /* check iic_init */
151 {
152 handle->debug_print("sts3x: iic_init is null.\n"); /* iic_init is null */
153
154 return 3; /* return error */
155 }
156 if (handle->iic_deinit == NULL) /* check iic_deinit */
157 {
158 handle->debug_print("sts3x: iic_deinit is null.\n"); /* iic_deinit is null */
159
160 return 3; /* return error */
161 }
162 if (handle->iic_read_address16 == NULL) /* check iic_read_address16 */
163 {
164 handle->debug_print("sts3x: iic_read_address16 is null.\n"); /* iic_read_address16 is null */
165
166 return 3; /* return error */
167 }
168 if (handle->iic_write_address16 == NULL) /* check iic_write_address16 */
169 {
170 handle->debug_print("sts3x: iic_write_address16 is null.\n"); /* iic_write_address16 is null */
171
172 return 3; /* return error */
173 }
174 if (handle->delay_ms == NULL) /* check delay_ms */
175 {
176 handle->debug_print("sts3x: delay_ms is null.\n"); /* delay_ms is null */
177
178 return 3; /* return error */
179 }
180
181 if (handle->iic_init() != 0) /* iic init */
182 {
183 handle->debug_print("sts3x: iic init failed.\n"); /* iic init failed */
184
185 return 1; /* return error */
186 }
187 command = STS3X_COMMAND_SOFT_RESET; /* set command */
188 res = a_sts3x_write(handle, command); /* write command */
189 if (res != 0) /* check result */
190 {
191 handle->debug_print("sts3x: write command failed.\n"); /* write command failed */
192 (void)handle->iic_deinit(); /* close iic */
193
194 return 1; /* return error */
195 }
196 handle->delay_ms(100); /* delay 100ms */
197 handle->inited = 1; /* flag finish initialization */
198
199 return 0; /* success return 0 */
200}
201
213{
214 uint8_t res;
215 uint16_t command;
216
217 if (handle == NULL) /* check handle */
218 {
219 return 2; /* return error */
220 }
221 if (handle->inited != 1) /* check handle initialization */
222 {
223 return 3; /* return error */
224 }
225
226 command = STS3X_COMMAND_BREAK; /* set command */
227 res = a_sts3x_write(handle, command); /* write command */
228 if (res != 0) /* check result */
229 {
230 handle->debug_print("sts3x: write command failed.\n"); /* write command failed */
231
232 return 1; /* return error */
233 }
234 if (handle->iic_deinit() != 0) /* iic deinit */
235 {
236 handle->debug_print("sts3x: iic deinit failed.\n"); /* iic deinit failed */
237
238 return 1; /* return error */
239 }
240 handle->inited = 0; /* flag close */
241
242 return 0; /* success return 0 */
243}
244
256{
257 if (handle == NULL) /* check handle */
258 {
259 return 2; /* return error */
260 }
261
262 handle->iic_addr = (uint8_t)addr_pin; /* set address pin */
263
264 return 0; /* success return 0 */
265}
266
278{
279 if (handle == NULL) /* check handle */
280 {
281 return 2; /* return error */
282 }
283
284 *addr_pin = (sts3x_address_t)(handle->iic_addr); /* get address pin */
285
286 return 0; /* success return 0 */
287}
288
299uint8_t sts3x_get_status(sts3x_handle_t *handle, uint16_t *status)
300{
301 uint8_t res;
302 uint8_t data[3];
303 uint16_t command;
304
305 if (handle == NULL) /* check handle */
306 {
307 return 2; /* return error */
308 }
309 if (handle->inited != 1) /* check handle initialization */
310 {
311 return 3; /* return error */
312 }
313
314 memset(data, 0, sizeof(uint8_t) * 3); /* clear the buffer */
315 command = STS3X_COMMAND_READ_STATUS; /* set command */
316 res = a_sts3x_read(handle, command, (uint8_t *)data, 3); /* read status */
317 if (res != 0) /* check result */
318 {
319 handle->debug_print("sts3x: read status failed.\n"); /* read status failed */
320
321 return 1; /* return error */
322 }
323 if (a_sts3x_crc((uint8_t *)data, 2) == data[2]) /* check crc */
324 {
325 *status = (uint16_t)((((uint16_t)data[0]) << 8) | data[1]); /* get status */
326
327 return 0; /* success return 0 */
328 }
329 else
330 {
331 handle->debug_print("sts3x: crc check failed.\n"); /* crc check failed */
332
333 return 1; /* return error */
334 }
335}
336
347{
348 uint8_t res;
349 uint16_t command;
350
351 if (handle == NULL) /* check handle */
352 {
353 return 2; /* return error */
354 }
355 if (handle->inited != 1) /* check handle initialization */
356 {
357 return 3; /* return error */
358 }
359
360 command = STS3X_COMMAND_CLEAR_STATUS; /* set command */
361 res = a_sts3x_write(handle, command); /* write command */
362 if (res != 0) /* check result */
363 {
364 handle->debug_print("sts3x: write command failed.\n"); /* write command failed */
365
366 return 1; /* return error */
367 }
368
369 return 0; /* success return 0 */
370}
371
383{
384 if (handle == NULL) /* check handle */
385 {
386 return 2; /* return error */
387 }
388 if (handle->inited != 1) /* check handle initialization */
389 {
390 return 3; /* return error */
391 }
392
393 handle->repeatability = (uint8_t)repeatability; /* set repeatability */
394
395 return 0; /* success return 0 */
396}
397
409{
410 if (handle == NULL) /* check handle */
411 {
412 return 2; /* return error */
413 }
414 if (handle->inited != 1) /* check handle initialization */
415 {
416 return 3; /* return error */
417 }
418
419 *repeatability = (sts3x_repeatability_t)(handle->repeatability); /* get repeatability */
420
421 return 0; /* success return 0 */
422}
423
437uint8_t sts3x_single_read(sts3x_handle_t *handle, sts3x_bool_t clock_stretching_enable,
438 uint16_t *temperature_raw, float *temperature_s)
439{
440 uint8_t res;
441 uint16_t command;
442 uint8_t data[3];
443
444 if (handle == NULL) /* check handle */
445 {
446 return 2; /* return error */
447 }
448 if (handle->inited != 1) /* check handle initialization */
449 {
450 return 3; /* return error */
451 }
452
453 if (handle->repeatability == STS3X_REPEATABILITY_HIGH) /* repeatability high */
454 {
455 if (clock_stretching_enable == STS3X_BOOL_FALSE) /* if disable clock stretching */
456 {
457 command = 0x2400U; /* set disable high */
458 }
459 else if (clock_stretching_enable == STS3X_BOOL_TRUE) /* if enable clock stretching */
460 {
461 command = 0x2C06U; /* set enable high */
462 }
463 else
464 {
465 handle->debug_print("sts3x: clock stretching is invalid.\n"); /* clock stretching is invalid */
466
467 return 1; /* return error */
468 }
469 }
470 else if (handle->repeatability == STS3X_REPEATABILITY_MEDIUM) /* repeatability medium */
471 {
472 if (clock_stretching_enable == STS3X_BOOL_FALSE) /* if disable clock stretching */
473 {
474 command = 0x240BU; /* set disable medium */
475 }
476 else if (clock_stretching_enable == STS3X_BOOL_TRUE) /* if enable clock stretching */
477 {
478 command = 0x2C0DU; /* set enable medium */
479 }
480 else
481 {
482 handle->debug_print("sts3x: clock stretching is invalid.\n"); /* clock stretching is invalid */
483
484 return 1; /* return error */
485 }
486 }
487 else if (handle->repeatability == STS3X_REPEATABILITY_LOW) /* repeatability low */
488 {
489 if (clock_stretching_enable == STS3X_BOOL_FALSE) /* if disable clock stretching */
490 {
491 command = 0x2416U; /* set disable low */
492 }
493 else if (clock_stretching_enable == STS3X_BOOL_TRUE) /* if enable clock stretching */
494 {
495 command = 0x2C10U; /* set enable low */
496 }
497 else
498 {
499 handle->debug_print("sts3x: clock stretching is invalid.\n"); /* clock stretching is invalid */
500
501 return 1; /* return error */
502 }
503 }
504 else
505 {
506 handle->debug_print("sts3x: repeatability is invalid.\n"); /* repeatability is invalid */
507
508 return 1; /* return error */
509 }
510 memset(data, 0, sizeof(uint8_t) * 3); /* clear the buffer */
511 res = a_sts3x_read(handle, command, (uint8_t *)data, 3); /* read data */
512 if (res != 0) /* check result */
513 {
514 handle->debug_print("sts3x: read data failed.\n"); /* read data failed */
515
516 return 1; /* return error */
517 }
518 if (a_sts3x_crc((uint8_t *)data, 2) != data[2]) /* check crc */
519 {
520 handle->debug_print("sts3x: crc check failed.\n"); /* crc check failed */
521
522 return 1; /* return error */
523 }
524 *temperature_raw = (uint16_t)((((uint16_t)data[0]) << 8) | data[1]); /* get raw temperature */
525 *temperature_s = (float)(*temperature_raw) / 65535.0f * 175.0f - 45.0f; /* convert raw temperature */
526
527 return 0; /* success return 0 */
528}
529
542{
543 uint8_t res;
544 uint16_t command;
545
546 if (handle == NULL) /* check handle */
547 {
548 return 2; /* return error */
549 }
550 if (handle->inited != 1) /* check handle initialization */
551 {
552 return 3; /* return error */
553 }
554
555 if (handle->repeatability == STS3X_REPEATABILITY_HIGH) /* repeatability high */
556 {
557 if (rate == STS3X_RATE_0P5HZ) /* 0.5Hz */
558 {
559 command = 0x2032U; /* set 0.5Hz high */
560 }
561 else if (rate == STS3X_RATE_1HZ) /* 1Hz */
562 {
563 command = 0x2130U; /* set 1Hz high */
564 }
565 else if (rate == STS3X_RATE_2HZ) /* 2Hz */
566 {
567 command = 0x2236U; /* set 2Hz high */
568 }
569 else if (rate == STS3X_RATE_4HZ) /* 4Hz */
570 {
571 command = 0x2334U; /* set 4Hz high */
572 }
573 else if (rate == STS3X_RATE_10HZ) /* 10Hz */
574 {
575 command = 0x2737U; /* set 10Hz high */
576 }
577 else
578 {
579 handle->debug_print("sts3x: rate is invalid.\n"); /* rate is invalid */
580
581 return 1; /* return error */
582 }
583 }
584 else if (handle->repeatability == STS3X_REPEATABILITY_MEDIUM) /* repeatability medium */
585 {
586 if (rate == STS3X_RATE_0P5HZ) /* 0.5Hz */
587 {
588 command = 0x2024U; /* set 0.5Hz medium */
589 }
590 else if (rate == STS3X_RATE_1HZ) /* 1Hz */
591 {
592 command = 0x2126U; /* set 1Hz medium */
593 }
594 else if (rate == STS3X_RATE_2HZ) /* 2Hz */
595 {
596 command = 0x2220U; /* set 2Hz medium */
597 }
598 else if (rate == STS3X_RATE_4HZ) /* 4Hz */
599 {
600 command = 0x2322U; /* set 4Hz medium */
601 }
602 else if (rate == STS3X_RATE_10HZ) /* 10Hz */
603 {
604 command = 0x2721U; /* set 10Hz medium */
605 }
606 else
607 {
608 handle->debug_print("sts3x: rate is invalid.\n"); /* rate is invalid */
609
610 return 1; /* return error */
611 }
612 }
613 else if (handle->repeatability == STS3X_REPEATABILITY_LOW) /* repeatability low */
614 {
615 if (rate == STS3X_RATE_0P5HZ) /* 0.5Hz */
616 {
617 command = 0x202FU; /* set 0.5Hz low */
618 }
619 else if (rate == STS3X_RATE_1HZ) /* 1Hz */
620 {
621 command = 0x212DU; /* set 1Hz low */
622 }
623 else if (rate == STS3X_RATE_2HZ) /* 2Hz */
624 {
625 command = 0x222BU; /* set 2Hz low */
626 }
627 else if (rate == STS3X_RATE_4HZ) /* set 4Hz */
628 {
629 command = 0x2329U; /* set 4Hz low */
630 }
631 else if (rate == STS3X_RATE_10HZ) /* 10Hz */
632 {
633 command = 0x272AU; /* set 10Hz low */
634 }
635 else
636 {
637 handle->debug_print("sts3x: rate is invalid.\n"); /* rate is invalid */
638
639 return 1; /* return error */
640 }
641 }
642 else
643 {
644 handle->debug_print("sts3x: repeatability is invalid.\n"); /* repeatability is invalid */
645
646 return 1; /* return error */
647 }
648 res = a_sts3x_write(handle, command); /* write command */
649 if (res != 0) /* check result */
650 {
651 handle->debug_print("sts3x: write command failed.\n"); /* write command failed */
652
653 return 1; /* return error */
654 }
655
656 return 0; /* success return 0 */
657}
658
670{
671 uint8_t res;
672 uint16_t command;
673
674 if (handle == NULL) /* check handle */
675 {
676 return 2; /* return error */
677 }
678 if (handle->inited != 1) /* check handle initialization */
679 {
680 return 3; /* return error */
681 }
682
683 command = STS3X_COMMAND_BREAK; /* set command */
684 res = a_sts3x_write(handle, command); /* write command */
685 if (res != 0) /* check result */
686 {
687 handle->debug_print("sts3x: write command failed.\n"); /* write command failed */
688
689 return 1; /* return error */
690 }
691
692 return 0; /* success return 0 */
693}
694
707uint8_t sts3x_continuous_read(sts3x_handle_t *handle, uint16_t *temperature_raw, float *temperature_s)
708{
709 uint8_t res;
710 uint16_t command;
711 uint8_t data[3];
712
713 if (handle == NULL) /* check handle */
714 {
715 return 2; /* return error */
716 }
717 if (handle->inited != 1) /* check handle initialization */
718 {
719 return 3; /* return error */
720 }
721
722 command = STS3X_COMMAND_FETCH_DATA; /* set fetch data */
723 res = a_sts3x_read(handle, command, (uint8_t *)data, 3); /* read data */
724 if (res != 0) /* check result */
725 {
726 handle->debug_print("sts3x: read data failed.\n"); /* read data failed */
727
728 return 1; /* return error */
729 }
730 if (a_sts3x_crc((uint8_t *)data, 2) != data[2]) /* check crc */
731 {
732 handle->debug_print("sts3x: crc check failed.\n"); /* crc check failed */
733
734 return 1; /* return error */
735 }
736 *temperature_raw = (uint16_t)((((uint16_t)data[0]) << 8) | data[1]); /* get raw temperature */
737 *temperature_s = (float)(*temperature_raw) / 65535.0f * 175.0f - 45.0f; /* convert raw temperature */
738
739 return 0; /* success return 0 */
740}
741
753{
754 uint8_t res;
755 uint16_t command;
756
757 if (handle == NULL) /* check handle */
758 {
759 return 2; /* return error */
760 }
761 if (handle->inited != 1) /* check handle initialization */
762 {
763 return 3; /* return error */
764 }
765
766 command = STS3X_COMMAND_SOFT_RESET; /* set command */
767 res = a_sts3x_write(handle, command); /* write command */
768 if (res != 0) /* check result */
769 {
770 handle->debug_print("sts3x: write command failed.\n"); /* write command failed */
771
772 return 1; /* return error */
773 }
774 handle->delay_ms(100); /* delay 100ms */
775
776 return 0; /* success return 0 */
777}
778
791{
792 uint8_t res;
793 uint16_t command;
794
795 if (handle == NULL) /* check handle */
796 {
797 return 2; /* return error */
798 }
799 if (handle->inited != 1) /* check handle initialization */
800 {
801 return 3; /* return error */
802 }
803
804 if (enable == STS3X_BOOL_TRUE) /* enable heater */
805 {
806 command = STS3X_COMMAND_HEATER_ENABLE; /* set enable */
807 }
808 else if (enable == STS3X_BOOL_FALSE) /* disable heater */
809 {
810 command = STS3X_COMMAND_HEATER_DISABLE; /* set disable */
811 }
812 else
813 {
814 handle->debug_print("sts3x: bool is invalid.\n"); /* bool is invalid */
815
816 return 1; /* return error */
817 }
818 res = a_sts3x_write(handle, command); /* write command */
819 if (res != 0) /* check result */
820 {
821 handle->debug_print("sts3x: write command failed.\n"); /* write command failed */
822
823 return 1; /* return error */
824 }
825
826 return 0; /* success return 0 */
827}
828
840uint8_t sts3x_set_reg(sts3x_handle_t *handle, uint16_t command)
841{
842 if (handle == NULL) /* check handle */
843 {
844 return 2; /* return error */
845 }
846 if (handle->inited != 1) /* check handle initialization */
847 {
848 return 3; /* return error */
849 }
850
851 return a_sts3x_write(handle, command); /* write command */
852}
853
867uint8_t sts3x_get_reg(sts3x_handle_t *handle, uint16_t command, uint8_t *buf, uint16_t len)
868{
869 if (handle == NULL) /* check handle */
870 {
871 return 2; /* return error */
872 }
873 if (handle->inited != 1) /* check handle initialization */
874 {
875 return 3; /* return error */
876 }
877
878 return a_sts3x_read(handle, command, buf, len); /* read data */
879}
880
890{
891 if (info == NULL) /* check handle */
892 {
893 return 2; /* return error */
894 }
895
896 memset(info, 0, sizeof(sts3x_info_t)); /* initialize sts3x info structure */
897 strncpy(info->chip_name, CHIP_NAME, 32); /* copy chip name */
898 strncpy(info->manufacturer_name, MANUFACTURER_NAME, 32); /* copy manufacturer name */
899 strncpy(info->interface, "IIC", 8); /* copy interface name */
900 info->supply_voltage_min_v = SUPPLY_VOLTAGE_MIN; /* set minimal supply voltage */
901 info->supply_voltage_max_v = SUPPLY_VOLTAGE_MAX; /* set maximum supply voltage */
902 info->max_current_ma = MAX_CURRENT; /* set maximum current */
903 info->temperature_max = TEMPERATURE_MAX; /* set minimal temperature */
904 info->temperature_min = TEMPERATURE_MIN; /* set maximum temperature */
905 info->driver_version = DRIVER_VERSION; /* set driver version */
906
907 return 0; /* success return 0 */
908}
#define STS3X_COMMAND_READ_STATUS
#define MAX_CURRENT
#define STS3X_COMMAND_BREAK
#define SUPPLY_VOLTAGE_MAX
#define STS3X_COMMAND_SOFT_RESET
#define STS3X_COMMAND_CLEAR_STATUS
#define TEMPERATURE_MAX
#define STS3X_COMMAND_FETCH_DATA
chip command definition
#define MANUFACTURER_NAME
#define TEMPERATURE_MIN
#define SUPPLY_VOLTAGE_MIN
#define STS3X_COMMAND_HEATER_ENABLE
#define CHIP_NAME
chip information definition
#define DRIVER_VERSION
#define STS3X_COMMAND_HEATER_DISABLE
driver sts3x header file
uint8_t sts3x_set_addr_pin(sts3x_handle_t *handle, sts3x_address_t addr_pin)
set the iic address pin
uint8_t sts3x_get_repeatability(sts3x_handle_t *handle, sts3x_repeatability_t *repeatability)
get the measurement repeatability
uint8_t sts3x_clear_status(sts3x_handle_t *handle)
clear the current status
sts3x_address_t
sts3x address enumeration definition
uint8_t sts3x_set_repeatability(sts3x_handle_t *handle, sts3x_repeatability_t repeatability)
set the measurement repeatability
sts3x_rate_t
sts3x rate enumeration definition
uint8_t sts3x_continuous_read(sts3x_handle_t *handle, uint16_t *temperature_raw, float *temperature_s)
read data continuously
uint8_t sts3x_soft_reset(sts3x_handle_t *handle)
soft reset the chip
uint8_t sts3x_info(sts3x_info_t *info)
get chip's information
struct sts3x_handle_s sts3x_handle_t
sts3x handle structure definition
uint8_t sts3x_start_continuous_read(sts3x_handle_t *handle, sts3x_rate_t rate)
start reading
uint8_t sts3x_get_addr_pin(sts3x_handle_t *handle, sts3x_address_t *addr_pin)
get the iic address pin
uint8_t sts3x_init(sts3x_handle_t *handle)
initialize the chip
struct sts3x_info_s sts3x_info_t
sts3x information structure definition
uint8_t sts3x_set_heater(sts3x_handle_t *handle, sts3x_bool_t enable)
enable or disable the chip heater
sts3x_repeatability_t
sts3x repeatability enumeration definition
uint8_t sts3x_get_status(sts3x_handle_t *handle, uint16_t *status)
get the current status
uint8_t sts3x_stop_continuous_read(sts3x_handle_t *handle)
stop reading
uint8_t sts3x_deinit(sts3x_handle_t *handle)
close the chip
uint8_t sts3x_single_read(sts3x_handle_t *handle, sts3x_bool_t clock_stretching_enable, uint16_t *temperature_raw, float *temperature_s)
read data once
sts3x_bool_t
sts3x bool enumeration definition
@ STS3X_RATE_1HZ
@ STS3X_RATE_4HZ
@ STS3X_RATE_0P5HZ
@ STS3X_RATE_10HZ
@ STS3X_RATE_2HZ
@ STS3X_REPEATABILITY_HIGH
@ STS3X_REPEATABILITY_MEDIUM
@ STS3X_REPEATABILITY_LOW
@ STS3X_BOOL_FALSE
@ STS3X_BOOL_TRUE
uint8_t sts3x_set_reg(sts3x_handle_t *handle, uint16_t command)
set the chip register
uint8_t sts3x_get_reg(sts3x_handle_t *handle, uint16_t command, uint8_t *buf, uint16_t len)
get the chip register
void(* delay_ms)(uint32_t ms)
uint8_t repeatability
uint8_t(* iic_read_address16)(uint8_t addr, uint16_t reg, uint8_t *buf, uint16_t len)
void(* debug_print)(const char *const fmt,...)
uint8_t(* iic_init)(void)
uint8_t(* iic_write_address16)(uint8_t addr, uint16_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_deinit)(void)
float temperature_max
float supply_voltage_max_v
uint32_t driver_version
float temperature_min
float max_current_ma
char manufacturer_name[32]
float supply_voltage_min_v
char interface[8]
char chip_name[32]