[riot-notifications] [RIOT-OS/RIOT] drivers: support for NXP PCA9685 I2C 16-channel, 12-bit PWM controller (#10556)

Gunar Schorcht notifications at github.com
Fri Sep 6 18:54:45 CEST 2019


gschorcht commented on this pull request.



> +}
+
+static int _update(const pca9685_t *dev, uint8_t reg, uint8_t mask, uint8_t data)
+{
+    uint8_t byte;
+    uint8_t shift = 0;
+
+    while (!((mask >> shift) & 0x01)) {
+        shift++;
+    }
+
+    /* read current register value */
+    EXEC_RET(_read(dev, reg, &byte, 1));
+
+    /* set masked bits to the given value  */
+    byte = (byte & ~mask) | ((data << shift) & mask);

OK

-- 
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/10556#discussion_r321823521
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190906/b9f77ac7/attachment.htm>


More information about the notifications mailing list