LibDriver SHT85
Loading...
Searching...
No Matches
driver_sht85.c
Go to the documentation of this file.
1
36
37#include "driver_sht85.h"
38
42#define CHIP_NAME "Sensirion SHT85"
43#define MANUFACTURER_NAME "Sensirion"
44#define SUPPLY_VOLTAGE_MIN 2.15f
45#define SUPPLY_VOLTAGE_MAX 5.5f
46#define MAX_CURRENT 1.5f
47#define TEMPERATURE_MIN -40.0f
48#define TEMPERATURE_MAX 105.0f
49#define DRIVER_VERSION 1000
50
54#define SHT85_ADDRESS (0x44 << 1)
55
59#define SHT85_COMMAND_FETCH_DATA 0xE000U
60#define SHT85_COMMAND_ART 0x2B32U
61#define SHT85_COMMAND_BREAK 0x3093U
62#define SHT85_COMMAND_SOFT_RESET 0x30A2U
63#define SHT85_COMMAND_HEATER_ENABLE 0x306DU
64#define SHT85_COMMAND_HEATER_DISABLE 0x3066U
65#define SHT85_COMMAND_READ_STATUS 0xF32DU
66#define SHT85_COMMAND_CLEAR_STATUS 0x3041U
67#define SHT85_COMMAND_GET_SERIAL_NUMBER 0x3682U
68
78static uint8_t a_sht85_write(sht85_handle_t *handle, uint16_t cmd)
79{
80 if (handle->iic_write_address16(SHT85_ADDRESS, cmd, NULL, 0) != 0) /* iic write */
81 {
82 return 1; /* return error */
83 }
84
85 return 0; /* success return 0 */
86
87}
88
100static uint8_t a_sht85_read(sht85_handle_t *handle, uint16_t reg, uint8_t *data, uint16_t len)
101{
102 if (handle->iic_read_address16(SHT85_ADDRESS, reg, data, len) != 0) /* iic read */
103 {
104 return 1; /* return error */
105 }
106
107 return 0; /* success return 0 */
108}
109
117static uint8_t a_sht85_crc(uint8_t *data, uint16_t len)
118{
119 const uint8_t POLYNOMIAL = 0x31;
120 uint8_t crc = 0xFF;
121 uint16_t i, j;
122
123 for (j = len; j != 0; --j) /* length-- */
124 {
125 crc ^= *data++; /* xor */
126 for (i = 8; i != 0; --i) /* 8 times */
127 {
128 crc = (crc & 0x80) ? (crc << 1) ^ POLYNOMIAL : (crc<<1); /* calculate crc */
129 }
130 }
131
132 return crc; /* return crc */
133}
134
146{
147 uint8_t res;
148 uint16_t command;
149
150 if (handle == NULL) /* check handle */
151 {
152 return 2; /* return error */
153 }
154 if (handle->debug_print == NULL) /* check debug_print */
155 {
156 return 3; /* return error */
157 }
158 if (handle->iic_init == NULL) /* check iic_init */
159 {
160 handle->debug_print("sht85: iic_init is null.\n"); /* iic_init is null */
161
162 return 3; /* return error */
163 }
164 if (handle->iic_deinit == NULL) /* check iic_deinit */
165 {
166 handle->debug_print("sht85: iic_deinit is null.\n"); /* iic_deinit is null */
167
168 return 3; /* return error */
169 }
170 if (handle->iic_read_address16 == NULL) /* check iic_read_address16 */
171 {
172 handle->debug_print("sht85: iic_read_address16 is null.\n"); /* iic_read_address16 is null */
173
174 return 3; /* return error */
175 }
176 if (handle->iic_write_address16 == NULL) /* check iic_write_address16 */
177 {
178 handle->debug_print("sht85: iic_write_address16 is null.\n"); /* iic_write_address16 is null */
179
180 return 3; /* return error */
181 }
182 if (handle->delay_ms == NULL) /* check delay_ms */
183 {
184 handle->debug_print("sht85: delay_ms is null.\n"); /* delay_ms is null */
185
186 return 3; /* return error */
187 }
188
189 if (handle->iic_init() != 0) /* iic init */
190 {
191 handle->debug_print("sht85: iic init failed.\n"); /* iic init failed */
192
193 return 1; /* return error */
194 }
195 command = SHT85_COMMAND_SOFT_RESET; /* set command */
196 res = a_sht85_write(handle, command); /* write command */
197 if (res != 0) /* check result */
198 {
199 handle->debug_print("sht85: write command failed.\n"); /* write command failed */
200 (void)handle->iic_deinit(); /* close iic */
201
202 return 1; /* return error */
203 }
204 handle->inited = 1; /* flag finish initialization */
205
206 return 0; /* success return 0 */
207}
208
220{
221 uint8_t res;
222 uint16_t command;
223
224 if (handle == NULL) /* check handle */
225 {
226 return 2; /* return error */
227 }
228 if (handle->inited != 1) /* check handle initialization */
229 {
230 return 3; /* return error */
231 }
232
233 command = SHT85_COMMAND_BREAK; /* set command */
234 res = a_sht85_write(handle, command); /* write command */
235 if (res != 0) /* check result */
236 {
237 handle->debug_print("sht85: write command failed.\n"); /* write command failed */
238
239 return 1; /* return error */
240 }
241 if (handle->iic_deinit() != 0) /* iic deinit */
242 {
243 handle->debug_print("sht85: iic deinit failed.\n"); /* iic deinit failed */
244
245 return 1; /* return error */
246 }
247 handle->inited = 0; /* flag close */
248
249 return 0; /* success return 0 */
250}
251
263uint8_t sht85_get_status(sht85_handle_t *handle, uint16_t *status)
264{
265 uint8_t res;
266 uint8_t data[3];
267 uint16_t command;
268
269 if (handle == NULL) /* check handle */
270 {
271 return 2; /* return error */
272 }
273 if (handle->inited != 1) /* check handle initialization */
274 {
275 return 3; /* return error */
276 }
277
278 memset(data, 0, sizeof(uint8_t) * 3); /* clear the buffer */
279 command = SHT85_COMMAND_READ_STATUS; /* set command */
280 res = a_sht85_read(handle, command, (uint8_t *)data, 3); /* read status */
281 if (res != 0) /* check result */
282 {
283 handle->debug_print("sht85: read status failed.\n"); /* read status failed */
284
285 return 1; /* return error */
286 }
287 if (a_sht85_crc((uint8_t *)data, 2) == data[2]) /* check crc */
288 {
289 *status = (uint16_t)((((uint16_t)data[0]) << 8) | data[1]); /* get status */
290
291 return 0; /* success return 0 */
292 }
293 else
294 {
295 handle->debug_print("sht85: crc check failed.\n"); /* crc check failed */
296
297 return 1; /* return error */
298 }
299}
300
312{
313 uint8_t res;
314 uint16_t command;
315
316 if (handle == NULL) /* check handle */
317 {
318 return 2; /* return error */
319 }
320 if (handle->inited != 1) /* check handle initialization */
321 {
322 return 3; /* return error */
323 }
324
325 command = SHT85_COMMAND_CLEAR_STATUS; /* set command */
326 res = a_sht85_write(handle, command); /* write command */
327 if (res != 0) /* check result */
328 {
329 handle->debug_print("sht85: write command failed.\n"); /* write command failed */
330
331 return 1; /* return error */
332 }
333
334 return 0; /* success return 0 */
335}
336
348{
349 if (handle == NULL) /* check handle */
350 {
351 return 2; /* return error */
352 }
353 if (handle->inited != 1) /* check handle initialization */
354 {
355 return 3; /* return error */
356 }
357
358 handle->repeatability = (uint8_t)repeatability; /* set repeatability */
359
360 return 0; /* success return 0 */
361}
362
374{
375 if (handle == NULL) /* check handle */
376 {
377 return 2; /* return error */
378 }
379 if (handle->inited != 1) /* check handle initialization */
380 {
381 return 3; /* return error */
382 }
383
384 *repeatability = (sht85_repeatability_t)(handle->repeatability); /* get repeatability */
385
386 return 0; /* success return 0 */
387}
388
404 uint16_t *temperature_raw, float *temperature_s,
405 uint16_t *humidity_raw, float *humidity_s)
406{
407 uint8_t res;
408 uint16_t command;
409 uint8_t data[6];
410
411 if (handle == NULL) /* check handle */
412 {
413 return 2; /* return error */
414 }
415 if (handle->inited != 1) /* check handle initialization */
416 {
417 return 3; /* return error */
418 }
419
420 if (handle->repeatability == SHT85_REPEATABILITY_HIGH) /* repeatability high */
421 {
422 command = 0x2400U; /* set disable high */
423 }
424 else if (handle->repeatability == SHT85_REPEATABILITY_MEDIUM) /* repeatability medium */
425 {
426 command = 0x240BU; /* set disable medium */
427 }
428 else if (handle->repeatability == SHT85_REPEATABILITY_LOW) /* repeatability low */
429 {
430 command = 0x2416U; /* set disable low */
431 }
432 else
433 {
434 handle->debug_print("sht85: repeatability is invalid.\n"); /* repeatability is invalid */
435
436 return 1; /* return error */
437 }
438
439 memset(data, 0, sizeof(uint8_t) * 6); /* clear the buffer */
440 res = a_sht85_read(handle, command, (uint8_t *)data, 6); /* read data */
441 if (res != 0) /* check result */
442 {
443 handle->debug_print("sht85: read data failed.\n"); /* read data failed */
444
445 return 1; /* return error */
446 }
447 if (a_sht85_crc((uint8_t *)data, 2) != data[2]) /* check crc */
448 {
449 handle->debug_print("sht85: crc check failed.\n"); /* crc check failed */
450
451 return 1; /* return error */
452 }
453 if (a_sht85_crc((uint8_t *)&data[3], 2) != data[5]) /* check crc */
454 {
455 handle->debug_print("sht85: crc check failed.\n"); /* crc check failed */
456
457 return 1; /* return error */
458 }
459 *temperature_raw = (uint16_t)((((uint16_t)data[0]) << 8) | data[1]); /* get raw temperature */
460 *humidity_raw = (uint16_t)((((uint16_t)data[3]) << 8) | data[4]); /* get raw humidity */
461 *temperature_s = (float)(*temperature_raw) / 65535.0f * 175.0f - 45.0f; /* convert raw temperature */
462 *humidity_s = (float)(*humidity_raw) / 65535.0f * 100.0f; /* convert raw humidity */
463
464 return 0; /* success return 0 */
465}
466
479{
480 uint8_t res;
481 uint16_t command;
482
483 if (handle == NULL) /* check handle */
484 {
485 return 2; /* return error */
486 }
487 if (handle->inited != 1) /* check handle initialization */
488 {
489 return 3; /* return error */
490 }
491
492 if (handle->repeatability == SHT85_REPEATABILITY_HIGH) /* repeatability high */
493 {
494 if (rate == SHT85_RATE_0P5HZ) /* 0.5Hz */
495 {
496 command = 0x2032U; /* set 0.5Hz high */
497 }
498 else if (rate == SHT85_RATE_1HZ) /* 1Hz */
499 {
500 command = 0x2130U; /* set 1Hz high */
501 }
502 else if (rate == SHT85_RATE_2HZ) /* 2Hz */
503 {
504 command = 0x2236U; /* set 2Hz high */
505 }
506 else if (rate == SHT85_RATE_4HZ) /* 4Hz */
507 {
508 command = 0x2334U; /* set 4Hz high */
509 }
510 else if (rate == SHT85_RATE_10HZ) /* 10Hz */
511 {
512 command = 0x2737U; /* set 10Hz high */
513 }
514 else
515 {
516 handle->debug_print("sht85: rate is invalid.\n"); /* rate is invalid */
517
518 return 1; /* return error */
519 }
520 }
521 else if (handle->repeatability == SHT85_REPEATABILITY_MEDIUM) /* repeatability medium */
522 {
523 if (rate == SHT85_RATE_0P5HZ) /* 0.5Hz */
524 {
525 command = 0x2024U; /* set 0.5Hz medium */
526 }
527 else if (rate == SHT85_RATE_1HZ) /* 1Hz */
528 {
529 command = 0x2126U; /* set 1Hz medium */
530 }
531 else if (rate == SHT85_RATE_2HZ) /* 2Hz */
532 {
533 command = 0x2220U; /* set 2Hz medium */
534 }
535 else if (rate == SHT85_RATE_4HZ) /* 4Hz */
536 {
537 command = 0x2322U; /* set 4Hz medium */
538 }
539 else if (rate == SHT85_RATE_10HZ) /* 10Hz */
540 {
541 command = 0x2721U; /* set 10Hz medium */
542 }
543 else
544 {
545 handle->debug_print("sht85: rate is invalid.\n"); /* rate is invalid */
546
547 return 1; /* return error */
548 }
549 }
550 else if (handle->repeatability == SHT85_REPEATABILITY_LOW) /* repeatability low */
551 {
552 if (rate == SHT85_RATE_0P5HZ) /* 0.5Hz */
553 {
554 command = 0x202FU; /* set 0.5Hz low */
555 }
556 else if (rate == SHT85_RATE_1HZ) /* 1Hz */
557 {
558 command = 0x212DU; /* set 1Hz low */
559 }
560 else if (rate == SHT85_RATE_2HZ) /* 2Hz */
561 {
562 command = 0x222BU; /* set 2Hz low */
563 }
564 else if (rate == SHT85_RATE_4HZ) /* set 4Hz */
565 {
566 command = 0x2329U; /* set 4Hz low */
567 }
568 else if (rate == SHT85_RATE_10HZ) /* 10Hz */
569 {
570 command = 0x272AU; /* set 10Hz low */
571 }
572 else
573 {
574 handle->debug_print("sht85: rate is invalid.\n"); /* rate is invalid */
575
576 return 1; /* return error */
577 }
578 }
579 else
580 {
581 handle->debug_print("sht85: repeatability is invalid.\n"); /* repeatability is invalid */
582
583 return 1; /* return error */
584 }
585 res = a_sht85_write(handle, command); /* write command */
586 if (res != 0) /* check result */
587 {
588 handle->debug_print("sht85: write command failed.\n"); /* write command failed */
589
590 return 1; /* return error */
591 }
592
593 return 0; /* success return 0 */
594}
595
607{
608 uint8_t res;
609 uint16_t command;
610
611 if (handle == NULL) /* check handle */
612 {
613 return 2; /* return error */
614 }
615 if (handle->inited != 1) /* check handle initialization */
616 {
617 return 3; /* return error */
618 }
619
620 command = SHT85_COMMAND_BREAK; /* set command */
621 res = a_sht85_write(handle, command); /* write command */
622 if (res != 0) /* check result */
623 {
624 handle->debug_print("sht85: write command failed.\n"); /* write command failed */
625
626 return 1; /* return error */
627 }
628
629 return 0; /* success return 0 */
630}
631
647 uint16_t *temperature_raw, float *temperature_s,
648 uint16_t *humidity_raw, float *humidity_s)
649{
650 uint8_t res;
651 uint16_t command;
652 uint8_t data[6];
653
654 if (handle == NULL) /* check handle */
655 {
656 return 2; /* return error */
657 }
658 if (handle->inited != 1) /* check handle initialization */
659 {
660 return 3; /* return error */
661 }
662
663 command = SHT85_COMMAND_FETCH_DATA; /* set fetch data */
664 res = a_sht85_read(handle, command, (uint8_t *)data, 6); /* read data */
665 if (res != 0) /* check result */
666 {
667 handle->debug_print("sht85: read data failed.\n"); /* read data failed */
668
669 return 1; /* return error */
670 }
671 if (a_sht85_crc((uint8_t *)data, 2) != data[2]) /* check crc */
672 {
673 handle->debug_print("sht85: crc check failed.\n"); /* crc check failed */
674
675 return 1; /* return error */
676 }
677 if (a_sht85_crc((uint8_t *)&data[3], 2) != data[5]) /* check crc */
678 {
679 handle->debug_print("sht85: crc check failed.\n"); /* crc check failed */
680
681 return 1; /* return error */
682 }
683 *temperature_raw = (uint16_t)((((uint16_t)data[0]) << 8) | data[1]); /* get raw temperature */
684 *humidity_raw = (uint16_t)((((uint16_t)data[3]) << 8) | data[4]); /* get raw humidity */
685 *temperature_s = (float)(*temperature_raw) / 65535.0f * 175.0f - 45.0f; /* convert raw temperature */
686 *humidity_s = (float)(*humidity_raw) / 65535.0f * 100.0f; /* convert raw humidity */
687
688 return 0; /* success return 0 */
689}
690
702{
703 uint8_t res;
704 uint16_t command;
705
706 if (handle == NULL) /* check handle */
707 {
708 return 2; /* return error */
709 }
710 if (handle->inited != 1) /* check handle initialization */
711 {
712 return 3; /* return error */
713 }
714
715 command = SHT85_COMMAND_ART; /* set command */
716 res = a_sht85_write(handle, command); /* write command */
717 if (res != 0) /* check result */
718 {
719 handle->debug_print("sht85: write command failed.\n"); /* write command failed */
720
721 return 1; /* return error */
722 }
723
724 return 0; /* success return 0 */
725}
726
738{
739 uint8_t res;
740 uint16_t command;
741
742 if (handle == NULL) /* check handle */
743 {
744 return 2; /* return error */
745 }
746 if (handle->inited != 1) /* check handle initialization */
747 {
748 return 3; /* return error */
749 }
750
751 command = SHT85_COMMAND_SOFT_RESET; /* set command */
752 res = a_sht85_write(handle, command); /* write command */
753 if (res != 0) /* check result */
754 {
755 handle->debug_print("sht85: write command failed.\n"); /* write command failed */
756
757 return 1; /* return error */
758 }
759
760 return 0; /* success return 0 */
761}
762
775{
776 uint8_t res;
777 uint16_t command;
778
779 if (handle == NULL) /* check handle */
780 {
781 return 2; /* return error */
782 }
783 if (handle->inited != 1) /* check handle initialization */
784 {
785 return 3; /* return error */
786 }
787
788 if (enable == SHT85_BOOL_TRUE) /* enable heater */
789 {
790 command = SHT85_COMMAND_HEATER_ENABLE; /* set enable */
791 }
792 else if (enable == SHT85_BOOL_FALSE) /* disable heater */
793 {
794 command = SHT85_COMMAND_HEATER_DISABLE; /* set disable */
795 }
796 else
797 {
798 handle->debug_print("sht85: bool is invalid.\n"); /* bool is invalid */
799
800 return 1; /* return error */
801 }
802 res = a_sht85_write(handle, command); /* write command */
803 if (res != 0) /* check result */
804 {
805 handle->debug_print("sht85: write command failed.\n"); /* write command failed */
806
807 return 1; /* return error */
808 }
809
810 return 0; /* success return 0 */
811}
812
824uint8_t sht85_get_serial_number(sht85_handle_t *handle, uint8_t sn[4])
825{
826 uint8_t res;
827 uint16_t command;
828 uint8_t data[6];
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 command = SHT85_COMMAND_GET_SERIAL_NUMBER; /* get serial number command */
840 res = a_sht85_read(handle, command, (uint8_t *)data, 6); /* read data */
841 if (res != 0) /* check result */
842 {
843 handle->debug_print("sht85: read data failed.\n"); /* read data failed */
844
845 return 1; /* return error */
846 }
847 if (a_sht85_crc((uint8_t *)data, 2) != data[2]) /* check crc */
848 {
849 handle->debug_print("sht85: crc check failed.\n"); /* crc check failed */
850
851 return 1; /* return error */
852 }
853 if (a_sht85_crc((uint8_t *)&data[3], 2) != data[5]) /* check crc */
854 {
855 handle->debug_print("sht85: crc check failed.\n"); /* crc check failed */
856
857 return 1; /* return error */
858 }
859 sn[0] = data[4]; /* set sn0 */
860 sn[1] = data[3]; /* set sn1 */
861 sn[2] = data[1]; /* set sn2 */
862 sn[3] = data[0]; /* set sn3 */
863
864 return 0; /* success return 0 */
865}
866
878uint8_t sht85_set_reg(sht85_handle_t *handle, uint16_t command)
879{
880 if (handle == NULL) /* check handle */
881 {
882 return 2; /* return error */
883 }
884 if (handle->inited != 1) /* check handle initialization */
885 {
886 return 3; /* return error */
887 }
888
889 return a_sht85_write(handle, command); /* write command */
890}
891
905uint8_t sht85_get_reg(sht85_handle_t *handle, uint16_t command, uint8_t *buf, uint16_t len)
906{
907 if (handle == NULL) /* check handle */
908 {
909 return 2; /* return error */
910 }
911 if (handle->inited != 1) /* check handle initialization */
912 {
913 return 3; /* return error */
914 }
915
916 return a_sht85_read(handle, command, buf, len); /* read data */
917}
918
928{
929 if (info == NULL) /* check handle */
930 {
931 return 2; /* return error */
932 }
933
934 memset(info, 0, sizeof(sht85_info_t)); /* initialize sht85 info structure */
935 strncpy(info->chip_name, CHIP_NAME, 32); /* copy chip name */
936 strncpy(info->manufacturer_name, MANUFACTURER_NAME, 32); /* copy manufacturer name */
937 strncpy(info->interface, "IIC", 8); /* copy interface name */
938 info->supply_voltage_min_v = SUPPLY_VOLTAGE_MIN; /* set minimal supply voltage */
939 info->supply_voltage_max_v = SUPPLY_VOLTAGE_MAX; /* set maximum supply voltage */
940 info->max_current_ma = MAX_CURRENT; /* set maximum current */
941 info->temperature_max = TEMPERATURE_MAX; /* set minimal temperature */
942 info->temperature_min = TEMPERATURE_MIN; /* set maximum temperature */
943 info->driver_version = DRIVER_VERSION; /* set driver version */
944
945 return 0; /* success return 0 */
946}
#define SHT85_COMMAND_HEATER_DISABLE
#define MAX_CURRENT
#define SHT85_COMMAND_GET_SERIAL_NUMBER
#define SHT85_COMMAND_ART
#define SHT85_COMMAND_HEATER_ENABLE
#define SUPPLY_VOLTAGE_MAX
#define SHT85_COMMAND_CLEAR_STATUS
#define SHT85_COMMAND_BREAK
#define TEMPERATURE_MAX
#define SHT85_COMMAND_FETCH_DATA
chip command definition
#define SHT85_ADDRESS
chip address definition
#define MANUFACTURER_NAME
#define TEMPERATURE_MIN
#define SUPPLY_VOLTAGE_MIN
#define SHT85_COMMAND_READ_STATUS
#define CHIP_NAME
chip information definition
#define DRIVER_VERSION
#define SHT85_COMMAND_SOFT_RESET
driver sht85 header file
uint8_t sht85_start_continuous_read(sht85_handle_t *handle, sht85_rate_t rate)
start reading
uint8_t sht85_continuous_read(sht85_handle_t *handle, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, float *humidity_s)
read data continuously
uint8_t sht85_set_heater(sht85_handle_t *handle, sht85_bool_t enable)
enable or disable the chip heater
uint8_t sht85_clear_status(sht85_handle_t *handle)
clear the current status
uint8_t sht85_get_serial_number(sht85_handle_t *handle, uint8_t sn[4])
get serial number
struct sht85_info_s sht85_info_t
sht85 information structure definition
uint8_t sht85_init(sht85_handle_t *handle)
initialize the chip
uint8_t sht85_set_repeatability(sht85_handle_t *handle, sht85_repeatability_t repeatability)
set the measurement repeatability
sht85_repeatability_t
sht85 repeatability enumeration definition
uint8_t sht85_stop_continuous_read(sht85_handle_t *handle)
stop reading
uint8_t sht85_deinit(sht85_handle_t *handle)
close the chip
uint8_t sht85_info(sht85_info_t *info)
get chip's information
sht85_rate_t
sht85 rate enumeration definition
uint8_t sht85_set_art(sht85_handle_t *handle)
set the chip art
sht85_bool_t
sht85 bool enumeration definition
uint8_t sht85_get_status(sht85_handle_t *handle, uint16_t *status)
get the current status
struct sht85_handle_s sht85_handle_t
sht85 handle structure definition
uint8_t sht85_single_read(sht85_handle_t *handle, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, float *humidity_s)
read data once
uint8_t sht85_soft_reset(sht85_handle_t *handle)
soft reset the chip
uint8_t sht85_get_repeatability(sht85_handle_t *handle, sht85_repeatability_t *repeatability)
get the measurement repeatability
@ SHT85_REPEATABILITY_HIGH
@ SHT85_REPEATABILITY_LOW
@ SHT85_REPEATABILITY_MEDIUM
@ SHT85_RATE_0P5HZ
@ SHT85_RATE_4HZ
@ SHT85_RATE_2HZ
@ SHT85_RATE_1HZ
@ SHT85_RATE_10HZ
@ SHT85_BOOL_TRUE
@ SHT85_BOOL_FALSE
uint8_t sht85_set_reg(sht85_handle_t *handle, uint16_t command)
set the chip register
uint8_t sht85_get_reg(sht85_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]