src/modules/lcd.c File Reference

This is the library file for creating outputs on the LCD. More...

#include "sysconfig.h"
#include "lcd.h"
#include "spi.h"
#include <avr/pgmspace.h>

Defines

#define G_FONT_DEFAULT_7PX   font_standard_7px
#define CHAR_UNDEFINED   {0xFF, 0x81, 0x81, 0x81, 0xFF, 0xaa, 0xaa}

Functions

void init_lcd (void)
 font_standard_5px This is the Character translation table to display Characters with a height of 5 Pixels
void lcd_command (void)
 lcd_command This function tells the LCD (DOG-LM 128x64) that the next byte is a Commandbyte (This function only drives the "A0" Pin of the LCD to low)

void lcd_data (void)
 lcd_data This function tells the LCD (DOG-LM 128x64) that the next byte is a Databyte (This function only drives the "A0" Pin of the LCD to high)

void lcd_reset (uint8_t signal)
 lcd_reset This function is used to reset the LCD (used on startup) (Via signal the Resetpin of the LCD is driven to LOW/HIGH)

void lcd_set_start (uint8_t x, uint8_t y)
 lcd_set_start This function is used to set a "new" startpoint on the LCD (used to identify the position from which should be written)

uint8_t lcd_send_char (uint8_t x, uint8_t y, uint8_t px, uint8_t c)
 lcd_set_column This function is used to set a "new" startcolumn (x-Axis) on the LCD (used to identify the column from which we start writing then)

uint8_t lcd_send_bitmask (uint8_t x, uint8_t y, uint8_t c)
 lcd_send_bitmask This function is used to send only one Bitmask (i.e. '0b10101111')
uint8_t lcd_send_string (uint8_t x, uint8_t y, uint8_t px, char *string)
 lcd_send_string This function is used to send a String (i.e. 'hello world')
uint8_t mirror_byte (uint8_t value)
 mirror_byte This function is used to mirror a Byte (LSB -> MSB and so on) (This is used if the Display is physically used in 12:00 mode -
otherwise the Characters will be broken)

void lcd_clear (void)
 lcd_clear This function is used to clear the Display
void graphic_view (void)
 graphic_view This function is creates the default Display output in this Design

Variables

const uint8_t
font_standard_7px[96][7] 
PROGMEM
 font_standard_7px This is the Character translation table to display Characters with a height of 7 Pixels


Detailed Description

This is the library file for creating outputs on the LCD.

It contains all functions which are neccessary to create
an output on the Graphic LCD with the Controller C167/AVR90USB.

It is NOT controller specfic.


Define Documentation

#define CHAR_UNDEFINED   {0xFF, 0x81, 0x81, 0x81, 0xFF, 0xaa, 0xaa}

#define G_FONT_DEFAULT_7PX   font_standard_7px

Referenced by lcd_send_char().


Function Documentation

void graphic_view ( void   ) 

graphic_view This function is creates the default Display output in this Design

Parameters:
void 
Returns:
void

References lcd_clear(), lcd_send_char(), and lcd_send_string().

Referenced by main().

void init_lcd ( void   ) 

void lcd_clear ( void   ) 

lcd_clear This function is used to clear the Display

Parameters:
void 
Returns:
void

References DD_SPI_LCD_CS, lcd_data(), lcd_set_start(), and SPI_MasterTransmit().

Referenced by graphic_view().

void lcd_command ( void   ) 

lcd_command This function tells the LCD (DOG-LM 128x64) that the next byte is a Commandbyte (This function only drives the "A0" Pin of the LCD to low)

Parameters:
void 
Returns:
void

References LCD_COMMAND_PIN, and LCD_PORT.

Referenced by init_lcd(), and lcd_set_start().

void lcd_data ( void   ) 

lcd_data This function tells the LCD (DOG-LM 128x64) that the next byte is a Databyte (This function only drives the "A0" Pin of the LCD to high)

Parameters:
void 
Returns:
void

References LCD_COMMAND_PIN, and LCD_PORT.

Referenced by lcd_clear(), lcd_send_bitmask(), and lcd_send_char().

void lcd_reset ( uint8_t  signal  ) 

lcd_reset This function is used to reset the LCD (used on startup) (Via signal the Resetpin of the LCD is driven to LOW/HIGH)

Parameters:
signal The Resetlevel (LOW/HIGH) drives the Resetpin
Returns:
void

References LCD_PORT, LCD_RESET_PIN, and LOW.

Referenced by init_lcd().

uint8_t lcd_send_bitmask ( uint8_t  x,
uint8_t  y,
uint8_t  c 
)

lcd_send_bitmask This function is used to send only one Bitmask (i.e. '0b10101111')

Parameters:
x The Startpixel on the X-Axis
y The Startpixel on the Y-Axis
c The Byte we want to send (wites one column and 8(8Bit) lines)
Returns:
uint8_t The width of the written Bitmask (ever 1)

References DD_SPI_LCD_CS, lcd_data(), lcd_set_start(), mirror_byte(), and SPI_MasterTransmit().

Referenced by lcd_send_string().

uint8_t lcd_send_char ( uint8_t  x,
uint8_t  y,
uint8_t  px,
uint8_t  c 
)

lcd_set_column This function is used to set a "new" startcolumn (x-Axis) on the LCD (used to identify the column from which we start writing then)

Parameters:
x The Startpixel on the X-Axis
Returns:
void lcd_send_char This function is used to send a Character (i.e. 'a')
Parameters:
x The Startpixel on the X-Axis
y The Startpixel on the Y-Axis
px The height of the Character (5px or 7px - so 5 or 7)
c The Character (translated with the Character drwaing table on the top of the file)
Returns:
uint8_t The width of the Character (X-Axis)

References DD_SPI_LCD_CS, G_FONT_DEFAULT_7PX, lcd_data(), lcd_set_start(), mirror_byte(), and SPI_MasterTransmit().

Referenced by graphic_view(), and lcd_send_string().

uint8_t lcd_send_string ( uint8_t  x,
uint8_t  y,
uint8_t  px,
char *  string 
)

lcd_send_string This function is used to send a String (i.e. 'hello world')

Parameters:
x The Startpixel on the X-Axis
y The Startpixel on the Y-Axis
px The height of the strings characters (5px or 7px - so 5 or 7)
string The String (translated with the Character drawing table on the top of the file)
Returns:
uint8_t The endposition of the String (X-Axis)

References lcd_send_bitmask(), lcd_send_char(), and lcd_set_start().

Referenced by graphic_view(), and temperature().

void lcd_set_start ( uint8_t  x,
uint8_t  y 
)

lcd_set_start This function is used to set a "new" startpoint on the LCD (used to identify the position from which should be written)

Parameters:
x The Startpixel on the X-Axis
y The Startpixel on the Y-Axis
Returns:
void

References DD_SPI_LCD_CS, DISPLAY_COLUMN_LOWER_BIT, DISPLAY_COLUMN_UPPER_BIT, DISPLAY_START_LINE, lcd_command(), and SPI_MasterTransmit().

Referenced by lcd_clear(), lcd_send_bitmask(), lcd_send_char(), and lcd_send_string().

uint8_t mirror_byte ( uint8_t  value  ) 

mirror_byte This function is used to mirror a Byte (LSB -> MSB and so on) (This is used if the Display is physically used in 12:00 mode -
otherwise the Characters will be broken)

Parameters:
value The Byte we want to mirror
Returns:
uint8_t The mirrored Byte

Referenced by lcd_send_bitmask(), and lcd_send_char().


Variable Documentation

const uint8_t font_standard_7px [96][7] PROGMEM

font_standard_7px This is the Character translation table to display Characters with a height of 7 Pixels

Parameters:
void 
Returns:
void


Generated on Mon Jan 12 21:12:08 2009 for BlueTemp by  doxygen 1.5.8