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

viktorbatista notifications at github.com
Mon Jul 26 15:39:13 CEST 2021


@viktorbatista commented on this pull request.



> +#define I2C_BUS             dev->lm75_params.i2c_bus
+#define I2C_ADDR            dev->lm75_params.i2c_addr
+
+
+int lm75_init(lm75_t *dev, const lm75_params_t *params) {
+
+    dev->lm75_params = *params;
+    uint8_t data;
+    uint8_t config = (params->shutdown_mode) | (params->tm_mode << 1) | (params->polarity << 2) | (params->fault_q << 3);
+
+    if (i2c_acquire(I2C_BUS) != 0) {
+        return LM75_ERROR_I2C;
+    }
+
+    /* read the device ID register of the TMP1075 sensor to see if the sensor truly is a TMP1075 */
+    #if MODULE_TMP1075

I don't understand the reasoning behind this change. Could you explain it to me, please?

-- 
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#discussion_r676612096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210726/bd67d000/attachment-0001.htm>


More information about the notifications mailing list