<?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>LPC MicrocontrollersのトピックC code question for 54102 part</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/C-code-question-for-54102-part/m-p/754412#M30385</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a 54102 processor board from Coridium.&lt;/P&gt;&lt;P&gt;I am using the MakeItC compiler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for just a small bit of help with a C statement for this board.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have reviewed the NXP document for the part and the help I am requesting is a sample C statement that writes to a specific memory address.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other C source code that might be available for this part is a great interest to me, but for now I want to program the part by setting register values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Mar 2018 17:37:03 GMT</pubDate>
    <dc:creator>robertrobert</dc:creator>
    <dc:date>2018-03-30T17:37:03Z</dc:date>
    <item>
      <title>C code question for 54102 part</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/C-code-question-for-54102-part/m-p/754412#M30385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a 54102 processor board from Coridium.&lt;/P&gt;&lt;P&gt;I am using the MakeItC compiler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for just a small bit of help with a C statement for this board.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have reviewed the NXP document for the part and the help I am requesting is a sample C statement that writes to a specific memory address.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other C source code that might be available for this part is a great interest to me, but for now I want to program the part by setting register values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2018 17:37:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/C-code-question-for-54102-part/m-p/754412#M30385</guid>
      <dc:creator>robertrobert</dc:creator>
      <dc:date>2018-03-30T17:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: C code question for 54102 part</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/C-code-question-for-54102-part/m-p/754413#M30386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At the simplest level in C access to registers is through pointers for ARM processors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* some_address = some_value;&amp;nbsp; // some_address is defined as a unsigned int pointer type (uint32_t most places)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In header files&amp;nbsp; (old school like me) would define in a header (.h file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define&amp;nbsp;&amp;nbsp;LPC_GPIO_DIR&amp;nbsp;&amp;nbsp;&amp;nbsp; * (unint32_t *) 0x1C002000&amp;nbsp; // GPIO direction for Port 0&lt;/P&gt;&lt;P&gt;#define&amp;nbsp;&amp;nbsp;LPC_GPIO_SET&amp;nbsp;&amp;nbsp; * (unint32_t *) 0x1C002200&amp;nbsp; // GPIO set for Port 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And to set say bit 4 high&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_GPIO_DIR&amp;nbsp;&amp;nbsp;&amp;nbsp;= (1 &amp;lt;&amp;lt; 4);&amp;nbsp;&amp;nbsp;&amp;nbsp;// set pin/bit 4 of Port 0 as output&lt;/P&gt;&lt;P&gt;LPC_GPIO_SET&amp;nbsp; = (1 &amp;lt;&amp;lt; 4);&amp;nbsp;&amp;nbsp;&amp;nbsp;// and set that pin high&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More modern definitions of registers defines the structure of the set of registers in a header file.&amp;nbsp; So that the same code would be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_GPIO-&amp;gt;DIR[0] = (1 &amp;lt;&amp;lt; 4);&amp;nbsp;&amp;nbsp;&amp;nbsp;//set pin/bit 4 of the DIR register of Port 0 GPIO structure (group of registers) as output&lt;/P&gt;&lt;P&gt;LPC_GPIO-&amp;gt;SET[0] = (1 &amp;lt;&amp;lt; 4);&amp;nbsp;&amp;nbsp;&amp;nbsp;// and set that pin high&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And some "modern' (obtuse) definitions define them as inline code in a header (start the flame wars- an atrocious practice)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;__STATIC_INLINE void Chip_GPIO_WritePortBit(LPC_GPIO_T *pGPIO, uint32_t port, uint8_t pin, bool setting)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;pGPIO-&amp;gt;B[port][pin] = setting;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;__STATIC_INLINE void Chip_GPIO_SetPinState(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pin, bool setting)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;pGPIO-&amp;gt;B[port][pin] = setting;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2018 23:01:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/C-code-question-for-54102-part/m-p/754413#M30386</guid>
      <dc:creator>bruceeisenhard</dc:creator>
      <dc:date>2018-04-02T23:01:44Z</dc:date>
    </item>
  </channel>
</rss>

