<?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>MQX Software Solutions中的主题 Re: About ports, variables and write/read operations</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230786#M6297</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Martin.&lt;/P&gt;&lt;P&gt;I was doing that. I asked before looking for a solution more "mqx-like", but I see that there is no solution like that. It's a shame that this problem could not been developed, I think that this is a very helpfull tip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;Kind regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 May 2013 03:40:10 GMT</pubDate>
    <dc:creator>gsanchez</dc:creator>
    <dc:date>2013-05-14T03:40:10Z</dc:date>
    <item>
      <title>About ports, variables and write/read operations</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230780#M6291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;Hi all, I have a question.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;How can I redirect a set of defined ports to a variable? Or better, treat all they as a variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;I try to explain it better:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;I have in my application:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;#define PORT_OUT_1 (GPIO_PORT_E | GPIO_PIN11)&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;#define PORT_OUT_2 (GPIO_PORT_E | GPIO_PIN8)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;...&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;Then, in the code:&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;DIV&gt;GPIO_PIN_STRUCT pins_control[] = {&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_OUT_1 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_OUT_2 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_OUT_3 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_OUT_4 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_OUT_5 | GPIO_PIN_STATUS_0,&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_OUT_6 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_OUT_7 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_OUT_8 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_LIST_END };&lt;/P&gt;&lt;/DIV&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;And in some place:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; port_file = fopen("gpio:write", (char_ptr) &amp;amp;pins_control);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, what I want is to write:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;pins_control = "0xAA";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;And obtain the values independently in the ports:&lt;/P&gt;&lt;P&gt;PORT_OUT_1&amp;lt;-1,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PORT_OUT_2&amp;lt;-0,&lt;/P&gt;&lt;P&gt;PORT_OUT_3&amp;lt;-1,&lt;/P&gt;&lt;P&gt;PORT_OUT_4&amp;lt;-0,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;PORT_OUT_5&amp;lt;-1,&lt;P&gt;&lt;/P&gt;&lt;P&gt;PORT_OUT_6&amp;lt;-0,&lt;/P&gt;&lt;P&gt;PORT_OUT_7&amp;lt;-1,&lt;/P&gt;&lt;P&gt;PORT_OUT_8&amp;lt;-0,&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can be done? I hope I explained.&lt;/P&gt;&lt;P&gt;Thanks. Kind regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: Sorry about my english.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2013 23:17:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230780#M6291</guid>
      <dc:creator>gsanchez</dc:creator>
      <dc:date>2013-05-08T23:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: About ports, variables and write/read operations</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230781#M6292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello gsanchez,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the example you have posted rises few questions. Please always share with us, what MCU you are working on, version of MQX ! :smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Why do you use GPIO driver? There's lwgpio driver. GPIO is obsolete at the moment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. GPIO_PIN_STRUCT defines only pin characteristics (PORT, PIN, STATUS) which are then "decoded" inside gpio driver. All those are preprocessor macros (numbers) which are replaced during the preprocessor phase to numbers. Those numbers are rvalues (they are not objects occupying an identifiable location in memory).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Where would you like to write a value 0xAA ??? There are usually more registers to set for GPIO controls (like Set Input/Output, Toggle Output and many more).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;c0170&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 07:27:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230781#M6292</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2013-05-09T07:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: About ports, variables and write/read operations</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230782#M6293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;Of course, I don't remember that! :smileywink:&lt;/P&gt;&lt;P&gt;MCU used: Kinetis K60 (MK60DN512)&lt;/P&gt;&lt;P&gt;MQX: 3.8.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Because this is a basic application, and I was beggining with that. I think GPIO was more easy to learn. But now I will take a look to lwgpio.&lt;/P&gt;&lt;P&gt;2) Yeah, I know that. I just was being more descriptive with my application...&lt;/P&gt;&lt;P&gt;3) 0xAA was only an example value. I want to write an arbitrary 8 bits value to a variable, and what I want is to see that arbitrary value reflected in the ports (if the port was an output port); or viceversa, read the value of a 8 bits variable, and really read the 8 ports assigned to that variable.&lt;/P&gt;&lt;P&gt;I know the GPIO controls and registers, but I am doing this application under MQX, so I want to know if there is a "mqx" way to do this, as using:&lt;/P&gt;&lt;P&gt;ioctl(port_file, GPIO_IOCTL_WRITE_LOG1, &amp;amp;pins);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 10:40:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230782#M6293</guid>
      <dc:creator>gsanchez</dc:creator>
      <dc:date>2013-05-09T10:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: About ports, variables and write/read operations</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230783#M6294</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;I would use lwpgio , it's easier to get familiar with it than GPIO posix driver &lt;IMG alt="Smiley Wink" class="emoticon emoticon-smileywink" id="smileywink" src="https://community.nxp.com/i/smilies/16x16_smiley-wink.png" title="Smiley Wink" /&gt;&amp;nbsp; You might not need what you asked about.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13681006065844917" jivemacro_uid="_13681006065844917"&gt;
&lt;P&gt;typedef struct {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint_32_ptr&amp;nbsp;&amp;nbsp;&amp;nbsp; pcr_reg;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO_MemMapPtr gpio_ptr;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint_32 pinmask; /* since struct holds one pin, pinmask will have only one bit set */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint_32 flags;&lt;/P&gt;
&lt;P&gt;} LWGPIO_STRUCT, _PTR_ LWGPIO_STRUCT_PTR;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN class="mce_paste_marker"&gt;This is LWGPIO STRUCT, second member of the struct is pointer to GPIO register. Which might allow you to do desired operations as requested. The following struct is from K60 header file which is inside psp folder (source/psp/cortex_m/cpu)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13681006065575580" jivemacro_uid="_13681006065575580"&gt;
&lt;P&gt;typedef struct GPIO_MemMap {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; uint32_t PDOR;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; Port Data Output Register, offset: 0x0 */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; uint32_t PSOR;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; Port Set Output Register, offset: 0x4 */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; uint32_t PCOR;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; Port Clear Output Register, offset: 0x8 */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; uint32_t PTOR;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; Port Toggle Output Register, offset: 0xC */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; uint32_t PDIR;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; Port Data Input Register, offset: 0x10 */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; uint32_t PDDR;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; Port Data Direction Register, offset: 0x14 */&lt;/P&gt;
&lt;P&gt;} volatile *GPIO_MemMapPtr;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;c0170&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 12:59:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230783#M6294</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2020-11-02T12:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: About ports, variables and write/read operations</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230784#M6295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin, thanks again for your answer. I am seeing now lwgpio, it's not complicated.&lt;/P&gt;&lt;P&gt;Why you say: "&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Which might allow you to do desired operations as requested.&lt;/SPAN&gt;". With that, I am in the same way that before. I have each port pin defined independently from another...&lt;/P&gt;&lt;P&gt;I will try to explain me better:&lt;/P&gt;&lt;P&gt;What I want to do, is for connect a data bus of a LCD display, to different ports of the MCU, and when I need to write a value to the data bus, write as it is, for example:&lt;/P&gt;&lt;P&gt;data_bus = "0x0F";&lt;/P&gt;&lt;P&gt;and not to set independently 4 port pins, and clear the other 4 port pins.&lt;/P&gt;&lt;P&gt;Kind regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 15:00:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230784#M6295</guid>
      <dc:creator>gsanchez</dc:creator>
      <dc:date>2013-05-09T15:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: About ports, variables and write/read operations</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230785#M6296</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;what if you write function (like decode/encode) to send commands through data bus. Something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint8_t write_lcd_data_bus(uint8_t command)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint32_t i;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* here you would encode command - each bit could be different pin on different port */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* you can achieve this with a loop for example, check each bit and set it accordingly */&lt;/P&gt;&lt;P&gt;&amp;nbsp; for (i = 0; i &amp;lt; 0x100; i &amp;lt;&amp;lt; 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* this would decode if bit is 0 or 1 and invoke set_pin function. set_pin function could have array of pointers to GPIO PDDR register to set directly HIGH or LOW (1 or 0) */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set_pin((command &amp;amp; i) ? 1 : 0, i); /* first parameter - 0 or 1, second is the pin which we want to set */&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; return 1;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is just high-level quick thinking. I believe there are many ways to make it work the desired way :smileywink:&amp;nbsp; Most probably, create your own code layer which will handle data bus for LCD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;c0170&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 May 2013 06:21:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230785#M6296</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2013-05-13T06:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: About ports, variables and write/read operations</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230786#M6297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Martin.&lt;/P&gt;&lt;P&gt;I was doing that. I asked before looking for a solution more "mqx-like", but I see that there is no solution like that. It's a shame that this problem could not been developed, I think that this is a very helpfull tip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;Kind regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2013 03:40:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/About-ports-variables-and-write-read-operations/m-p/230786#M6297</guid>
      <dc:creator>gsanchez</dc:creator>
      <dc:date>2013-05-14T03:40:10Z</dc:date>
    </item>
  </channel>
</rss>

