Alphanumeric LCD

Related to: [HW] User Interface Module

This library contains functions to use the HomeLab alphanumeric LCD.

Data Types

  • lcd_alpha_mode
    LCD configuration enumeration data type. Options:
    • LCD_ALPHA_DISP_OFF - Display off.
    • LCD_ALPHA_DISP_ON - Display on with invisible cursor.
    • LCD_ALPHA_DISP_ON_CURSOR - Display on with cursor.
    • LCD_ALPHA_DISP_ON_CURSOR_BLINK - Display on with blinking cursor.

Functions

  • void lcd_alpha_init(lcd_alpha_mode disp_attr)

Initializes LCD. Parameters:

  • disp_attr - Display configuration.
  • void lcd_alpha_clear(void)

Clears the whole display. Cursor is moved to the beginning of the first line.

  • void lcd_alpha_clear_line(unsigned char line)

Clears a line on display. Cursor is moved to the beginning of cleared line. Parameters:

  • line - Line number. 0 or 1.
  • void lcd_alpha_home(void)

Moves cursor to the beginning of the first line.

  • void lcd_alpha_goto_xy(unsigned char x, unsigned char y)

Moves cursor to the desired position. Parameters.

  • x - X coordinate (column number). 0 to 15.
  • y - Y coordinate (line number). 0 to 1.
  • void lcd_alpha_write_char(char c)

Writes a character to the cursor position. Parameters:

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

Writes a string to the display starting from the position of the cursor. Parameters:

  • s - Pointer to string (char array).
  • void lcd_alpha_write_string_p(const char *progmem_s)

Writes a string from program memory to the display starting from the position of the cursor. Parameters

  • progmem_s - Pointer to string in program memory.

Example

Demonstration of how to use alphanumeric LCD to display text.

#include <homelab/module/lcd_alpha.h>
 
int main(void)
{
	// LCD initialization.
	lcd_alpha_init(LCD_ALPHA_DISP_ON);
 
	// Display clearing.
	lcd_alpha_clear();
 
	// Cursor to the beginning of second line.
	lcd_alpha_goto_xy(0, 1);	
 
	// Text displaying.
	lcd_alpha_write_string("Hello");
}
en/software/homelab/library/module/lcd_alphanumeric.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