lcd2s.h File Reference

Serial LCD Display handler. More...


Defines

#define kpadHasKeys(kpadNum)   (kpadBufPut[kpadNum] != kpadBufGet[kpadNum])
#define LCD2S_I2C_ADR   80ul

Functions

BYTE kpadGetKey (BYTE kpadNum)
void lcdInit (void)
BYTE lcdPutArray (BYTE lcdNum, BYTE *s, BYTE len)
void lcdPutByte (BYTE lcdNum, BYTE c)
void lcdPutByteHex (BYTE lcdNum, BYTE c)
BYTE lcdPutRomString (BYTE lcdNum, ROM char *s)
BYTE lcdPutString (BYTE lcdNum, BYTE *s)
void lcdService (void)

Variables

BYTE kpadBufGet [LCD2S_MAX_NUMBER]
BYTE kpadBufPut [LCD2S_MAX_NUMBER]


Detailed Description

Serial LCD Display handler.

Author:
Modtronix Engineering
Dependencies:
Compiler:
MPLAB C18 v2.10 or higher
HITECH PICC-18 V8.35PL3 or higher

Description

This module implements a driver for the LCD2S range of serial LCD Displays. To use this module:

Configuration

The following defines are used to configure this module, and should be placed in the projdefs.h (or similar) file. For details, see Project Configuration. To configure the module, the required defines should be uncommended, and the rest commented out.
 //*********************************************************************
 //-------------- Serint Configuration --------------------
 //*********************************************************************
 //Define the default I2C address for the LCD display
 #define LCD2S_DEFAULT_I2C_ADR (80ul)

 //Define the I2C address for the LCD display
 #define LCD2S_I2C_ADR LCD2S_DEFAULT_I2C_ADR

 //Define number of serial LCD displays supported
 #define LCD2S_MAX_NUMBER 1

 //Define size of keypad buffer for each serial LCD display, must be 8,16,32 or 64
 #define KPAD_BUF_SIZE  8ul

Define Documentation

#define kpadHasKeys ( kpadNum   )     (kpadBufPut[kpadNum] != kpadBufGet[kpadNum])

Are there any keys in the keypad buffer.

Returns:
1 if true, else 0

#define LCD2S_I2C_ADR   80ul


Function Documentation

BYTE kpadGetKey ( BYTE  kpadNum  ) 

Get the next key from the keypad buffer. Before calling this function, the kpadHasKeys() function should be called to check if there are any keys to be read from the keypad buffer.

Parameters:
kpadNum The number of the keypad you want to access. Is a number from 0-n. If, for example, the system is configured for 4 keypads, it is a number from 0-3.
Returns:
Returns next key code from the keypad buffer.

void lcdInit ( void   ) 

Called in the USART TX ISR

BYTE lcdPutArray ( BYTE  lcdNum,
BYTE s,
BYTE  len 
)

Writes given number of characters from given buffer to the LCD Display.

Parameters:
lcdNum The number of the LCD you want to access. Is a number from 0-n. If, for example, the system is configured for 4 LCDs, it is a number from 0-3.
s Buffer containing data to send to LCD Display
len Number of bytes to send from given buffer
Returns:
0 if OK, else error

void lcdPutByte ( BYTE  lcdNum,
BYTE  c 
)

Send the given byte to the LCD Display. It is appended to the current LCD display. The following bytes have special meanings:

  • 0x0a ('\n') = Go to beginning of next line.
  • 0x0c ('\f') = Clear display and go to beginning of first line.
  • 0x0d ('\r') = Go to beginning of first line
  • 0x08 ('\b') = Cursor left
  • 0x09 ('\t') = Cursor Right

Parameters:
lcdNum The number of the LCD you want to access. Is a number from 0-n. If, for example, the system is configured for 4 LCDs, it is a number from 0-3.
c Byte to write out on the serial port

void lcdPutByteHex ( BYTE  lcdNum,
BYTE  c 
)

Send the ASCII hex value of the given byte to the LCD Display. It is appended to the current LCD Display. For example, if c=11, then "0B" will be sent to the LCD Display

Parameters:
lcdNum The number of the LCD you want to access. Is a number from 0-n. If, for example, the system is configured for 4 LCDs, it is a number from 0-3.
c Byte to write out on the serial port

BYTE lcdPutRomString ( BYTE  lcdNum,
ROM char *  s 
)

Sends a NULL terminated string to the LCD Display. It is appended to the current LCD Display string. The NULL is NOT sent!

Parameters:
lcdNum The number of the LCD you want to access. Is a number from 0-n. If, for example, the system is configured for 4 LCDs, it is a number from 0-3.
s Null terminated string to write out to the LCD Display
Returns:
0 if OK, else error

BYTE lcdPutString ( BYTE  lcdNum,
BYTE s 
)

Sends a NULL terminated string to the LCD Display. It is appended to the current LCD Display string. The NULL is NOT sent!

Parameters:
lcdNum The number of the LCD you want to access. Is a number from 0-n. If, for example, the system is configured for 4 LCDs, it is a number from 0-3.
s Null terminated string to write out to the LCD Display
Returns:
0 if OK, else error

void lcdService ( void   ) 

Service this module


Variable Documentation

BYTE kpadBufGet[LCD2S_MAX_NUMBER]

BYTE kpadBufPut[LCD2S_MAX_NUMBER]


Generated on Wed Feb 3 12:45:34 2010 for SBC65EC Web Server by  doxygen 1.5.8