<?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: FRDM-KL26Z GPIO programming knowhow? in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FRDM-KL26Z-GPIO-programming-knowhow/m-p/659437#M7166</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Xiangjun,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;That helps a lot. I got it now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Thank you so much.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;--Daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Nov 2016 17:13:29 GMT</pubDate>
    <dc:creator>danieltruong</dc:creator>
    <dc:date>2016-11-15T17:13:29Z</dc:date>
    <item>
      <title>FRDM-KL26Z GPIO programming knowhow?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FRDM-KL26Z-GPIO-programming-knowhow/m-p/659435#M7164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've just had a FRDM-KL26Z board and some SW tools (KSDK and KDS) installed. Starting to browse some code to see how the GPIOs are configured and programmed.&lt;/P&gt;&lt;P&gt;It gets down to the following code with the pin names defined as&amp;nbsp;&lt;EM&gt;&lt;SPAN style="font-size: 10.0pt; color: #0000c0; background: lightgrey;"&gt;kGpioLED1&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background: lightgrey; font-size: 10.0pt;"&gt;,&amp;nbsp;&lt;EM style="color: #0000c0; font-size: 10.0pt;"&gt;kGpioLED2,&lt;/EM&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt; etc. and I just can't figure out how they are defined the way as shown. It's got to have a place where user can manually enters the related information (as it differs from board to board). In the comments just above the code,&amp;nbsp;&lt;SPAN style="color: #3f7f5f;"&gt;gpioPinLookupTable &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;is mentioned for this purpose. Can someone help give me a pointer as to where I can obtain this table and hopefully I can customize it for my project?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you in advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;---------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;/*! @file */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;/*!*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;/*! This file contains &lt;SPAN style="text-decoration: underline;"&gt;gpio&lt;/SPAN&gt; pin definitions used by &lt;SPAN style="text-decoration: underline;"&gt;gpio&lt;/SPAN&gt; peripheral driver.*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;/*! The &lt;SPAN style="text-decoration: underline;"&gt;enums&lt;/SPAN&gt; in _gpio_pins map to the real &lt;SPAN style="text-decoration: underline;"&gt;gpio&lt;/SPAN&gt; pin numbers defined in*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;/*! gpioPinLookupTable. And this might be different in different board.*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;/*******************************************************************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;&amp;nbsp;* Definitions&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;&amp;nbsp;******************************************************************************/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;/*! @brief &lt;SPAN style="text-decoration: underline;"&gt;gpio&lt;/SPAN&gt; pin names.*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;/*!*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;/*! This should be defined according to board setting.*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;/* gpio_pins.h */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10.0pt;"&gt;enum&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; _gpio_pins&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;EM style="color: #0000c0; background: lightgrey; font-size: 10.0pt;"&gt;kGpioLED1&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = GPIO_MAKE_PIN(GPIOE_IDX, 31u),&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;/* FRDM-KL26Z4 Green LED */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;EM style="color: #0000c0; font-size: 10.0pt;"&gt;kGpioLED2&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = GPIO_MAKE_PIN(GPIOE_IDX, 29u),&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;/* FRDM-KL26Z4 Red LED */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;EM style="color: #0000c0; font-size: 10.0pt;"&gt;kGpioLED3&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = GPIO_MAKE_PIN(GPIOD_IDX, 5u),&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;/* FRDM-KL26Z4 Blue LED */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;EM style="color: #0000c0; font-size: 10.0pt;"&gt;kGpioSW1&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = GPIO_MAKE_PIN(GPIOC_IDX, 3u),&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: #3f7f5f;"&gt;/* FRDM-KL26Z4 switchPin1 */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="background-color: #ffffff; color: #222222; text-decoration: none; font-size: 12px;"&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2016 18:44:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FRDM-KL26Z-GPIO-programming-knowhow/m-p/659435#M7164</guid>
      <dc:creator>danieltruong</dc:creator>
      <dc:date>2016-11-14T18:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KL26Z GPIO programming knowhow?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FRDM-KL26Z-GPIO-programming-knowhow/m-p/659436#M7165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Daniel,&lt;/P&gt;&lt;P&gt;Regarding the GPIO pin, each GPIO port is given an index,the GPIOA is defined as 0, GPIOB is defined as 1, GPIOC is defined as 2, GPIOD is defined as 3..., for the code,&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; &lt;/SPAN&gt;&lt;EM style="color: #0000c0; background: lightgrey; font-size: 10.0pt;"&gt;kGpioLED1&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = GPIO_MAKE_PIN(GPIOE_IDX, 31u), , pls refer to the file fsl_gpio_driver.h, which is located at:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;C:\DriverE\Freescale\KSDK_1.3.0\platform\drivers\inc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;/*! @brief Indicates the end of a pin configuration structure.*/&lt;BR /&gt;#define GPIO_PINS_OUT_OF_RANGE (0xFFFFFFFFU)&lt;BR /&gt;&lt;BR /&gt;/*! @brief Bits shifted for the GPIO port number. */&lt;BR /&gt;#define GPIO_PORT_SHIFT (0x8U)&lt;BR /&gt;&lt;BR /&gt;/*! @brief Combines the port number and the pin number into a single scalar value. */&lt;BR /&gt;#define GPIO_MAKE_PIN(r,p) (((r)&amp;lt;&amp;lt; GPIO_PORT_SHIFT) | (p))&lt;BR /&gt;&lt;BR /&gt;/*! @brief Extracts the port number from a combined port and pin value.*/&lt;BR /&gt;#define GPIO_EXTRACT_PORT(v) (((v) &amp;gt;&amp;gt; GPIO_PORT_SHIFT) &amp;amp; 0xFFU)&lt;BR /&gt;&lt;BR /&gt;/*! @brief Extracts the pin number from a combined port and pin value.*/&lt;BR /&gt;#define GPIO_EXTRACT_PIN(v) ((v) &amp;amp; 0xFFU)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;In other words, GPIO pin number is defined as a 16 bits word(byte1,byte0 ), the byte0 is the pin index which ranges from 0 to 31, the byte1 is the GPIO port index, GPIOA is 0, GPIOB is 1, GPIOC is 2..., In the fsl_gpio_driver.c which is located at:C:\DriverE\Freescale\KSDK_1.3.0\platform\drivers\src, you can find the code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;void GPIO_DRV_SetPinDir(uint32_t pinName, gpio_pin_direction_t direction)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_Type * gpioBase = g_gpioBase[GPIO_EXTRACT_PORT(pinName)];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t pin = GPIO_EXTRACT_PIN(pinName);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_HAL_SetPinDir(gpioBase, pin, direction);&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;Hope it can help you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;BTW, I suggest you use SDK2.0, which use totally different structure for GPIO.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;BR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;Xiangjun Rong&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Nov 2016 06:11:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FRDM-KL26Z-GPIO-programming-knowhow/m-p/659436#M7165</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-11-15T06:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KL26Z GPIO programming knowhow?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FRDM-KL26Z-GPIO-programming-knowhow/m-p/659437#M7166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Xiangjun,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;That helps a lot. I got it now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Thank you so much.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;--Daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Nov 2016 17:13:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FRDM-KL26Z-GPIO-programming-knowhow/m-p/659437#M7166</guid>
      <dc:creator>danieltruong</dc:creator>
      <dc:date>2016-11-15T17:13:29Z</dc:date>
    </item>
  </channel>
</rss>

