AVR library
Macros | Functions | Variables
lcd.c File Reference

HD44780 LCD routines (high level) More...

#include <inttypes.h>
#include <avr/io.h>
#include <stdlib.h>
#include <string.h>
#include <util/delay.h>
#include <avr/pgmspace.h>
#include "swdefs.h"

Macros

#define lcd_cmd(par1)   lcd_wr(par1, 0)
 
#define lcd_data(par1)   lcd_wr(par1, 1)
 

Functions

uint8_t lcd_hwinit (uint8_t p1)
 
void lcd_out (uint8_t data, uint8_t rs)
 
uint8_t lcd_wr (uint8_t d, uint8_t rs)
 
void lcd_clear (void)
 Clear LCD.
 
uint8_t lcd_init (uint8_t p1)
 Init LCD.
 
void lcd_goto (uint8_t x, uint8_t y)
 Position LCD cursor. More...
 
void lcd_line (const uint8_t l)
 Position LCD cursor to the beginning of line y. More...
 
void lcd_putc (const char c)
 Write a char. More...
 

Variables

const uint8_t lcd_busw
 

Detailed Description

HD44780 LCD routines (high level)

This is the high level part of HD44780 control. Low level driver is implemented elsewhere.

Define LCD_WIDTH and LCD_HEIGHT in swdefs.h.

Define LCD_USE_FB in swdefs.h to use framebuffer. FB skips unnecessary LCD writes by keeping a copy of what's on the LCD in memory and comparing it with caller requested changes. Recommended.

All provided functions are wrapped in LCD_NEED_func defines to keep pgmspace usage low. Define required funcs in swdefs.h

Author
Matej Kogovsek (matej.nosp@m.@ham.nosp@m.radio.nosp@m..si)
Note
This file is part of mat-avr-lib

Function Documentation

void lcd_goto ( uint8_t  x,
uint8_t  y 
)

Position LCD cursor.

Parameters
[in]xcharacter (0 based)
[in]yline (0 based)
void lcd_line ( const uint8_t  l)

Position LCD cursor to the beginning of line y.

Parameters
[in]yline (1 based)
void lcd_putc ( const char  c)

Write a char.

Parameters
[in]ccharacter to write

Variable Documentation

const uint8_t lcd_busw

Extern variable defined by "driver" specifying used LCD bus width (0 = 4 bit, 0x10 = 8 bit)