Example #1
0
uint8_t S6B33BG_Init(uint8_t AddressSetupTime,uint8_t DataSetupTime) {

  GPIO_Configuration();
  FSMC_LCD_Init(AddressSetupTime,DataSetupTime);

  lcd_rst();

  wr_cmd(S6B33BG_STANDBY_MODE_OFF);
  DWT_Delay(20000);
  wr_cmd(S6B33BG_OSCILATION_MODE);
  wr_cmd(0x01);// OSC ON
  DWT_Delay(20000);
  wr_cmd(S6B33BG_DC_DC_AMP);
  wr_cmd(0x01);// DCDC1 ON
  DWT_Delay(20000);
  wr_cmd(S6B33BG_DC_DC_AMP);
  wr_cmd(0x09);// AMP ON
  DWT_Delay(20000);
  wr_cmd(S6B33BG_DC_DC_AMP);
  wr_cmd(0x0B);// DCDC2 ON
  DWT_Delay(20000);
  wr_cmd(S6B33BG_DC_DC_AMP);
  wr_cmd(0x0F);// DCDC3 ON
  DWT_Delay(20000);
  S6B33BG_OrientationMode(ORIENTATION_PORTRAIT);
  wr_cmd(S6B33BG_DC_DC_SELECT);
  wr_cmd(0x02);
  wr_cmd(S6B33BG_DC_DC_CLK_DIVISION);
  wr_cmd(0x08);
  wr_cmd(S6B33BG_TEMPERATURE_COMPENSATION);
  wr_cmd(0x02);
  wr_cmd(S6B33BG_CONTRAST_CTRL);
  wr_cmd(0x41);// Contrast
  S6B33BG_ColorMode(COLOR_16BIT);
  wr_cmd(S6B33BG_ROW_VECTOR_MODE);
  wr_cmd(0x0E);
  wr_cmd(S6B33BG_NBLOCK_INVERSION);
  wr_cmd(0xD0);
  wr_cmd(S6B33BG_DRIVING_MODE);
  wr_cmd(0x00);
  wr_cmd(S6B33BG_ENTRY_MODE);
  wr_cmd(0x80);// 8bit data bus
  wr_cmd(S6B33BG_RAM_SKIP_AREA);
  wr_cmd(0x00);
  wr_cmd(S6B33BG_SPECIFIED_DIPLAY_PATTERN);
  wr_cmd(0x00);
  wr_cmd(S6B33BG_PARTIAL_DISPLAY_MODE);
  wr_cmd(0x00);
  DWT_Delay(100000);
  wr_cmd(S6B33BG_DISPLAY_ON);

  return S6B33BG_OK;
}
Example #2
0
uint8_t NokiaN70_Init(uint8_t AddressSetupTime,uint8_t DataSetupTime) {

  GPIO_Configuration();
  FSMC_LCD_Init(AddressSetupTime,DataSetupTime);

  lcd_rst();

  wr_cmd(SLEEP_OUT);
  wr_cmd(DISPLAY_INVERSION_OFF);
  wr_cmd(IDLE_MODE_OFF);
  wr_cmd(NORMAL_DISPLAY_MODE_ON);
  DWT_Delay(125000);
  wr_cmd(DISPLAY_ON);

  return NokiaN70_OK;
}
Example #3
0
void init_lcd(void)
{
	u16 x, y;/*
	touch_counter = 0;
	touch_wr_index = 0;
	touch_rd_index = 0;*/

	init_lcd_spi();
	en_lcd();
	lcd_rst();

	post_cmd( 0x000, 0x0001 ); /* oschilliation start */
	bcm2835_delay( 10 );
	/* Power settings */  	
	post_cmd( 0x100, 0x0000 ); /*power supply setup*/	
	post_cmd( 0x101, 0x0000 ); 
	post_cmd( 0x102, 0x3110 ); 
	post_cmd( 0x103, 0xe200 ); 
	post_cmd( 0x110, 0x009d ); 
	post_cmd( 0x111, 0x0022 ); 
	post_cmd( 0x100, 0x0120 ); 
	bcm2835_delay( 20 );

	post_cmd( 0x100, 0x3120 );
	bcm2835_delay( 80 );
	/* Display control */   
	post_cmd( 0x001, 0x0100 );
	post_cmd( 0x002, 0x0000 );
	post_cmd( 0x003, 0x1230 );
	post_cmd( 0x006, 0x0000 );
	post_cmd( 0x007, 0x0101 );
	post_cmd( 0x008, 0x0808 );
	post_cmd( 0x009, 0x0000 );
	post_cmd( 0x00b, 0x0000 );
	post_cmd( 0x00c, 0x0000 );
	post_cmd( 0x00d, 0x0018 );
	/* LTPS control settings */   
	post_cmd( 0x012, 0x0000 );
	post_cmd( 0x013, 0x0000 );
	post_cmd( 0x018, 0x0000 );
	post_cmd( 0x019, 0x0000 );

	post_cmd( 0x203, 0x0000 );
	post_cmd( 0x204, 0x0000 );

	post_cmd( 0x210, 0x0000 );
	post_cmd( 0x211, 0x00ef );
	post_cmd( 0x212, 0x0000 );
	post_cmd( 0x213, 0x013f );
	post_cmd( 0x214, 0x0000 );
	post_cmd( 0x215, 0x0000 );
	post_cmd( 0x216, 0x0000 );
	post_cmd( 0x217, 0x0000 );

	// Gray scale settings
	post_cmd( 0x300, 0x5343);
	post_cmd( 0x301, 0x1021);
	post_cmd( 0x302, 0x0003);
	post_cmd( 0x303, 0x0011);
	post_cmd( 0x304, 0x050a);
	post_cmd( 0x305, 0x4342);
	post_cmd( 0x306, 0x1100);
	post_cmd( 0x307, 0x0003);
	post_cmd( 0x308, 0x1201);
	post_cmd( 0x309, 0x050a);

	/* RAM access settings */ 
	post_cmd( 0x400, 0x4027 );
	post_cmd( 0x401, 0x0000 );
	post_cmd( 0x402, 0x0000 );	/* First screen drive position (1) */   	
	post_cmd( 0x403, 0x013f );	/* First screen drive position (2) */   	
	post_cmd( 0x404, 0x0000 );

	post_cmd( 0x200, 0x0000 );
	post_cmd( 0x201, 0x0000 );
	
	post_cmd( 0x100, 0x7120 );
	post_cmd( 0x007, 0x0103 );
	bcm2835_delay( 10 );
	post_cmd( 0x007, 0x0113 );

	dis_lcd();
}