<?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>Kinetis Software Development KitのトピックRe: Reading a Port as a set of parallel bits</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Reading-a-Port-as-a-set-of-parallel-bits/m-p/526729#M5461</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the api function GPIO_ReadPinInput() body:&lt;/P&gt;&lt;P&gt;static inline uint32_t GPIO_ReadPinInput(GPIO_Type *base, uint32_t pin)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (((base-&amp;gt;PDIR) &amp;gt;&amp;gt; pin) &amp;amp; 0x01U);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;You see that the function only read the specified bit instead of all the bits in PDIR register.&lt;/P&gt;&lt;P&gt;If you want to read all the PDIR register, you can define a function yourself.&lt;/P&gt;&lt;P&gt;for example&lt;/P&gt;&lt;P&gt;static inline uint32_t GPIO_ReadInput(GPIO_Type *base)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (base-&amp;gt;PDIR);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Hope it can help you.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Jul 2016 02:19:56 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2016-07-01T02:19:56Z</dc:date>
    <item>
      <title>Reading a Port as a set of parallel bits</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Reading-a-Port-as-a-set-of-parallel-bits/m-p/526728#M5460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In KSDK1, I was able to read a port as a set or parallel bits using the GPIO_HAL_ReadPortInput(FP_BASE) function.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It appears that in KSDK2, this has been removed and I can only find routines to read individual bits on the port using the GPIO_ReadPinInput(FP_BASE, PIN_NO) routine.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I read the set if bits in KSDK2?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2016 20:06:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Reading-a-Port-as-a-set-of-parallel-bits/m-p/526728#M5460</guid>
      <dc:creator>davepfaltzgraff</dc:creator>
      <dc:date>2016-06-30T20:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a Port as a set of parallel bits</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Reading-a-Port-as-a-set-of-parallel-bits/m-p/526729#M5461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the api function GPIO_ReadPinInput() body:&lt;/P&gt;&lt;P&gt;static inline uint32_t GPIO_ReadPinInput(GPIO_Type *base, uint32_t pin)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (((base-&amp;gt;PDIR) &amp;gt;&amp;gt; pin) &amp;amp; 0x01U);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;You see that the function only read the specified bit instead of all the bits in PDIR register.&lt;/P&gt;&lt;P&gt;If you want to read all the PDIR register, you can define a function yourself.&lt;/P&gt;&lt;P&gt;for example&lt;/P&gt;&lt;P&gt;static inline uint32_t GPIO_ReadInput(GPIO_Type *base)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (base-&amp;gt;PDIR);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Hope it can help you.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2016 02:19:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Reading-a-Port-as-a-set-of-parallel-bits/m-p/526729#M5461</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-07-01T02:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a Port as a set of parallel bits</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Reading-a-Port-as-a-set-of-parallel-bits/m-p/526730#M5462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi XiangJun Rong,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's what I had thought, but when I tried it, I didn't get the results I expected. My problem was some code brought in from an old project that was driving the pins low when I expected them to be inputs. Now that I have eliminated that code, the system is now operating as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2016 17:43:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Reading-a-Port-as-a-set-of-parallel-bits/m-p/526730#M5462</guid>
      <dc:creator>davepfaltzgraff</dc:creator>
      <dc:date>2016-07-01T17:43:14Z</dc:date>
    </item>
  </channel>
</rss>

