예제 #1
0
void lcd_init() {
    // 4-bit mode, 2 line display, etc.
    XIo_Out32(XPAR_LCD_0_BASEADDR, 0x2C);
    // Display on, no cursor
    lcd_display_ctrl(LCD_DISPLAY_ON);
    // Sensible default entry mode
    lcd_entry_mode(LCD_ENTRY_CURSOR_RIGHT);
    // Clear the screen
    lcd_clear();
}
예제 #2
0
/**
 * Initialize the LCD driver.
 * 
 * @param cur Cursor ON/OFF.
 * @param blk Blinking cursor ON/OFF.
 */
void lcd_init(bool cur, bool blk) {
	// Setup the pins and wait for the driver to stabilize.
	lcd_setup();
	delay_ms(45);

	// Initialization. For more information about this madness check page
	// 46 of the datasheet.
	lcd_init_function_set();
	delay_us(4500);
	lcd_init_function_set();
	delay_us(150);
	lcd_init_function_set();
	lcd_function_set();  // The last madness.

	lcd_display_control(TRUE, cur, blk);
	_lcd_clear();
	lcd_entry_mode();
}