// Send a command to the LCD in 4-bit or 8-bit mode. void xtl_lcd_hd44780_send_cmd(unsigned char cmd) { lcd_data_write(cmd & 0xff); lcd_delay_ms(1); xtl_lcd_hd44780_set_rs(0); // set LCD to CMD mode lcd_delay_ms(1); xtl_lcd_hd44780_set_rw(0); // set LCD to CMD mode lcd_delay_ms(1); xtl_lcd_hd44780_strobe(); // toggle E for LCD }
// Display loeschen void lcd_cls(void) { lcd_load_byte(0x01); lcd_send_cmd(); // lcd_write(0x02,0); // B 0000 0010 => Display loeschen lcd_delay_ms(2); // dauert eine Weile, Wert ausprobiert // lcd_write(0x01,0); // B 0000 0001 => Cursor Home lcd_load_byte(0x02); lcd_send_cmd(); lcd_delay_ms(2); // dauert eine Weile, Wert ausprobiert }
void lcd_putc( UINT8 u ) { xtl_lcd_hd44780_wait_ready(); lcd_data_write(u & 0xff); lcd_delay_ms(1); xtl_lcd_hd44780_set_rs(1); // set LCD to DATA mode xtl_lcd_hd44780_set_rw(0); // set LCD to DATA mode lcd_delay_ms(1); xtl_lcd_hd44780_strobe(); // toggle E for LCD }
void xtl_lcd_hd44780_clear(void) { // Display clear xtl_lcd_hd44780_wait_ready(); xtl_lcd_hd44780_send_cmd(CLR_DISP); lcd_delay_ms(10); }
// Linie Loeschen void lcd_clr_line(uint8_t Linie) { lcd_gotoxy(0,Linie); uint8_t i=0; for (i=0; i<LCD_DISP_LENGTH; i++) { lcd_putc(' '); } lcd_gotoxy(0,Linie); lcd_delay_ms(2); } // Linie Loeschen
// Initialize LCD in 4-bit mode. void lcd_reset( void ) { // Output pins low and as output (except last pin). // If R/W is configured, this sets R/W to 0, i.e. write mode. lcd_enable(0); xtl_lcd_hd44780_set_rw(0); xtl_lcd_hd44780_set_rs(0); // Wait at least 15ms for the LCD to initialise. lcd_delay_ms(15); // Reset as per p. 211 of HD44780 user guide. // Function set (8-bit data, two line mode, 5x7 dots). lcd_data_write(0x30); xtl_lcd_hd44780_strobe(); lcd_delay_ms(10); // Need at least 4.1ms according to the guide. xtl_lcd_hd44780_strobe(); lcd_delay_ms(2); // Need at least 100us according to the guide. xtl_lcd_hd44780_strobe(); lcd_delay_ms(2); // Don't use BF here either. // Function set (8-bit data, two line mode, 5x7 dots). xtl_lcd_hd44780_send_cmd(0x38); lcd_delay_ms(6); // Display off xtl_lcd_hd44780_send_cmd(DISP_OFF); lcd_delay_ms(5); // Display clear xtl_lcd_hd44780_send_cmd(CLR_DISP); lcd_delay_ms(10); // Entry mode, increasing cursor position. xtl_lcd_hd44780_send_cmd(ENTRY_INC); // Display on. xtl_lcd_hd44780_wait_ready(); xtl_lcd_hd44780_send_cmd(DISP_ON); }
void xtl_lcd_hd44780_wait_ready(void) { lcd_delay_ms(2); }
.mirror = MIRROR_NONE, .yminus16 = 1, .interval = 20, }; #else ...... #endif u16 table_init[50][2]= { //======backup ok need good======== lcd_spi_write_command(0x055f), lcd_delay_ms(5), lcd_spi_write_command(0x051f), lcd_delay_ms(10), lcd_spi_write_command(0x055f), lcd_delay_ms(50), lcd_spi_write_command(0x2b01), lcd_spi_write_command(0x000b), //vcom ac lcd_spi_write_command(0x019f), //vcom dc lcd_spi_write_command(0x040b), lcd_spi_write_command(0x1604), lcd_spi_write_command(0x0614), lcd_spi_write_command(0x0745), /*