[riot-notifications] [RIOT-OS/RIOT] drivers/lm75: driver for the lm75 sensor and derivatives (#16678)

benpicco notifications at github.com
Wed Aug 18 13:00:41 CEST 2021


@benpicco commented on this pull request.



> +    if (i2c_acquire(I2C_BUS) != 0) {
+        return LM75_ERROR_I2C;
+    }
+
+    /* read the device ID register of the TMP1075 sensor to confirm it is a TMP1075 */
+    if (IS_USED(MODULE_TMP1075)) {
+        uint16_t deid = 0;
+        if (i2c_read_regs(I2C_BUS, I2C_ADDR, TMP1075_DEVICE_ID_REG, &deid, 2, 0) != 0) {
+            LOG_INFO("Error reading device ID\n");
+         }
+
+        deid = (uint16_t)ntohs(deid);
+        /* checks if the device ID corresponds to the TMP1075 sensor
+         * and extends the parameter configuration if so */
+        if (deid == 0x7500) {
+            puts("Device is a TMP1075");

```suggestion
            DEBUG("Device is a TMP1075\n");
```

-- 
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/16678#pullrequestreview-732722442
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210818/bc922670/attachment.htm>


More information about the notifications mailing list