<?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: How does Init(LDD_TUserData *UserDataPtr) work in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-does-Init-LDD-TUserData-UserDataPtr-work/m-p/353156#M11273</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;void *ptr is a pointer to 'void', and in C this is a pointer to 'anything'. A void pointer is an unspecified type pointer, and used for these kind of things.&lt;/P&gt;&lt;P&gt;I don't know to which Wikipedia article you are referring, but to me this is pretty basic C language.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 Jan 2015 13:27:51 GMT</pubDate>
    <dc:creator>BlackNight</dc:creator>
    <dc:date>2015-01-17T13:27:51Z</dc:date>
    <item>
      <title>How does Init(LDD_TUserData *UserDataPtr) work</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-does-Init-LDD-TUserData-UserDataPtr-work/m-p/353153#M11270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been analysing the generated code from PEx for a while now. The &lt;STRONG&gt;Init() &lt;/STRONG&gt;function returns a pointer to the private structure/device structure. Which we then use for all subsequent methods as the first parameter in order to specify which device is being called.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT - where does the &lt;STRONG&gt;*UserDataPtr&lt;/STRONG&gt; come from? I searched in the components ".c" as well as ".h" file. It must be something I overlooked, but now I am really not getting where this pointer comes from. Or is it that a Null Pointer need not be declared and initialized? &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need any more details, please let me know I will post screenshots.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Jan 2015 07:14:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-does-Init-LDD-TUserData-UserDataPtr-work/m-p/353153#M11270</guid>
      <dc:creator>pratiekbhadrana</dc:creator>
      <dc:date>2015-01-17T07:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: How does Init(LDD_TUserData *UserDataPtr) work</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-does-Init-LDD-TUserData-UserDataPtr-work/m-p/353154#M11271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That UserDataPtr comes from your application. You can pass NULL if you don't need such a pointer.&lt;/P&gt;&lt;P&gt;That pointer points to your own data structure where you can have in it whatever you want/need.&lt;/P&gt;&lt;P&gt;For example you can initialize device, and add with the user data pointer your own data to the device handle.&lt;/P&gt;&lt;P&gt;Whenever you get callbacks, you can then get that data through that pointer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Jan 2015 11:23:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-does-Init-LDD-TUserData-UserDataPtr-work/m-p/353154#M11271</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2015-01-17T11:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: How does Init(LDD_TUserData *UserDataPtr) work</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-does-Init-LDD-TUserData-UserDataPtr-work/m-p/353155#M11272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I mouse over to &lt;STRONG&gt;LDD_TUserData&lt;/STRONG&gt; it shows that that is actually a typedef for &lt;STRONG&gt;void&lt;/STRONG&gt;. So what its actually doing is &lt;STRONG&gt;void *UserDataPtr&lt;/STRONG&gt;. It is mentioned that this is the RTOS Device Structure pointer. What does that mean? Wikipedia says that &lt;STRONG&gt;void *x &lt;/STRONG&gt;makes &lt;STRONG&gt;x&lt;/STRONG&gt; a NULL pointer. So I suppose that is default because I am programming bareboard with no seleceted OS? But I still can't figure out what is this RTOS Device Structure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Jan 2015 12:49:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-does-Init-LDD-TUserData-UserDataPtr-work/m-p/353155#M11272</guid>
      <dc:creator>pratiekbhadrana</dc:creator>
      <dc:date>2015-01-17T12:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: How does Init(LDD_TUserData *UserDataPtr) work</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-does-Init-LDD-TUserData-UserDataPtr-work/m-p/353156#M11273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;void *ptr is a pointer to 'void', and in C this is a pointer to 'anything'. A void pointer is an unspecified type pointer, and used for these kind of things.&lt;/P&gt;&lt;P&gt;I don't know to which Wikipedia article you are referring, but to me this is pretty basic C language.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Jan 2015 13:27:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-does-Init-LDD-TUserData-UserDataPtr-work/m-p/353156#M11273</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2015-01-17T13:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: How does Init(LDD_TUserData *UserDataPtr) work</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-does-Init-LDD-TUserData-UserDataPtr-work/m-p/353157#M11274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for the confusion. What I meant was &lt;STRONG&gt;void * ptr &lt;/STRONG&gt;with &lt;STRONG&gt;ptr = 0&lt;/STRONG&gt; results in a null pointer. I just added the Wikipedia reference to clear doubts if any...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your answer Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 05:06:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-does-Init-LDD-TUserData-UserDataPtr-work/m-p/353157#M11274</guid>
      <dc:creator>pratiekbhadrana</dc:creator>
      <dc:date>2015-01-19T05:06:57Z</dc:date>
    </item>
  </channel>
</rss>

