[riot-notifications] [RIOT-OS/RIOT] drivers: Add AD7746 capacitance sensor driver (#10919)

Leandro Lanzieri notifications at github.com
Wed Feb 6 15:43:25 CET 2019


leandrolanzieri commented on this pull request.



> +    }
+
+    if (i2c_read_regs(I2C, ADDR, reg, buf, 3, 0)) {
+        goto release;
+    }
+
+    *raw = (((uint32_t)buf[0] << 16) | ((uint32_t)buf[1] << 8) |
+            ((uint32_t)buf[2]));
+    res = AD7746_OK;
+
+release:
+    i2c_release(I2C);
+    return res;
+}
+
+int ad7746_raw_to_capacitance(uint32_t raw)

I will move the helper converters to the specific channel read functions to return the physical representations instead of the raw value.

-- 
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/10919#discussion_r254297788
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190206/61889e9a/attachment.html>


More information about the notifications mailing list