<?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のトピックK82: full gpio pin configuration</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-full-gpio-pin-configuration/m-p/893703#M52746</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;I would like to configure gpio pin as normal gigital output with default state 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Config tool generate :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gpio_pin_config_t SWITCH_EN_config = {&lt;BR /&gt; .pinDirection = kGPIO_DigitalOutput,&lt;BR /&gt; .outputLogic = 0U&lt;BR /&gt; };&lt;BR /&gt; /* Initialize GPIO functionality on pin .../&lt;BR /&gt; GPIO_PinInit(BOARD_SWITCH_EN_GPIO, BOARD_SWITCH_EN_PIN, &amp;amp;SWITCH_EN_config);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PORT_SetPinMux(BOARD_SWITCH_EN_PORT, BOARD_SWITCH_EN_PIN, kPORT_MuxAsGpio);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But default exact pin config is missing and in theory it should looks like this :&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; const port_pin_config_t pin_config = {&lt;BR /&gt; /* No pull setup for this pin */&lt;BR /&gt; .pullSelect = kPORT_PullDisable,&lt;BR /&gt; /* Fast slew rate is configured */&lt;BR /&gt; .slewRate = kPORT_FastSlewRate,&lt;BR /&gt; /* Passive filter is disabled */&lt;BR /&gt; .passiveFilterEnable = kPORT_PassiveFilterDisable,&lt;BR /&gt; /* Open drain is enabled */&lt;BR /&gt; .openDrainEnable = kPORT_OpenDrainDisable,&lt;BR /&gt; /* Low drive strength is configured */&lt;BR /&gt; .driveStrength = kPORT_LowDriveStrength,&lt;BR /&gt; /* Pin is configured as GPIO */&lt;BR /&gt; .mux = kPORT_MuxAsGpio,&lt;BR /&gt; /* Pin Control Register fields [15:0] are not locked */&lt;BR /&gt; .lockRegister = kPORT_UnlockRegister};&lt;BR /&gt; PORT_SetPinConfig(PORTC, BOARD_SWITCH_EN_PIN, &amp;amp;pin_config);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All of those constants have value 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I assume that&amp;nbsp;&lt;SPAN&gt;PORT_SetPinConfig() call is no need if values have default state e.g 0 ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Eugene&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Apr 2019 12:31:13 GMT</pubDate>
    <dc:creator>EugeneHiihtaja</dc:creator>
    <dc:date>2019-04-26T12:31:13Z</dc:date>
    <item>
      <title>K82: full gpio pin configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-full-gpio-pin-configuration/m-p/893703#M52746</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;I would like to configure gpio pin as normal gigital output with default state 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Config tool generate :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gpio_pin_config_t SWITCH_EN_config = {&lt;BR /&gt; .pinDirection = kGPIO_DigitalOutput,&lt;BR /&gt; .outputLogic = 0U&lt;BR /&gt; };&lt;BR /&gt; /* Initialize GPIO functionality on pin .../&lt;BR /&gt; GPIO_PinInit(BOARD_SWITCH_EN_GPIO, BOARD_SWITCH_EN_PIN, &amp;amp;SWITCH_EN_config);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PORT_SetPinMux(BOARD_SWITCH_EN_PORT, BOARD_SWITCH_EN_PIN, kPORT_MuxAsGpio);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But default exact pin config is missing and in theory it should looks like this :&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; const port_pin_config_t pin_config = {&lt;BR /&gt; /* No pull setup for this pin */&lt;BR /&gt; .pullSelect = kPORT_PullDisable,&lt;BR /&gt; /* Fast slew rate is configured */&lt;BR /&gt; .slewRate = kPORT_FastSlewRate,&lt;BR /&gt; /* Passive filter is disabled */&lt;BR /&gt; .passiveFilterEnable = kPORT_PassiveFilterDisable,&lt;BR /&gt; /* Open drain is enabled */&lt;BR /&gt; .openDrainEnable = kPORT_OpenDrainDisable,&lt;BR /&gt; /* Low drive strength is configured */&lt;BR /&gt; .driveStrength = kPORT_LowDriveStrength,&lt;BR /&gt; /* Pin is configured as GPIO */&lt;BR /&gt; .mux = kPORT_MuxAsGpio,&lt;BR /&gt; /* Pin Control Register fields [15:0] are not locked */&lt;BR /&gt; .lockRegister = kPORT_UnlockRegister};&lt;BR /&gt; PORT_SetPinConfig(PORTC, BOARD_SWITCH_EN_PIN, &amp;amp;pin_config);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All of those constants have value 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I assume that&amp;nbsp;&lt;SPAN&gt;PORT_SetPinConfig() call is no need if values have default state e.g 0 ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Eugene&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Apr 2019 12:31:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-full-gpio-pin-configuration/m-p/893703#M52746</guid>
      <dc:creator>EugeneHiihtaja</dc:creator>
      <dc:date>2019-04-26T12:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: K82: full gpio pin configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-full-gpio-pin-configuration/m-p/893704#M52747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Eugene, I hope you're doing well,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can see the reset values for some of the PCR values in the K82 Reference Manual:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/61903iB67100ACFDB665D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, as the notes say, some of the reset values for the Pin Control Register vary, depending on which port the pin you're configuring belongs to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can check further information about this at Table 12-2 (pages 214 and 215 of &lt;A href="https://www.nxp.com/docs/en/reference-manual/K82P121M150SF5RM.pdf"&gt;the K82 Sub-Family Reference Manual&lt;/A&gt;). Depending on each pin, you may need to manually configure them using PORT_SetPinConfig().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, let me know if you have any other questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Sebastian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Apr 2019 19:26:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-full-gpio-pin-configuration/m-p/893704#M52747</guid>
      <dc:creator>Sebastian_Del_Rio</dc:creator>
      <dc:date>2019-04-26T19:26:30Z</dc:date>
    </item>
  </channel>
</rss>

