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

Leandro Lanzieri notifications at github.com
Wed Feb 6 15:44:29 CET 2019


leandrolanzieri commented on this pull request.



> +    if (mode == AD7746_VT_MD_DIS) {
+        reg &= ~(1 << AD7746_VT_SETUP_VTEN_BIT);
+    }
+    else {
+        /* Enable voltage / temperature channel and set mode */
+        reg &= ~((1 << AD7746_VT_SETUP_VTMD0_BIT) |
+                 (1 << AD7746_VT_SETUP_VTMD1_BIT));
+        reg |= (1 << AD7746_VT_SETUP_VTEN_BIT) |
+               (mode << AD7746_VT_SETUP_VTMD0_BIT);
+    }
+
+    if (i2c_write_reg(I2C, ADDR, AD7746_REG_VT_SETUP, reg, 0)) {
+        DEBUG("[ad7746] set_vt_ch - error: unable to set v/t channel mode\n");
+        goto release;
+    }
+

oops, forgot to add the success return. Will add!

-- 
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_r254298310
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190206/11af8ed8/attachment.html>


More information about the notifications mailing list