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

HD44780 lcd driver via IO pins. More...

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

Macros

#define LCD_RS_1   LCD_RS_PORT |= _BV(LCD_RS_PIN)
 
#define LCD_RS_0   LCD_RS_PORT &= ~_BV(LCD_RS_PIN)
 
#define LCD_RW_1   LCD_RW_PORT |= _BV(LCD_RW_PIN)
 
#define LCD_RW_0   LCD_RW_PORT &= ~_BV(LCD_RW_PIN)
 
#define LCD_E_1   LCD_E_PORT |= _BV(LCD_E_PIN)
 
#define LCD_E_0   LCD_E_PORT &= ~_BV(LCD_E_PIN)
 
#define LCD_DELAY_US   2
 

Functions

void lcd_ddir (uint8_t out)
 
void lcd_dout (uint8_t data)
 
uint8_t lcd_din (void)
 
void lcd_out (uint8_t data, uint8_t rs)
 
uint8_t lcd_in (uint8_t rs)
 
uint8_t lcd_busy (void)
 
uint8_t lcd_available (void)
 
uint8_t lcd_wr (uint8_t d, uint8_t rs)
 
void lcd_bl (uint8_t on)
 
uint8_t lcd_hwinit (uint8_t p1)
 

Variables

const uint8_t lcd_busw = 0
 

Detailed Description

HD44780 lcd driver via IO pins.

HD44780 low level driver using AVR IO pins. Define pin mapping in hwdefs.h. If you define 8 data pins (LCD_D0 .. LCD_D7), 8 bit interface will be used. If you define 4 data pins (LCD_D4 .. LCD_D7), 4 bit interface will be used.

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

Variable Documentation

const uint8_t lcd_busw = 0

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