title: Understanding function written for STM32
body: <p>I'm new to embedded programming at all. I'm doing one example with others friends, so they have written some parts that I don't understand. In this example we have to program game 'space invaders' on led matrix 16x16</p>
  <pre><code>int setLED(int line, int column, enum command_e cmd)
  {
      return (line&lt;&lt;5)|(column&lt;&lt;2)|cmd;
  }
  </code></pre>
  <p>before that we defined in header:</p>
  <pre><code>enum command_e{
      LED_STAY = 0x00,
      LED_ON   = 0x01,
      LED_OFF  = 0x02,
      LED_TOGGLE = 0x03
  };
  </code></pre>
  <p>Any help would be welcomed.</p>
  <p>Thank you.</p>
  <p>EDIT: Here is use of this function in main.</p>
  <pre><code>void TIM2_IRQHandler(void){
  static int count = 1;
  static int line=0;
  static int column=0;
  panel_t send;
  send.led0 = 0;
  send.led1 = 0;
  send.led2 = 0;
  send.led3 = 0;
  
  if(count == 1)
      GPIOA-&gt;ODR = 1&lt;&lt;15;
  else if(count == 2){
      GPIOA-&gt;ODR = 0&lt;&lt;15;
      busyFlag = 0;
  } else if(count == 50){
      send.led0 = (field[line+8][column].counterMAX &gt; 0) ? setLED(line, column, LED_ON) : setLED(line, column, LED_OFF);
      send.led1 = (field[line][column].counterMAX &gt; 0) ? setLED(line, column, LED_ON) : setLED(line, column, LED_OFF);
      if(line != 0)
          send.led2 = (field[line][column+8].counterMAX &gt; 0) ? setLED(line, column, LED_ON) : setLED(line, column, LED_OFF);
      else{
          send.led2 = (leben &lt; (8 - column)) ? setLED(line, column, LED_OFF) : setLED(line, column, LED_ON);
      }
      
      send.led3 = (field[line+8][column+8].counterMAX &gt; 0) ? setLED(line, column, LED_ON) : setLED(line, column, LED_OFF);
      received = sendData(send); //received global variable to update field in main
      if(column &lt; 7){
          column++;
      }
      else{
          column=0;
          (line &lt; 7) ? (line++) : (line = 0);
      }
  }
  
  if(count == 120)
      count = 0;
  count++;
  
  TIM_ClearITPendingBit(TIM2, TIM_IT_Update);
  </code></pre>
  <p>}</p>