<?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中的主题 Re: to concatenate uint8_t variables</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/to-concatenate-uint8-t-variables/m-p/524917#M7553</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jmf75 on Thu Jan 10 14:14:46 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You mean something like that&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;uint16_t locsh_Val= *((uint16_t*)data);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Second method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; typedef union _t_MyUnion&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; uint16_t Data16;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; uint8_t&amp;nbsp; Data[2];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; } t_MyUnion;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; t_MyUnion loc_Union;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; loc_Union.Data[0]=0xAA;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; loc_Union.Data[1]=0x55;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; uint16_t locsh_Val=loc_Union.Data16;&amp;nbsp;&amp;nbsp; //locsh_Val == 0x55AA&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 16:51:35 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T16:51:35Z</dc:date>
    <item>
      <title>to concatenate uint8_t variables</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/to-concatenate-uint8-t-variables/m-p/524916#M7552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by nasib on Thu Jan 10 11:39:43 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi all!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the lpcxpresso 11u14 and i'm trying to concatenet two uint8_t, in order to create an uint16_t. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have these two variables in an array: (data[0] = uint8_t) (data[1] = uint8_t). Actually i want to convert "data" in an uint16_t.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone knows how could i do it ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you very much!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:51:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/to-concatenate-uint8-t-variables/m-p/524916#M7552</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: to concatenate uint8_t variables</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/to-concatenate-uint8-t-variables/m-p/524917#M7553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jmf75 on Thu Jan 10 14:14:46 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You mean something like that&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;uint16_t locsh_Val= *((uint16_t*)data);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Second method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; typedef union _t_MyUnion&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; uint16_t Data16;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; uint8_t&amp;nbsp; Data[2];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; } t_MyUnion;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; t_MyUnion loc_Union;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; loc_Union.Data[0]=0xAA;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; loc_Union.Data[1]=0x55;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; uint16_t locsh_Val=loc_Union.Data16;&amp;nbsp;&amp;nbsp; //locsh_Val == 0x55AA&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:51:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/to-concatenate-uint8-t-variables/m-p/524917#M7553</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:51:35Z</dc:date>
    </item>
  </channel>
</rss>

