<?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 MicrocontrollersのトピックUse the same pin as input and output alternatively</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-the-same-pin-as-input-and-output-alternatively/m-p/777922#M47331</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. Currently I try to implement a driver for a One Wire device to use it on KW41Z board and struggle to make a basic pin setup.&lt;/P&gt;&lt;P&gt;I see only two options of resolving the question inclined in the topic title: either there should be two configuration of a pin with&amp;nbsp;input and output directions set respectively and the pin init function should be called each time I need to change the direction, or the port registers should be changed manually.&lt;/P&gt;&lt;P&gt;Can you say which way is better, and if the second one (with port registers) is more appropriate, can you help me with the port registers setup?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 May 2018 09:11:55 GMT</pubDate>
    <dc:creator>ppz</dc:creator>
    <dc:date>2018-05-23T09:11:55Z</dc:date>
    <item>
      <title>Use the same pin as input and output alternatively</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-the-same-pin-as-input-and-output-alternatively/m-p/777922#M47331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. Currently I try to implement a driver for a One Wire device to use it on KW41Z board and struggle to make a basic pin setup.&lt;/P&gt;&lt;P&gt;I see only two options of resolving the question inclined in the topic title: either there should be two configuration of a pin with&amp;nbsp;input and output directions set respectively and the pin init function should be called each time I need to change the direction, or the port registers should be changed manually.&lt;/P&gt;&lt;P&gt;Can you say which way is better, and if the second one (with port registers) is more appropriate, can you help me with the port registers setup?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2018 09:11:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-the-same-pin-as-input-and-output-alternatively/m-p/777922#M47331</guid>
      <dc:creator>ppz</dc:creator>
      <dc:date>2018-05-23T09:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Use the same pin as input and output alternatively</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-the-same-pin-as-input-and-output-alternatively/m-p/777923#M47332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to change pin direction efficiently it is not wise to perform the complete initialisation each time (it will work but is slower). It is easy to simply use the data direction register as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GPIOx_PDDR |= (pins);&lt;/P&gt;&lt;P&gt;GPIOx_PDDR &amp;amp;= ~(pins);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or bit band it to avoid the AND/OR operation.&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;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 14:50:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-the-same-pin-as-input-and-output-alternatively/m-p/777923#M47332</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-05-24T14:50:12Z</dc:date>
    </item>
  </channel>
</rss>

