示例#1
0
int main(void)
{
  // initialize
  SystemInit();
  initialise_monitor_handles();
  init_systick();

  /* Initialize the accelerometers */
  init_accelerometers();

  /* Initialize the LCD and Touch modules */
  Delay(0x3FFFFF);
  LCD_Init();
  Delay(0x3FFFFF);
  touch_init();

  /* Clear the LCD, set text color to green and backlight to 100 */
  LCD_Clear(BLACK);
  LCD_SetTextColor(GREEN);
  LCD_SetBackColor(LCD_COLOR_BLACK);
  LCD_BackLight(100);

  /* Add update_game to the timed_task array */
  add_timed_task(update_game, 0.05);

  while(1)
  {
    /* Check if the timed task function has to be called */
    update();
  }
}
示例#2
0
/*
 * Reset and Initialize Display.
*/
void Init_LCD(void) {
    
    LCD_CtrlLinesConfig();
    Delay(3000);
    LCD_FSMCConfig();
    Delay(3000);
    TIM_Config();
    LCD_BackLight(100);
    
    LCD_WriteReg(0x0007,0x0021);    Delay(50);
    LCD_WriteReg(0x0000,0x0001);    Delay(50);
    LCD_WriteReg(0x0007,0x0023);    Delay(50);
    LCD_WriteReg(0x0010,0x0000);    Delay(90);
    LCD_WriteReg(0x0007,0x0033);    Delay(50);
    LCD_WriteReg(0x0011,0x6830);    Delay(50);
    LCD_WriteReg(0x0002,0x0600);    Delay(50);
    LCD_WriteReg(0x0012,0x6CEB);    Delay(50);
    LCD_WriteReg(0x0003,0xA8A4);    Delay(50);
    LCD_WriteReg(0x000C,0x0000);    Delay(50);
    LCD_WriteReg(0x000D,0x080C);    Delay(50);
    LCD_WriteReg(0x000E,0x2B00);    Delay(50);
    LCD_WriteReg(0x001E,0x00B0);    Delay(50);
    LCD_WriteReg(0x0001,0x2b3F);    Delay(50);  //RGB
    LCD_WriteReg(0x0005,0x0000);    Delay(50);
    LCD_WriteReg(0x0006,0x0000);    Delay(50);
    LCD_WriteReg(0x0016,0xEF1C);    Delay(50);
    LCD_WriteReg(0x0017,0x0103);    Delay(50);
    LCD_WriteReg(0x000B,0x0000);    Delay(50);
    LCD_WriteReg(0x000F,0x0000);    Delay(50);
    LCD_WriteReg(0x0041,0x0000);    Delay(50);
    LCD_WriteReg(0x0042,0x0000);    Delay(50);
    LCD_WriteReg(0x0048,0x0000);    Delay(50);
    LCD_WriteReg(0x0049,0x013F);    Delay(50);
    LCD_WriteReg(0x004A,0x0000);    Delay(50);
    LCD_WriteReg(0x004B,0x0000);    Delay(50);
    LCD_WriteReg(0x0044,0xEF00);    Delay(50);
    LCD_WriteReg(0x0045,0x0000);    Delay(50);
    LCD_WriteReg(0x0046,0x013F);    Delay(50);
    LCD_WriteReg(0x0030,0x0707);    Delay(50);
    LCD_WriteReg(0x0031,0x0204);    Delay(50);
    LCD_WriteReg(0x0032,0x0204);    Delay(50);
    LCD_WriteReg(0x0033,0x0502);    Delay(50);
    LCD_WriteReg(0x0034,0x0507);    Delay(50);
    LCD_WriteReg(0x0035,0x0204);    Delay(50);
    LCD_WriteReg(0x0036,0x0204);    Delay(50);
    LCD_WriteReg(0x0037,0x0502);    Delay(50);
    LCD_WriteReg(0x003A,0x0302);    Delay(50);
    LCD_WriteReg(0x002F,0x12BE);    Delay(50);
    LCD_WriteReg(0x003B,0x0302);    Delay(50);
    LCD_WriteReg(0x0023,0x0000);    Delay(50);
    LCD_WriteReg(0x0024,0x0000);    Delay(50);
    LCD_WriteReg(0x0025,0x8000);    Delay(50);
    LCD_WriteReg(0x004f,0x0000);    Delay(50);
    LCD_WriteReg(0x004e,0x0000);    Delay(50);
    
}