Table of Contents

Graphic LCD

Related to: [HW] User Interface Module

This library contains functions to use the HomeLab graphical LCD. Although the LCD is capable of displaying graphical images, no such functions are implemented in the library. The LCD is used as a 14 x 6 character alphanumeric display.

Functions

  • void lcd_gfx_init(void)

Intializes LCD.

  • void lcd_gfx_backlight(bool set)

Switch LCD backlight on or off. Parameters:

  • set - true when backlight on, false when off.
  • void lcd_gfx_clear(void)

Clears a whole display.

  • void lcd_gfx_clear_line(unsigned char line)

Clears a single text line. Parameters:

  • line - Line number. 0 to 5.
  • void lcd_gfx_goto_char_xy(unsigned char x, unsigned char y)

Selects a position to write text to. Parameters:

  • x - X coordinate. 0 to 13.
  • y - Y coordinate. 0 to 5.
  • void lcd_gfx_write_char(char c)

Writes a character to the pre-defined position. Parameters:

  • c - ASCII character.
  • void lcd_gfx_write_string(char *s)

Writes a string to the display starting from the pre-defined position. Parameters:

  • s - Pointer to string (char array).

Example

Demonstration of using a graphical LCD.

#include <homelab/module/lcd_gfx.h>
 
int main(void)
{
	// LCD initialization.
	lcd_gfx_init();
 
	// Display clearing.
	lcd_gfx_clear();
 
	// Cursor to the middle of the screen.
	lcd_gfx_goto_char_xy(5, 2);
 
	// Displaying a text.
	lcd_gfx_write_string("Hello");
}
en/software/homelab/library/module/lcd_graphic.txt · Last modified: 2020/07/20 09:00 by 127.0.0.1
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0