Parallel LCD library  0.5
Display driver for character LCD screens based on Hitachi HD44780 (or compatible) chipsets
Macros | Functions
lcdParallel.h File Reference

Display driver for character LCD screens based on Hitachi HD44780 (or compatible) chipsets, which are found in most text-based LCDs. The library works with either 4 or 8 data lines in addition to the rs, and enable lines. More...

Go to the source code of this file.

Macros

#define LCDP_CLEARDISPLAY   0x01
 
#define LCDP_RETURNHOME   0x02
 
#define LCDP_ENTRYMODESET   0x04
 
#define LCDP_DISPLAYCONTROL   0x08
 
#define LCDP_CURSORSHIFT   0x10
 
#define LCDP_FUNCTIONSET   0x20
 
#define LCDP_SETCGRAMADDR   0x40
 
#define LCDP_SETDDRAMADDR   0x80
 
#define LCDP_ENTRYRIGHT   0x00
 
#define LCDP_ENTRYLEFT   0x02
 
#define LCDP_ENTRYSHIFTINCREMENT   0x01
 
#define LCDP_ENTRYSHIFTDECREMENT   0x00
 
#define LCDP_DISPLAYON   0x04
 
#define LCDP_DISPLAYOFF   0x00
 
#define LCDP_CURSORON   0x02
 
#define LCDP_CURSOROFF   0x00
 
#define LCDP_BLINKON   0x01
 
#define LCDP_BLINKOFF   0x00
 
#define LCDP_DISPLAYMOVE   0x08
 
#define LCDP_CURSORMOVE   0x00
 
#define LCDP_MOVERIGHT   0x04
 
#define LCDP_MOVELEFT   0x00
 
#define LCDP_8BITMODE   0x10
 
#define LCDP_4BITMODE   0x00
 
#define LCDP_2LINE   0x08
 
#define LCDP_1LINE   0x00
 
#define LCDP_5x10DOTS   0x04
 
#define LCDP_5x8DOTS   0x00
 
#define LCDP_SEND_COMMAND   0x00
 
#define LCDP_SEND_WRITE   0x01
 

Functions

lcdParallel * lcdParallel_init (char cols, char lines, char dotsize, char rs, char enable, char d0, char d1, char d2, char d3)
 initialize a parallel character LCD display into 4-wire mode. More...
 
lcdParallel * lcdParallel_init8 (char cols, char lines, char dotsize, char rs, char enable, char d0, char d1, char d2, char d3, char d4, char d5, char d6, char d7)
 initialize a parallel character LCD display into 8-wire mode. More...
 
int lcdParallel_print (lcdParallel *device, const char *fmt,...)
 Print format "..." args to the display. The output is limited to 128 bytes. More...
 
void lcdParallel_writeChar (lcdParallel *device, char value)
 Send a single ASCII character to the display. More...
 
void lcdParallel_clear (lcdParallel *device)
 Clears the display. More...
 
void lcdParallel_home (lcdParallel *device)
 Sets the cursor to the Home (first column and first line) position. More...
 
void lcdParallel_noDisplay (lcdParallel *device)
 Turns the display off. More...
 
void lcdParallel_display (lcdParallel *device)
 Turns the display on. More...
 
void lcdParallel_noBlink (lcdParallel *device)
 Makes the cursor solid (no blinking). More...
 
void lcdParallel_blink (lcdParallel *device)
 Makes the cursor blink. More...
 
void lcdParallel_noCursor (lcdParallel *device)
 Turns the cursor off. More...
 
void lcdParallel_cursor (lcdParallel *device)
 Turns the cursor on. More...
 
void lcdParallel_scrollDisplayLeft (lcdParallel *device)
 Scrolls the text on the display to the left. More...
 
void lcdParallel_scrollDisplayRight (lcdParallel *device)
 Scrolls the text on the display to the right. More...
 
void lcdParallel_leftToRight (lcdParallel *device)
 Causes the display to add new charaters to the right of the previous ones. More...
 
void lcdParallel_rightToLeft (lcdParallel *device)
 Causes the display to add new charaters to the left of the previous ones. More...
 
void lcdParallel_autoscroll (lcdParallel *device)
 Causes the display 'right justify' text from the cursor. More...
 
void lcdParallel_noAutoscroll (lcdParallel *device)
 Causes the display 'left justify' text from the cursor. More...
 
void lcdParallel_createChar (lcdParallel *device, char loc, char charmap[])
 Create and store a custom character in the display's CGRAM memory. More...
 
void lcdParallel_setCursor (lcdParallel *device, char col, char row)
 Sets the cursor to the specified location on the disply's screen. More...
 
void lcdParallel_send (lcdParallel *device, char value, char mode)
 Low-level function used to transmit data to the display. More...
 
void lcdParallel_write (lcdParallel *device, char value, char bits)
 Low-level function used to transmit data to the display. More...
 

Detailed Description

Display driver for character LCD screens based on Hitachi HD44780 (or compatible) chipsets, which are found in most text-based LCDs. The library works with either 4 or 8 data lines in addition to the rs, and enable lines.

Author
Matthew Matz, Jeff Martin
Version
0.5

Function Documentation

◆ lcdParallel_autoscroll()

void lcdParallel_autoscroll ( lcdParallel *  device)

Causes the display 'right justify' text from the cursor.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.

◆ lcdParallel_blink()

void lcdParallel_blink ( lcdParallel *  device)

Makes the cursor blink.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.

◆ lcdParallel_clear()

void lcdParallel_clear ( lcdParallel *  device)

Clears the display.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.

◆ lcdParallel_createChar()

void lcdParallel_createChar ( lcdParallel *  device,
char  loc,
char  charmap[] 
)

Create and store a custom character in the display's CGRAM memory.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.
locMemory location (0-7) to store the custom character.
charmap[]map of the custom character's pixels.

◆ lcdParallel_cursor()

void lcdParallel_cursor ( lcdParallel *  device)

Turns the cursor on.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.

◆ lcdParallel_display()

void lcdParallel_display ( lcdParallel *  device)

Turns the display on.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.

◆ lcdParallel_home()

void lcdParallel_home ( lcdParallel *  device)

Sets the cursor to the Home (first column and first line) position.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.

◆ lcdParallel_init()

lcdParallel* lcdParallel_init ( char  cols,
char  lines,
char  dotsize,
char  rs,
char  enable,
char  d0,
char  d1,
char  d2,
char  d3 
)

initialize a parallel character LCD display into 4-wire mode.

Parameters
colsNumber of columns on the character display.
linesNumber of lines on the character display.
dotsizeNumber of pixels tall the characters are on the display.
Most displays are 8, a few displays have 10 pixel tall characters.
rsRegister Select pin connect to the display's RS pin.
enableEnable pin connect to the display's Enable pin.
d0Data pin 0 usually connected to the display's fifth data pin (for 4-wire mode).
d1Data pin 1 usually connected to the display's sixth data pin (for 4-wire mode).
d2Data pin 2 usually connected to the display's seventh data pin (for 4-wire mode).
d3Data pin 3 usually connected to the display's eigth data pin (for 4-wire mode).
Returns
lcdParallel device identifier for use with functions in the lcdParallel library.

◆ lcdParallel_init8()

lcdParallel* lcdParallel_init8 ( char  cols,
char  lines,
char  dotsize,
char  rs,
char  enable,
char  d0,
char  d1,
char  d2,
char  d3,
char  d4,
char  d5,
char  d6,
char  d7 
)

initialize a parallel character LCD display into 8-wire mode.

Parameters
colsNumber of columns on the character display.
linesNumber of lines on the character display.
dotsizeNumber of pixels tall the characters are on the display.
Most displays are 8, a few displays have 10 pixel tall characters.
rsRegister Select pin connect to the display's RS pin.
enableEnable pin connect to the display's Enable pin.
d0Data pin 0 usually connected to the display's first data pin (for 8-wire mode).
d1Data pin 1 usually connected to the display's second data pin (for 8-wire mode).
d2Data pin 2 usually connected to the display's third data pin (for 8-wire mode).
d3Data pin 3 usually connected to the display's fourth data pin (for 8-wire mode).
d4Data pin 4 usually connected to the display's fifth data pin (for 8-wire mode).
d5Data pin 5 usually connected to the display's sixth data pin (for 8-wire mode).
d6Data pin 6 usually connected to the display's seventh data pin (for 8-wire mode).
d7Data pin 7 usually connected to the display's eigth data pin (for 8-wire mode).
Returns
lcdParallel device identifier for use with functions in the lcdParallel library.

◆ lcdParallel_leftToRight()

void lcdParallel_leftToRight ( lcdParallel *  device)

Causes the display to add new charaters to the right of the previous ones.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.

◆ lcdParallel_noAutoscroll()

void lcdParallel_noAutoscroll ( lcdParallel *  device)

Causes the display 'left justify' text from the cursor.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.

◆ lcdParallel_noBlink()

void lcdParallel_noBlink ( lcdParallel *  device)

Makes the cursor solid (no blinking).

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.

◆ lcdParallel_noCursor()

void lcdParallel_noCursor ( lcdParallel *  device)

Turns the cursor off.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.

◆ lcdParallel_noDisplay()

void lcdParallel_noDisplay ( lcdParallel *  device)

Turns the display off.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.

◆ lcdParallel_print()

int lcdParallel_print ( lcdParallel *  device,
const char *  fmt,
  ... 
)

Print format "..." args to the display. The output is limited to 128 bytes.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.
*fmtString which may contain formatters to be printed to the display.

◆ lcdParallel_rightToLeft()

void lcdParallel_rightToLeft ( lcdParallel *  device)

Causes the display to add new charaters to the left of the previous ones.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.

◆ lcdParallel_scrollDisplayLeft()

void lcdParallel_scrollDisplayLeft ( lcdParallel *  device)

Scrolls the text on the display to the left.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.

◆ lcdParallel_scrollDisplayRight()

void lcdParallel_scrollDisplayRight ( lcdParallel *  device)

Scrolls the text on the display to the right.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.

◆ lcdParallel_send()

void lcdParallel_send ( lcdParallel *  device,
char  value,
char  mode 
)

Low-level function used to transmit data to the display.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.
valueByte to send to the display.
modedescibes whether the byte is a command or to be displayed.

◆ lcdParallel_setCursor()

void lcdParallel_setCursor ( lcdParallel *  device,
char  col,
char  row 
)

Sets the cursor to the specified location on the disply's screen.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.
colColumn for the cursor to go to.
rowLine for the cursor to go to.

◆ lcdParallel_write()

void lcdParallel_write ( lcdParallel *  device,
char  value,
char  bits 
)

Low-level function used to transmit data to the display.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.
valueByte to send to the display.
bitsdescibes whether the display is in 4- or 8-wire mode.

◆ lcdParallel_writeChar()

void lcdParallel_writeChar ( lcdParallel *  device,
char  value 
)

Send a single ASCII character to the display.

Parameters
*deviceDevice pointer returned by the lcdParallel_init or _init8 function.
valueCharacter to send to the display.