<?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のトピックGPIO numbering on uclinux</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/GPIO-numbering-on-uclinux/m-p/551187#M14152</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bomellberg on Fri Apr 10 00:16:30 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;In uClinux, you can address GPIO in user space by enabling gpio like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;echo 12 &amp;gt; /sys/class/gpio/export&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;which gives you a virtual directory named "gpio12" where you can set direction and high/low etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is: How do I find out the number to use in uClinux?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My LQFP144 version of LPC4337 has 6 GPIO Ports:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;GPIO0[15:0]
GPIO1[15:0]
GPIO2[15:0]
GPIO3[15:0]
GPIO4[11]
GPIO5[16:0]
GPIO5[18]
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to set pin P7_4 which is GPIO3[12]. What is the number to use in uClinux? (the number 12 in my example above).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/Bo&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 18:33:55 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T18:33:55Z</dc:date>
    <item>
      <title>GPIO numbering on uclinux</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/GPIO-numbering-on-uclinux/m-p/551187#M14152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bomellberg on Fri Apr 10 00:16:30 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;In uClinux, you can address GPIO in user space by enabling gpio like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;echo 12 &amp;gt; /sys/class/gpio/export&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;which gives you a virtual directory named "gpio12" where you can set direction and high/low etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is: How do I find out the number to use in uClinux?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My LQFP144 version of LPC4337 has 6 GPIO Ports:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;GPIO0[15:0]
GPIO1[15:0]
GPIO2[15:0]
GPIO3[15:0]
GPIO4[11]
GPIO5[16:0]
GPIO5[18]
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to set pin P7_4 which is GPIO3[12]. What is the number to use in uClinux? (the number 12 in my example above).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/Bo&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:33:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/GPIO-numbering-on-uclinux/m-p/551187#M14152</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO numbering on uclinux</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/GPIO-numbering-on-uclinux/m-p/551188#M14153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bomellberg on Fri Apr 10 02:55:10 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Found the answer in arch\arm\mach-lpc18xx\include\mach\gpio.h:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;/*
 * Convert a {port, pin} pair to an single integer
 */
#define LPC18XX_GPIO_MKPIN(port,pin) \
((LPC18XX_GPIO_PORT_PINS) * (port) + (pin))
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So to work with GPIO3[12] the number is 3*32+12 = 108, which works nicely.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:33:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/GPIO-numbering-on-uclinux/m-p/551188#M14153</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:33:56Z</dc:date>
    </item>
  </channel>
</rss>

