<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Other NXP ProductsのトピックPCA9533 linux driver</title>
    <link>https://community.nxp.com/t5/Other-NXP-Products/PCA9533-linux-driver/m-p/1333103#M11969</link>
    <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;i'm working with pca9533 i2c led dimmer. Looking at the linux driver drivers/leds/leds-pca9532.c, i have some doubts about the define of the control register:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/* m =  num_leds*/
#define PCA9532_REG_INPUT(i)	((i) &amp;gt;&amp;gt; 3)
#define PCA9532_REG_OFFSET(m)	((m) &amp;gt;&amp;gt; 4)
#define PCA9532_REG_PSC(m, i)	(PCA9532_REG_OFFSET(m) + 0x1 + (i) * 2)
#define PCA9532_REG_PWM(m, i)	(PCA9532_REG_OFFSET(m) + 0x2 + (i) * 2)
#define LED_REG(m, led)		(PCA9532_REG_OFFSET(m) + 0x5 + (led &amp;gt;&amp;gt; 2))
#define LED_NUM(led)		(led &amp;amp; 0x3)
#define LED_SHIFT(led)		(LED_NUM(led) * 2)
#define LED_MASK(led)		(0x3 &amp;lt;&amp;lt; LED_SHIFT(led))&lt;/LI-CODE&gt;&lt;P&gt;In particular, why is LED_REG defined with the shifts? Shouldn't it be just 0x5 as the datasheet says?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lidiah_0-1630486469514.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154773i34A55720EAB7DA7A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lidiah_0-1630486469514.png" alt="lidiah_0-1630486469514.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lidiah_1-1630486521943.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154774iA8754BBA45574A77/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lidiah_1-1630486521943.png" alt="lidiah_1-1630486521943.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Wed, 01 Sep 2021 08:56:03 GMT</pubDate>
    <dc:creator>lidiah</dc:creator>
    <dc:date>2021-09-01T08:56:03Z</dc:date>
    <item>
      <title>PCA9533 linux driver</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/PCA9533-linux-driver/m-p/1333103#M11969</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;i'm working with pca9533 i2c led dimmer. Looking at the linux driver drivers/leds/leds-pca9532.c, i have some doubts about the define of the control register:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/* m =  num_leds*/
#define PCA9532_REG_INPUT(i)	((i) &amp;gt;&amp;gt; 3)
#define PCA9532_REG_OFFSET(m)	((m) &amp;gt;&amp;gt; 4)
#define PCA9532_REG_PSC(m, i)	(PCA9532_REG_OFFSET(m) + 0x1 + (i) * 2)
#define PCA9532_REG_PWM(m, i)	(PCA9532_REG_OFFSET(m) + 0x2 + (i) * 2)
#define LED_REG(m, led)		(PCA9532_REG_OFFSET(m) + 0x5 + (led &amp;gt;&amp;gt; 2))
#define LED_NUM(led)		(led &amp;amp; 0x3)
#define LED_SHIFT(led)		(LED_NUM(led) * 2)
#define LED_MASK(led)		(0x3 &amp;lt;&amp;lt; LED_SHIFT(led))&lt;/LI-CODE&gt;&lt;P&gt;In particular, why is LED_REG defined with the shifts? Shouldn't it be just 0x5 as the datasheet says?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lidiah_0-1630486469514.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154773i34A55720EAB7DA7A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lidiah_0-1630486469514.png" alt="lidiah_0-1630486469514.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lidiah_1-1630486521943.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154774iA8754BBA45574A77/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lidiah_1-1630486521943.png" alt="lidiah_1-1630486521943.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 08:56:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/PCA9533-linux-driver/m-p/1333103#M11969</guid>
      <dc:creator>lidiah</dc:creator>
      <dc:date>2021-09-01T08:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: PCA9533 linux driver</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/PCA9533-linux-driver/m-p/1333238#M11970</link>
      <description>&lt;P&gt;Hi Lidia,&lt;/P&gt;
&lt;P&gt;I am not familiar with this driver, but for the &lt;A href="https://www.nxp.com/docs/en/data-sheet/PCA9533.pdf" target="_self"&gt;PCA9533&lt;/A&gt; (4-bit I2C-bus LED dimmer), the address of the LS0 - LED selector register is indeed 0x05, so the second byte when writing to or reading from this register has to be 0x05.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 499px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154801i9930DA8E70A6A14F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 669px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/154802i66C282192ACC2738/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Tomas&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 11:39:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/PCA9533-linux-driver/m-p/1333238#M11970</guid>
      <dc:creator>TomasVaverka</dc:creator>
      <dc:date>2021-09-01T11:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: PCA9533 linux driver</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/PCA9533-linux-driver/m-p/1333245#M11971</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;that's why i was asking about the shifts #&lt;SPAN class="pl-k"&gt;define&lt;/SPAN&gt; &lt;SPAN class="pl-en"&gt;LED_REG&lt;/SPAN&gt;(&lt;SPAN class="pl-v"&gt;m, led&lt;/SPAN&gt;) (&lt;STRONG&gt;PCA9532_REG_OFFSET(m)&lt;/STRONG&gt; + &lt;SPAN class="pl-c1"&gt;0x5&lt;/SPAN&gt; + &lt;STRONG&gt;(led &amp;gt;&amp;gt; &lt;SPAN class="pl-c1"&gt;2&lt;/SPAN&gt;)&lt;/STRONG&gt;).&lt;/P&gt;&lt;P&gt;maybe they have no effects on the writing/reading.&lt;/P&gt;&lt;P&gt;Lidia&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 11:57:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/PCA9533-linux-driver/m-p/1333245#M11971</guid>
      <dc:creator>lidiah</dc:creator>
      <dc:date>2021-09-01T11:57:42Z</dc:date>
    </item>
  </channel>
</rss>

