[riot-notifications] [RIOT-OS/RIOT] drivers/ds75lx: add basic driver for temperature sensor (#11505)

Alexandre Abadie notifications at github.com
Tue May 14 08:51:35 CEST 2019


aabadie commented on this pull request.



> +}
+
+int ds75lx_init(ds75lx_t *dev, const ds75lx_params_t *params)
+{
+    dev->params = *params;
+
+    /* Acquire exclusive access */
+    i2c_acquire(DEV_I2C);
+
+    uint8_t config = (dev->params.resolution << DS75LX_CONF_R0_POS);
+    /* force shutdown of the sensor */
+    config |= (1 << DS75LX_CONF_SD_POS);
+
+    DEBUG("[ds75lx] configuration register value: 0x%02X\n", config);
+
+    if (i2c_write_reg(DEV_I2C, DEV_ADDR, DS75LX_REG_CONFIGURATION, config, 0) < 0) {

That might be possible, I'll give it a try.

-- 
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/11505#discussion_r283647768
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190513/242ccefa/attachment.html>


More information about the notifications mailing list