Home

Defines | Functions

dwengoLCD.h File Reference

LCD Display. More...

#include "dwengoBoard.h"
#include "dwengoDelay.h"

Defines

#define LCD_WIDTH   16
#define LCD_HEIGHT   2
#define LCD_LASTLINE   (LCD_HEIGHT - 1)
#define LCD_LASTPOS   (LCD_WIDTH - 1)
#define backlightOn()   (LCD_BACKLIGHT = 1)
 Enable LCD backlight.
#define backlightOff()   (LCD_BACKLIGHT = 0)
 Disable LCD backlight.
#define appendStringToLCD(message)   appendStringToLCD_((const FAR_ROM char*)(message))
 Write a string to the LCD display.

Functions

void initLCD (void)
 Initialize LCD display.
void clearLCD (void)
 Clears the LCD display.
void commandLCD (const BYTE commandData)
 Send command to LCD display.
void setCursorLCD (BYTE l, BYTE p)
 Set cursor to the desired position.
void appendCharToLCD (const char c)
 Write a character to the LCD display.
void printCharToLCD (const char c, BYTE l, BYTE p)
 Write character to a desired position.
void appendStringToLCD_ (const FAR_ROM char *message)
 Write a ROM string to the LCD display.
void printStringToLCD (char *message, BYTE l, BYTE p)
 Write a ROM string to a desired position on the LCD display.
void appendIntToLCD (int i)
 Write an integer to the LCD display.
void printIntToLCD (int i, BYTE l, BYTE p)
 Write an integer to a desired position on the LCD display.

Detailed Description

LCD Display.

Control of LCD display on the Dwengo board


Define Documentation

#define appendStringToLCD (   message)    appendStringToLCD_((const FAR_ROM char*)(message))

Write a string to the LCD display.

The string is written to the current cursor position of the LCD display, and the cursor is incremented.

Parameters:
messagethe NULL-terminated ASCII string to write
#define LCD_HEIGHT   2

Number of lines on the LCD

#define LCD_LASTLINE   (LCD_HEIGHT - 1)

Line number of the last line of the LCD

#define LCD_LASTPOS   (LCD_WIDTH - 1)

Column number of the last column of the LCD

#define LCD_WIDTH   16

Number of columns on the LCD


Function Documentation

void appendCharToLCD ( const char  c)

Write a character to the LCD display.

Character is written to the current cursor position of the LCD display, and the cursor is incremented. Line wrapping is automatic, assuming a line size of LCD_WIDTH characters.

This function assumes a 2-lines display

Parameters:
cthe ASCII character to write
void appendIntToLCD ( int  i)

Write an integer to the LCD display.

Converts an integer to an ASCII string and writes it to the current cursor position of the LCD display, incrementing the cursor.

Parameters:
ithe signed integer to write
void appendStringToLCD_ ( const FAR_ROM char *  message)

Write a ROM string to the LCD display.

The string is written to the current cursor position of the LCD display, and the cursor is incremented.

Parameters:
messagethe NULL-terminated ASCII string to write
void commandLCD ( const BYTE  commandData)

Send command to LCD display.

Also saves and restores the state of the LEDS, and waits for the command to be processed by the LCD.

Parameters:
commandDatathe command, see the datasheet of the HD45... controller for a list of possible commands
void initLCD ( void  )

Initialize LCD display.

Sets the display to use 8-bit interface, turns the blinking cursor off, ... TODO

Must be called when the LCD is connected, even when it is not in use, to avoid the display ""doing strange things with its pins""

void printCharToLCD ( const char  c,
BYTE  l,
BYTE  p 
)

Write character to a desired position.

Character is written to a position given by the the user.

Parameters:
cthe ASCII character to write
lcursor line can be 0 or 1
pcursor position between 0 and 15
void printIntToLCD ( int  i,
BYTE  l,
BYTE  p 
)

Write an integer to a desired position on the LCD display.

Converts an integer to an ASCII string and writes it to a user defined cursor position of the LCD display.

Parameters:
ithe signed integer to write
lcursor line can be 0 or 1
pcursor position between 0 and 15
void printStringToLCD ( char *  message,
BYTE  l,
BYTE  p 
)

Write a ROM string to a desired position on the LCD display.

The string is written to a desired position of the LCD display, and the cursor is incremented.

Parameters:
messagethe NULL-terminated ASCII string to write
lcursor line can be 0 or 1
pcursor position between 0 and 15
void setCursorLCD ( BYTE  l,
BYTE  p 
)

Set cursor to the desired position.

Set cursor to desired position. Append functions will start from this location.

Parameters:
lcursor line can be 0 or 1
pcursor position between 0 and 15
 All Data Structures Files Functions Variables Defines

Generated on Wed Dec 25 2013 23:03:08 for Dwengo library by doxygen 1.7.3