/* Sends the initialisation sequence to the display controller.  */
void hx8347gInitDisplay(void)
/* Sends the initialisation sequence to the display controller.  */
void hx8347gInitDisplay(void)
{
  uint8_t i, a, d;
  LPC_GPIO->SET[HX8347G_DATA_PORT] &= ~HX8347G_DATA_MASK;
  SET_RD;
  SET_WR;
  SET_CS;
  SET_CD;
  CLR_RESET;
  delay(10);
  SET_RESET;
  delay(500);
  for (i = 0; i < sizeof(HX8347G_InitSequence) / 2; i++) 
  {
    a = HX8347G_InitSequence[i*2];
    d = HX8347G_InitSequence[i*2 + 1];
    if (a == HX8347G_INIT_DELAY)
    {
      hx8347gDelay(1000);
    } 
    else 
    {
      hx8347gWriteRegister(a, d);
    }
  }
}