LCD Library Configuration

Name

LCD Library Configuration -- definitions for the LCD routines

The LCD library is configured by defining macros.

Table 1. required macros and their defaults

Macro NameDescriptionDefault
LCD_DELAY()elapse the amount to time required to enable the LCDNOP();NOP();NOP();NOP()
LCD_E_PORTthe PORT with the enable pinPORTE
LCD_E_PINthe enable pin6
LCD_DATAthe data port for the LCDPORTL
LCD_RS_PORTthe PORT with the register selectPORTE
LCD_RS_PINthe register select pin7
LCD_RW_PORTthe PORT with the read/write pinPORTE
LCD_RW_PINthe read/write pin1
LCD_DATA_IN_CONTROL_OUT()set the data direction for the data port to input and control pins to outputDDR(LCD_DATA,IIIIIIII)
LCD_DATA_OUT_CONTROL_OUT()set the data direction for the data port to output and the control pins to inputDDR(LCD_DATA,OOOOOOOO)
LCD_READ_DATA()read data from the LCDLCD_DATA
LCD_WRITE_DATA(BYTE)write data to the LCDLCD_DATA=BYTE
LCD_BUSY_BITusually bit 7 in LCD_DATA(LCD_READ_DATA()&0x80)
LCD_BUSY_CHECK()check if the lcd is ready to read or writelcd_busy_check()
LCD_CONTROL_DISABLE()disable the LCD controllerLCD_E_PORT.LCD_E_PIN=LCD_E_PIN_DISABLE
LCD_CONTROL_ENABLE()enable the LCD controllerLCD_E_PORT.LCD_E_PIN=LCD_E_PIN_ENABLE
LCD_CONTROL_CHAR_MODE()put the LCD in character modeLCD_RS_PORT.LCD_RS_PIN=LCD_RS_PIN_CHAR
LCD_CONTROL_COMMAND_MODE()put the LCD in command modeLCD_RS_PORT.LCD_RS_PIN=LCD_RS_PIN_COMMAND
LCD_CONTROL_SET_READ_MODE()put the LCD in read modeLCD_RW_PORT.LCD_RW_PIN=LCD_RW_PIN_READ
LCD_CONTROL_SET_WRITE_MODE()put the LCD in write modeLCD_RW_PORT.LCD_RW_PIN=LCD_RW_PIN_WRITE

Description

lcd.h defines a number of important constants for LCD Software Commands.

If the above symbols are incorrect, they need to be defined.