<?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>topic Re: Functions for I2C with KL43 SDK and PE? in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Functions-for-I2C-with-KL43-SDK-and-PE/m-p/468076#M3681</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have a lot of working examples with I2C, here in the community and also in the KSDK 1.3:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Freescale\KSDK_1.3.0\examples\frdmkl43z\driver_examples\i2c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Santiago&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Mar 2016 01:01:48 GMT</pubDate>
    <dc:creator>santiago_gonzal</dc:creator>
    <dc:date>2016-03-11T01:01:48Z</dc:date>
    <item>
      <title>Functions for I2C with KL43 SDK and PE?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Functions-for-I2C-with-KL43-SDK-and-PE/m-p/468075#M3680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use processor expert with the KL43z SDK I2C component, and I don't know quite where to begin. I am trying to simply write data to my LCD display. Using processor expert I simply initialized the I2C and set the Baud rate to 100 kbit/s, address: 0, unchecked read only. I only have master configurations, not sure if I need slave configurations also.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried using the function I2C_DRV_MasterSendData, but I'm not sure what all the parameters should be.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The LCD datasheet says in order to clear the screen:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="143824_143824.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/121166i06E50B628E44B499/image-size/large?v=v2&amp;amp;px=999" role="button" title="143824_143824.png" alt="143824_143824.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/22524iADDDF44FC9E2249D/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So, I'm guessing this means I send 0x06 across the I2C, so I tried using the following code:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I2C_DRV_MasterSendData (i2cCom1_IDX,&amp;amp;i2cCom1_MasterConfig0, NULL, 0, 0x06, 5);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some guidance would be much appreciated.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2016 20:36:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Functions-for-I2C-with-KL43-SDK-and-PE/m-p/468075#M3680</guid>
      <dc:creator>christopherira</dc:creator>
      <dc:date>2016-03-10T20:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Functions for I2C with KL43 SDK and PE?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Functions-for-I2C-with-KL43-SDK-and-PE/m-p/468076#M3681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have a lot of working examples with I2C, here in the community and also in the KSDK 1.3:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Freescale\KSDK_1.3.0\examples\frdmkl43z\driver_examples\i2c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Santiago&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 01:01:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Functions-for-I2C-with-KL43-SDK-and-PE/m-p/468076#M3681</guid>
      <dc:creator>santiago_gonzal</dc:creator>
      <dc:date>2016-03-11T01:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Functions for I2C with KL43 SDK and PE?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Functions-for-I2C-with-KL43-SDK-and-PE/m-p/468077#M3682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Christopher:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As mentioned by Santiago there are several examples in KSDK installation, you should take a look at those.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just notice that the &lt;STRONG&gt;MasterSendData&lt;/STRONG&gt; API expects the parameter &lt;STRONG&gt;txBuff&lt;/STRONG&gt; to be passed by reference, not by value, so in your case you should declare a &lt;STRONG&gt;uint8_t&lt;/STRONG&gt; variable or an array of &lt;STRONG&gt;uint8_t&lt;/STRONG&gt; and pass the address as a pointer. The parameter &lt;STRONG&gt;txSize&lt;/STRONG&gt; is the number of bytes to transfer from such array, or &lt;STRONG&gt;1&lt;/STRONG&gt; in the &lt;STRONG&gt;uint8_t &lt;/STRONG&gt;variable case. Below an example for &lt;EM&gt;writing&lt;/EM&gt; 0x06 to an I2C slave:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_1458090727700672" data-renderedposition="217_8_1155_48" jivemacro_uid="_1458090727700672" modifiedtitle="true"&gt;&lt;P&gt;uint8_t data = 0x06;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I2C_DRV_MasterSendData (i2cCom1_IDX,&amp;amp;i2cCom1_MasterConfig0, NULL, 0, &amp;amp;data, 1);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About &lt;STRONG&gt;cmdBuff&lt;/STRONG&gt; parameter, this is used for some slave devices that require extra bytes apart from the significant data bytes to send or receive. For example the I2C EEPROM memories may require an internal address before a Write or Read operation (do not confuse with the I2C slave address). In the case of the API &lt;STRONG&gt;MasterReceiveData&lt;/STRONG&gt; when &lt;STRONG&gt;cmdBuff&lt;/STRONG&gt; is not NULL then a &lt;STRONG&gt;Repeated Start&lt;/STRONG&gt; is generated between the transmission of &lt;STRONG&gt;cmdBuff&lt;/STRONG&gt; and the reception of data in &lt;STRONG&gt;rxBuff&lt;/STRONG&gt;, with a corresponding change in the R/W bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Jorge Gonzalez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Mar 2016 01:17:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Functions-for-I2C-with-KL43-SDK-and-PE/m-p/468077#M3682</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2016-03-16T01:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Functions for I2C with KL43 SDK and PE?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Functions-for-I2C-with-KL43-SDK-and-PE/m-p/468078#M3683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;I found this code in an I2C kl43z example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/23287i5363C7888771A7C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Would using (const uint8_t) rather than passing the address as a pointer achieve the same result?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2016 19:14:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Functions-for-I2C-with-KL43-SDK-and-PE/m-p/468078#M3683</guid>
      <dc:creator>christopherira</dc:creator>
      <dc:date>2016-03-17T19:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Functions for I2C with KL43 SDK and PE?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Functions-for-I2C-with-KL43-SDK-and-PE/m-p/468079#M3684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Christopher:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, that would not work. The pointer goes to a run-time state structure which is manipulated by the driver functions and the interrupt handler. All of the driver's code expects to have a pointer in such structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2016 20:09:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Functions-for-I2C-with-KL43-SDK-and-PE/m-p/468079#M3684</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2016-03-17T20:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Functions for I2C with KL43 SDK and PE?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Functions-for-I2C-with-KL43-SDK-and-PE/m-p/468080#M3685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2016 20:34:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Functions-for-I2C-with-KL43-SDK-and-PE/m-p/468080#M3685</guid>
      <dc:creator>christopherira</dc:creator>
      <dc:date>2016-03-17T20:34:15Z</dc:date>
    </item>
  </channel>
</rss>

