[riot-notifications] [RIOT-OS/RIOT] drivers: add support for SHT2x (I2C temp and humidity sensor) (#10750)

Kees Bakker notifications at github.com
Mon Feb 4 19:43:09 CET 2019


keestux commented on this pull request.



> +    return ix;
+}
+
+int sht2x_read_ident(const sht2x_t *dev, uint8_t * buffer, size_t buflen)
+{
+    uint8_t data1[8];        /* SNB_3, CRC, SNB_2, CRC, SNB_1, CRC, SNB_0, CRC */
+    uint8_t data2[6];        /* SNC_1, SNC_0, CRC, SNA_1, SNA_0, CRC */
+    size_t ix;
+    int res;
+
+    i2c_acquire(BUS);
+    res = i2c_read_regs(BUS, ADDR,
+                        first_mem_addr, data1, sizeof(data1), I2C_REG16);
+    i2c_release(BUS);
+    if (res < 0) {
+        return -1;

OK I'll do a `return res` and document it

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10750#discussion_r253593091
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190204/4fa8da78/attachment.html>


More information about the notifications mailing list