[riot-notifications] [RIOT-OS/RIOT] drivers/lpsxxx: refactor lps331ap and add support for lps25hb + lps22hb (#10695)

Alexandre Abadie notifications at github.com
Wed Feb 20 08:22:36 CET 2019


aabadie commented on this pull request.



> +
+    if (i2c_read_reg(DEV_I2C, DEV_ADDR, LPSXXX_REG_TEMP_OUT_H, &tmp, 0) < 0) {
+        i2c_release(DEV_I2C);
+        DEBUG("[lpsxxx] read_temp: cannot read TEMP_OUT_H register\n");
+        return -LPSXXX_ERR_I2C;
+    }
+    i2c_release(DEV_I2C);
+    val |= ((uint16_t)tmp << 8);
+
+    DEBUG("[lpsxxx] read_temp: raw data %08" PRIx32 "\n", (uint32_t)val);
+
+    /* compute actual temperature value in °C */
+    res += ((float)val) / TEMP_DIVIDER;
+
+    /* return temperature in c°C */
+    *temp = (int16_t)(res * 100);

I tried but that doesn't work on lps331ap/lps25hb.

-- 
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/10695#discussion_r258358577
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190219/04c97fda/attachment.html>


More information about the notifications mailing list