Table 1. required macros and their defaults
Macro Name | Description | Default |
---|---|---|
LCD_DELAY() | elapse the amount to time required to enable the LCD | NOP();NOP();NOP();NOP() |
LCD_E_PORT | the PORT with the enable pin | PORTE |
LCD_E_PIN | the enable pin | 6 |
LCD_DATA | the data port for the LCD | PORTL |
LCD_RS_PORT | the PORT with the register select | PORTE |
LCD_RS_PIN | the register select pin | 7 |
LCD_RW_PORT | the PORT with the read/write pin | PORTE |
LCD_RW_PIN | the read/write pin | 1 |
LCD_DATA_IN_CONTROL_OUT() | set the data direction for the data port to input and control pins to output | DDR(LCD_DATA,IIIIIIII) |
LCD_DATA_OUT_CONTROL_OUT() | set the data direction for the data port to output and the control pins to input | DDR(LCD_DATA,OOOOOOOO) |
LCD_READ_DATA() | read data from the LCD | LCD_DATA |
LCD_WRITE_DATA(BYTE) | write data to the LCD | LCD_DATA=BYTE |
LCD_BUSY_BIT | usually bit 7 in LCD_DATA | (LCD_READ_DATA()&0x80) |
LCD_BUSY_CHECK() | check if the lcd is ready to read or write | lcd_busy_check() |
LCD_CONTROL_DISABLE() | disable the LCD controller | LCD_E_PORT.LCD_E_PIN=LCD_E_PIN_DISABLE |
LCD_CONTROL_ENABLE() | enable the LCD controller | LCD_E_PORT.LCD_E_PIN=LCD_E_PIN_ENABLE |
LCD_CONTROL_CHAR_MODE() | put the LCD in character mode | LCD_RS_PORT.LCD_RS_PIN=LCD_RS_PIN_CHAR |
LCD_CONTROL_COMMAND_MODE() | put the LCD in command mode | LCD_RS_PORT.LCD_RS_PIN=LCD_RS_PIN_COMMAND |
LCD_CONTROL_SET_READ_MODE() | put the LCD in read mode | LCD_RW_PORT.LCD_RW_PIN=LCD_RW_PIN_READ |
LCD_CONTROL_SET_WRITE_MODE() | put the LCD in write mode | LCD_RW_PORT.LCD_RW_PIN=LCD_RW_PIN_WRITE |