title: Glowing an LED using GPIO in craneboard
body: <p>I'd like to use GPIO to turn on an LED in a craneboard (ARM processor). I'm very new to embedded programming. But, I'm quite good at C. I referred in some websites and learnt about GPIO related commands. I wrote a code, but I'm not quite sure in how to integrate it to the u-boot coding of the craneboard. I don't know where to start. Kindly guide me.</p>
  
  <pre><code>#define LED1    (1 &lt;&lt; 6)
  
  int getPinState(int pinNumber);
  
  int main(void)
  {
  
    GPIO0_IODIR |= LED1;
  
    GPIO0_IOSET |= LED1;
  
    while (1)
    {
  
        GPIO0_IOCLR |= LED1;
  
    }
  }
  
  int getPinState(int pinNumber)
  {
  
    int pinBlockState = GPIO0_IOPIN;
  
    int pinState = (pinBlockState &amp; (1 &lt;&lt; pinNumber)) ? 1 : 0;
  
    return pinState;
  }
  </code></pre>