include/lc7981.h File Reference

#include <avr/io.h>
#include <util/delay.h>
#include <avr/pgmspace.h>

Go to the source code of this file.

Defines

#define LC7981_H_   LC7981_H_
#define LCD_CTRL   PORTC
#define LCD_CRTL_DDR   DDRC
#define LCD_RS   PC4
#define LCD_RW   PC2
#define LCD_EN   PC0
#define LCD_DATA   PORTD
#define LCD_DATA_DDR   DDRD
#define lcd_rs_high()   (LCD_CTRL |= (1 << LCD_RS))
#define lcd_rs_low()   (LCD_CTRL &= ~(1 << LCD_RS))
#define lcd_rw_high()   (LCD_CTRL |= (1 << LCD_RW))
#define lcd_rw_low()   (LCD_CTRL &= ~(1 << LCD_RW))
#define lcd_en_high()   (LCD_CTRL |= (1 << LCD_EN))
#define lcd_en_low()   (LCD_CTRL &= ~(1 << LCD_EN))
#define LCD_TEXT   0
#define LCD_TEXT_LINES   10
#define LCD_TEXT_COLUMNS   26
#define LCD_GRAPHIC   1
#define LCD_GRAPHIC_WIDTH   160
#define LCD_GRAPHIC_HEIGHT   80
#define PIXEL_ON   1
#define PIXEL_OFF   0

Functions

void lcd_init (uint8_t mode)
 lcd_init set the to default values.
void lcd_clear ()
 Clears the display by setting the whole memory to 0.
void lcd_write_text (char *txt)
void lcd_gotoxy (uint8_t x, uint8_t y)
 Set the display cursor to a specific location.
void lcd_plot_pixel (uint8_t x, uint8_t y, uint8_t set)
 set or unset a pixel at the specified location
void lcd_plot_bitmap (uint8_t x, uint8_t y, const uint8_t *bitmap, uint8_t w, uint8_t h)
void lcd_strobe ()
 Generates the strobe signal for writing data.
void lcd_write_command (uint8_t cmd, uint8_t data)
 Writes a command and a data byte to the lcd.
uint8_t lcd_read_byte ()
 Reads a byte from the display memory.


Define Documentation

#define LC7981_H_   LC7981_H_

#define LCD_CRTL_DDR   DDRC

#define LCD_CTRL   PORTC

#define LCD_DATA   PORTD

#define LCD_DATA_DDR   DDRD

#define LCD_EN   PC0

 
#define lcd_en_high (  )     (LCD_CTRL |= (1 << LCD_EN))

 
#define lcd_en_low (  )     (LCD_CTRL &= ~(1 << LCD_EN))

#define LCD_GRAPHIC   1

#define LCD_GRAPHIC_HEIGHT   80

#define LCD_GRAPHIC_WIDTH   160

#define LCD_RS   PC4

 
#define lcd_rs_high (  )     (LCD_CTRL |= (1 << LCD_RS))

 
#define lcd_rs_low (  )     (LCD_CTRL &= ~(1 << LCD_RS))

#define LCD_RW   PC2

 
#define lcd_rw_high (  )     (LCD_CTRL |= (1 << LCD_RW))

 
#define lcd_rw_low (  )     (LCD_CTRL &= ~(1 << LCD_RW))

#define LCD_TEXT   0

#define LCD_TEXT_COLUMNS   26

#define LCD_TEXT_LINES   10

#define PIXEL_OFF   0

#define PIXEL_ON   1


Function Documentation

void lcd_clear (  )  [inline]

Clears the display by setting the whole memory to 0.

void lcd_gotoxy ( uint8_t  x,
uint8_t  y 
) [inline]

Set the display cursor to a specific location.

Right now this does only work in text mode, since there's no need for it now in graphics mode.
If the x and y values are to big, the function does nothing.

Parameters:
x the horizontal cursorposition (starts at 0)
y the vertical cursorposition (starts at 0)

void lcd_init ( uint8_t  mode  ) 

lcd_init set the to default values.

Parameters:
mode LCD_TEXT for text mode and LCD_GRAPHIC for graphic mode

void lcd_plot_bitmap ( uint8_t  x,
uint8_t  y,
const uint8_t *  bitmap,
uint8_t  w,
uint8_t  h 
)

void lcd_plot_pixel ( uint8_t  x,
uint8_t  y,
uint8_t  set 
)

set or unset a pixel at the specified location

Parameters:
x horizontal position of the pixel (starts at 0)
y horizontal position of the pixel (starts at 0)
set can be PIXEL_ON or PIXEL_OFF

uint8_t lcd_read_byte (  )  [inline]

Reads a byte from the display memory.

lcd_gotoxy can be used to set the location. Important : lcd_gotoxy doesn't work in graphics mode yet.

Returns:
the byte which has been read
See also:
lcd_gotoxy

void lcd_strobe (  )  [inline]

Generates the strobe signal for writing data.

This function is meant for internal usage only.

void lcd_write_command ( uint8_t  cmd,
uint8_t  data 
) [inline]

Writes a command and a data byte to the lcd.

Parameters:
cmd the command byte
data the data that is going to be written after the command

void lcd_write_text ( char *  txt  ) 


Generated on Sat May 16 13:46:33 2009 for glcd by  doxygen 1.5.5