title: arm cortex m3 display
body: <p>hi i am working on arm controller lm3s8962 i m not able to understand the code below as per my understanding it is checking if the character is from the array or not, which he created using the ascii characters{i.e in the while loop :  while(*pcStr != 0) },
  i am not able to get what he is doing in the code    after the line "Build and display the character buffer"  plz can anyone explain this  </p>
  
  <pre><code>void
      RIT128x96x4StringDraw(const char *pcStr, unsigned long ulX,
                            unsigned long ulY, unsigned char ucLevel)
      {
          unsigned long ulIdx1, ulIdx2;
          unsigned char ucTemp;
  
          //
          // Check the arguments.
          //
          ASSERT(ulX &lt; 128);
          ASSERT((ulX &amp; 1) == 0);
          ASSERT(ulY &lt; 96);
          ASSERT(ucLevel &lt; 16);
  
          //
          // Setup a window starting at the specified column and row, ending
          // at the right edge of the display and 8 rows down (single character row).
          //
          g_pucBuffer[0] = 0x15;
          g_pucBuffer[1] = ulX / 2;
          g_pucBuffer[2] = 63;
          RITWriteCommand(g_pucBuffer, 3);
          g_pucBuffer[0] = 0x75;
          g_pucBuffer[1] = ulY;
          g_pucBuffer[2] = ulY + 7;
          RITWriteCommand(g_pucBuffer, 3);
          RITWriteCommand(g_pucRIT128x96x4VerticalInc,
                          sizeof(g_pucRIT128x96x4VerticalInc));
  
          //
          // Loop while there are more characters in the string.
          //
          while(*pcStr != 0)
          {
              //
              // Get a working copy of the current character and convert to an
              // index into the character bit-map array.
              //
              ucTemp = *pcStr++ &amp; 0x7f;
              if(ucTemp &lt; ' ')
              {
                  ucTemp = 0;
              }
              else
              {
                  ucTemp -= ' ';
              }
  
              //
              // Build and display the character buffer.
              //
              for(ulIdx1 = 0; ulIdx1 &lt; 6; ulIdx1 += 2)
              {
                  //
                  // Convert two columns of 1-bit font data into a single data
                  // byte column of 4-bit font data.
                  //
                  for(ulIdx2 = 0; ulIdx2 &lt; 8; ulIdx2++)
                  {
                      g_pucBuffer[ulIdx2] = 0;
                      if(g_pucFont[ucTemp][ulIdx1] &amp; (1 &lt;&lt; ulIdx2))
                      {
                          g_pucBuffer[ulIdx2] = (ucLevel &lt;&lt; 4) &amp; 0xf0;
                      }
                      if((ulIdx1 &lt; 4) &amp;&amp;
                         (g_pucFont[ucTemp][ulIdx1 + 1] &amp; (1 &lt;&lt; ulIdx2)))
                      {
                          g_pucBuffer[ulIdx2] |= (ucLevel &lt;&lt; 0) &amp; 0x0f;
                      }
                  }
  
                  //
                  // Send this byte column to the display.
                  //
                  RITWriteData(g_pucBuffer, 8);
                  ulX += 2;
  
                  //
                  // Return if the right side of the display has been reached.
                  //
                  if(ulX == 128)
                  {
                      return;
                  }
              }
          }
      }
  </code></pre>