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

benpicco notifications at github.com
Fri Jul 23 17:21:31 CEST 2021


@benpicco commented on this pull request.



> +   		    dev->lm75_params.lm75_res.temp_mult = 10000;      /* Must multiply by 10000 to get temp in ºC */
+   		    dev->lm75_params.lm75_res.temp_bits = 4;          /* Only the 12 most significant bits are needed */
+        }
+        else {
+            puts("Device ID Register doesnt match");
+            return LM75_ERROR;
+       }
+
+    #elif MODULE_LM75A
+        puts("Device is an LM75A");
+   		dev->lm75_params.lm75_res.os_res = 5;             /* Resolution in 0.5ºC */
+   		dev->lm75_params.lm75_res.os_mult = 10;           /* Must multiply by 10 to get temp in ºC */
+  		dev->lm75_params.lm75_res.os_bits = 7;            /* Only the 9 most significant bits are needed */
+   		dev->lm75_params.lm75_res.temp_res = 125;         /* Resolution in 0.125ºC */
+   		dev->lm75_params.lm75_res.temp_mult = 1000;       /* Must multiply by 1000 to get temp in ºC */
+  		dev->lm75_params.lm75_res.temp_bits = 5;          /* Only the 11 most significant bits are needed */

Better call it `temp_shift` then, the comment is confusing. 

-- 
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-713837736
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210723/a846ba8a/attachment.htm>


More information about the notifications mailing list