<?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 Searching a UART Rinig_Buffer for a specific character in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586022#M21359</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dizgah on Mon Feb 29 01:11:46 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I initialed UART peripheral with Ring_Buffer, I need to searching in the&amp;nbsp; received data which are stored in the ring buffer ,When i pop an item it cleared from buffer which is not desired for me, i only need to move on the buffer and investigate characters without changing it's content,copying complete buffer is not desired too &amp;amp; data stream is coming in unregulated time.whats your suggestion?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WBR.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 20:25:08 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T20:25:08Z</dc:date>
    <item>
      <title>Searching a UART Rinig_Buffer for a specific character</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586022#M21359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dizgah on Mon Feb 29 01:11:46 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I initialed UART peripheral with Ring_Buffer, I need to searching in the&amp;nbsp; received data which are stored in the ring buffer ,When i pop an item it cleared from buffer which is not desired for me, i only need to move on the buffer and investigate characters without changing it's content,copying complete buffer is not desired too &amp;amp; data stream is coming in unregulated time.whats your suggestion?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WBR.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:25:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586022#M21359</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a UART Rinig_Buffer for a specific character</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586023#M21360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by miccio on Tue Mar 01 18:00:45 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi dizgah,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could deploy your own IRQ handler and perform the validation/check in there. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Just check what's inside the default LPCOpen handler function, dump its content in the IRQ, and check the content of each received byte before storing it into the buffer &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, remember to leave the TX part unchanged.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a starting point:&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;
void UART0_IRQHandler(void) {
// handles tx - same as default handler
if ((Chip_UART_GetStatus(_uart_ptr) &amp;amp; UART_STAT_TXRDY) != 0) {
Chip_UART_TXIntHandlerRB(_uart_ptr, &amp;amp;_txring);

if (RingBuffer_IsEmpty(&amp;amp;_txring)) {
Chip_UART_IntDisable(_uart_ptr, UART_INTEN_TXRDY);
}
}

// handles rx
while ((Chip_UART_GetStatus(_uart_ptr) &amp;amp; UART_STAT_RXRDY) != 0) {
uint8_t current_char = Chip_UART_ReadByte(_uart_ptr);
Chip_UART_IntDisable(_uart_ptr, UART_INTEN_RXRDY);
if(current_char == YOUR_CHAR) {
// do something 
} else {
// otherwise, store it in the ring buffer
RingBuffer_Insert(&amp;amp;_rxring, &amp;amp;current_char );
}
Chip_UART_IntEnable(_uart_ptr, UART_INTEN_RXRDY);
}
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:25:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586023#M21360</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a UART Rinig_Buffer for a specific character</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586024#M21361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dizgah on Sat Mar 05 01:06:05 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: miccio&lt;/STRONG&gt;&lt;BR /&gt;Hi dizgah,&lt;BR /&gt;&lt;BR /&gt;You could deploy your own IRQ handler and perform the validation/check in there. &lt;BR /&gt;Just check what's inside the default LPCOpen handler function, dump its content in the IRQ, and check the content of each received byte before storing it into the buffer &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;BR /&gt;However, remember to leave the TX part unchanged.&lt;BR /&gt;&lt;BR /&gt;Here's a starting point:&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;
void UART0_IRQHandler(void) {
// handles tx - same as default handler
if ((Chip_UART_GetStatus(_uart_ptr) &amp;amp; UART_STAT_TXRDY) != 0) {
Chip_UART_TXIntHandlerRB(_uart_ptr, &amp;amp;_txring);

if (RingBuffer_IsEmpty(&amp;amp;_txring)) {
Chip_UART_IntDisable(_uart_ptr, UART_INTEN_TXRDY);
}
}

// handles rx
while ((Chip_UART_GetStatus(_uart_ptr) &amp;amp; UART_STAT_RXRDY) != 0) {
uint8_t current_char = Chip_UART_ReadByte(_uart_ptr);
Chip_UART_IntDisable(_uart_ptr, UART_INTEN_RXRDY);
if(current_char == YOUR_CHAR) {
// do something 
} else {
// otherwise, store it in the ring buffer
RingBuffer_Insert(&amp;amp;_rxring, &amp;amp;current_char );
}
Chip_UART_IntEnable(_uart_ptr, UART_INTEN_RXRDY);
}
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ِDear miccio&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think this is a wise scenario to searching for my desired byte in IRQ handler (&amp;amp; then i can sore it's place on the buffer) but my problem is selective accessing to Ring_Buffer elements.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i need to access to each item &amp;amp; read it's content,Change,search,Replace,Copy&amp;amp;... it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As i know Ring_Buffer is a structure but when i want to acces to it's content with e.g. Ring_Buffer-&amp;gt;data compiler return error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WBR.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:25:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586024#M21361</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a UART Rinig_Buffer for a specific character</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586025#M21362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Sat Mar 05 02:35:09 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: dizgah&lt;/STRONG&gt;&lt;BR /&gt;As i know Ring_Buffer is a structure but when i want to acces to it's content with e.g. Ring_Buffer-&amp;gt;data compiler return error.&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; :quest: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The just use this structure...&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:25:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586025#M21362</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a UART Rinig_Buffer for a specific character</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586026#M21363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dizgah on Sat Mar 05 23:35:13 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: R2D2&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: dizgah&lt;/STRONG&gt;&lt;BR /&gt;As i know Ring_Buffer is a structure but when i want to acces to it's content with e.g. Ring_Buffer-&amp;gt;data compiler return error.&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt; :quest: &lt;BR /&gt;&lt;BR /&gt;The just use this structure...&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;excuse me ,but i don't understand your mind.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you mean external accessing to this structure is impossible?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you please explain more ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:25:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586026#M21363</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a UART Rinig_Buffer for a specific character</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586027#M21364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Sun Mar 06 00:13:26 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: dizgah&lt;/STRONG&gt;&lt;BR /&gt;Are you mean external accessing to this structure is impossible?&lt;BR /&gt;Can you please explain more ?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You are describing that there's a buffer structure and you want to access received data, right?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So where's the problem? Use this structure...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You are talking about compiler errors but not showing your code / project :~ &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:25:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586027#M21364</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a UART Rinig_Buffer for a specific character</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586028#M21365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dizgah on Sun Mar 06 22:11:54 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't have accessing to my code right now but as i remember ,it showed: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt; instruction is undefined!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;thank for your answers.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:25:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586028#M21365</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a UART Rinig_Buffer for a specific character</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586029#M21366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by miccio on Thu Mar 10 10:35:05 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;without seeing the code it's hard to say, especially with such cryptic and seemingly-random error. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please post some code, and we'll be able to help you out :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:25:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Searching-a-UART-Rinig-Buffer-for-a-specific-character/m-p/586029#M21366</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:25:13Z</dc:date>
    </item>
  </channel>
</rss>

