2015-09-29 06:48:09 +00:00
|
|
|
/**
|
|
|
|
* (C) Copyright Collin J. Doering 2015
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2015-10-15 05:23:11 +00:00
|
|
|
* @file lcdLib.h
|
|
|
|
* @author Collin J. Doering <collin.doering@rekahsoft.ca>
|
|
|
|
* @date Sep 29, 2015
|
|
|
|
* @brief Functions to initialize, and operate a character LCD.
|
2015-09-29 06:48:09 +00:00
|
|
|
*/
|
|
|
|
|
2015-10-26 08:49:19 +00:00
|
|
|
#ifndef LCD_LIB_H
|
|
|
|
#define LCD_LIB_H
|
2015-10-05 01:20:51 +00:00
|
|
|
|
2015-10-26 08:49:19 +00:00
|
|
|
// Includes -----------------------------------------------------------------------------------
|
|
|
|
#include "lcd_instr.h"
|
2015-10-05 02:43:02 +00:00
|
|
|
#include "lcdLibConfig.h"
|
2015-09-29 06:48:09 +00:00
|
|
|
|
2015-10-26 08:49:19 +00:00
|
|
|
//---------------------------------------------------------------------------------------------
|
|
|
|
// Library function declarations
|
2015-09-29 06:48:09 +00:00
|
|
|
|
2015-10-15 05:23:11 +00:00
|
|
|
/**
|
2015-10-26 08:49:19 +00:00
|
|
|
Initialize the LCD display via software initialization as specified by the datasheet.
|
|
|
|
*/
|
|
|
|
void initLCD(void);
|
2015-09-29 06:48:09 +00:00
|
|
|
|
2015-10-15 05:23:11 +00:00
|
|
|
/**
|
2015-10-09 06:59:21 +00:00
|
|
|
Writes a character to the LCD display at the current cursor position after the LCD display is
|
2015-10-15 04:26:46 +00:00
|
|
|
ready for new data. Allows the following ASCII escapes: '\n', '\r', '\f' and '\b'; ignores
|
|
|
|
ASCII escape '\a'.
|
2015-10-09 06:59:21 +00:00
|
|
|
*/
|
2015-10-01 07:04:33 +00:00
|
|
|
void writeCharToLCD(char);
|
2015-09-29 06:48:09 +00:00
|
|
|
|
2015-10-15 05:23:11 +00:00
|
|
|
/**
|
2015-10-09 06:59:21 +00:00
|
|
|
Writes a string to the LCD starting from the current cursor position.
|
|
|
|
*/
|
2015-10-20 09:21:03 +00:00
|
|
|
void writeStringToLCD(char*);
|
2015-09-29 10:06:37 +00:00
|
|
|
|
2015-10-26 08:49:19 +00:00
|
|
|
//---------------------------------------------------------------------------------------------
|
|
|
|
// LCD command functions (all have associated ANSI escape)
|
2015-10-19 09:04:53 +00:00
|
|
|
|
2015-10-15 05:23:11 +00:00
|
|
|
/**
|
2015-10-09 06:59:21 +00:00
|
|
|
Clears the display and positions the cursor in the top left of the LCD screen.
|
|
|
|
*/
|
2015-09-30 08:46:49 +00:00
|
|
|
void clearDisplay(void);
|
|
|
|
|
2015-10-15 05:23:11 +00:00
|
|
|
/**
|
2015-10-09 06:59:21 +00:00
|
|
|
Brings the cursor the the top left of the LCD screen.
|
|
|
|
*/
|
2015-09-30 08:46:49 +00:00
|
|
|
void returnHome(void);
|
2015-09-29 10:06:37 +00:00
|
|
|
|
2015-10-19 09:04:53 +00:00
|
|
|
/**
|
2015-10-26 08:49:19 +00:00
|
|
|
Gets the current row and column of the LCD cursor and sets given pointers row and column to
|
|
|
|
their respective values. Note indexes start at 1.
|
2015-10-19 09:04:53 +00:00
|
|
|
*/
|
|
|
|
void getCursorPosition(uint8_t* row, uint8_t* column);
|
|
|
|
|
|
|
|
/**
|
2015-10-26 08:49:19 +00:00
|
|
|
Using the given parameters row and column, sets the current row and column occupied by the LCD
|
|
|
|
cursor. Note indexes start at 1.
|
2015-10-19 09:04:53 +00:00
|
|
|
*/
|
|
|
|
void setCursorPosition(uint8_t row, uint8_t column);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Moves the cursor n positions up. If the cursor is at the edge of the screen this has no effect.
|
|
|
|
*/
|
|
|
|
void moveCursorUp(uint8_t n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Moves the cursor n positions down. If the cursor is at the edge of the screen this has no effect.
|
|
|
|
*/
|
|
|
|
void moveCursorDown(uint8_t n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Moves the cursor n positions forward. If the cursor is at the edge of the screen this has no effect.
|
|
|
|
*/
|
|
|
|
void moveCursorForward(uint8_t n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Moves the cursor n positions backwards. If the cursor is at the edge of the screen this has no effect.
|
|
|
|
*/
|
|
|
|
void moveCursorBackward(uint8_t n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Moves the cursor to the beginning of the line n lines down.
|
|
|
|
*/
|
|
|
|
void moveCursorNextLine(uint8_t n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Moves the cursor to the beginning of the line n lines up.
|
|
|
|
*/
|
|
|
|
void moveCursorPreviousLine(uint8_t n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Moves the cursor to column n. If n is off screen go to the last line.
|
|
|
|
*/
|
|
|
|
void moveCursorToColumn(uint8_t n);
|
|
|
|
|
Add boiler plate code for remaining ANSI escapes
Added function declarations and empty/implementation incomplete
definitions in lcdLib.h and lcdLib.c respectively for remaining ANSI
escape sequences; namely:
- scrollUp
- scrollDown
- eraseDisplay
- eraseInline
Prematurely edited the parsing of any ASCII escape which causes the
screen to be cleared (Eg. '\n' on the last line), to use the new (but
yet to be implemented) scrolling functions; thus after these functions have been
filled in and tested, the ANSI escape support will be complete.
Additionally, escapes that are not supported are passed over without
printing any characters. The two cases that are handled in this commit
are DSR and SGR. The parsing for DSR which when received, normally
prints the current location of the cursor to standard output in the form
"\e[n;mR", where n is the row and m is the column, is left unsupported
but may be supported in the future (thus comments have been left
indicating condition where a valid parse occurs).
The SGR ANSI escape sequence can vary in length and thus needs to be
completely consumed from the input before processing the next character.
This is taken care of correctly in this commit, and has been tested.
In a previous commit, forgot to add the declarations of the following
utility functions to the lcdLib.h header file:
- blinkCursorOff
- blinkCursorOn
- displayOff
- displayOn
There are still a few functions that will be needed for reading
data from the LCD that have not been declared/defined. These functions
are required for efficiently scrolling the screen up and down. They also
will be needed to finish the last remaining piece of this library which,
after completion of ANSI escapes and associated functions, leaves
support for custom characters. Namely writing characters to CGRAM and
displaying custom characters (from CGRAM) using ASCII codes 0-7 (or 0-3
if 5x10 font is used).
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-10-25 04:27:51 +00:00
|
|
|
/**
|
|
|
|
Scroll whole page up by n lines. New lines are added at the bottom.
|
|
|
|
*/
|
|
|
|
void scrollUp(uint8_t n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Scroll whole page down by n lines. New lines are added at the top.
|
|
|
|
*/
|
|
|
|
void scrollDown(uint8_t n);
|
|
|
|
|
2015-10-26 08:49:19 +00:00
|
|
|
/**
|
|
|
|
Saves the cursors current position.
|
|
|
|
*/
|
|
|
|
void saveCursorPosition(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Restores the last saved cursor position.
|
|
|
|
*/
|
|
|
|
void restoreCursorPosition(void);
|
|
|
|
|
Add boiler plate code for remaining ANSI escapes
Added function declarations and empty/implementation incomplete
definitions in lcdLib.h and lcdLib.c respectively for remaining ANSI
escape sequences; namely:
- scrollUp
- scrollDown
- eraseDisplay
- eraseInline
Prematurely edited the parsing of any ASCII escape which causes the
screen to be cleared (Eg. '\n' on the last line), to use the new (but
yet to be implemented) scrolling functions; thus after these functions have been
filled in and tested, the ANSI escape support will be complete.
Additionally, escapes that are not supported are passed over without
printing any characters. The two cases that are handled in this commit
are DSR and SGR. The parsing for DSR which when received, normally
prints the current location of the cursor to standard output in the form
"\e[n;mR", where n is the row and m is the column, is left unsupported
but may be supported in the future (thus comments have been left
indicating condition where a valid parse occurs).
The SGR ANSI escape sequence can vary in length and thus needs to be
completely consumed from the input before processing the next character.
This is taken care of correctly in this commit, and has been tested.
In a previous commit, forgot to add the declarations of the following
utility functions to the lcdLib.h header file:
- blinkCursorOff
- blinkCursorOn
- displayOff
- displayOn
There are still a few functions that will be needed for reading
data from the LCD that have not been declared/defined. These functions
are required for efficiently scrolling the screen up and down. They also
will be needed to finish the last remaining piece of this library which,
after completion of ANSI escapes and associated functions, leaves
support for custom characters. Namely writing characters to CGRAM and
displaying custom characters (from CGRAM) using ASCII codes 0-7 (or 0-3
if 5x10 font is used).
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-10-25 04:27:51 +00:00
|
|
|
/**
|
|
|
|
Clears part or all of screen dependent on the value of n:
|
|
|
|
0 or missing: clear from cursor to end of screen
|
|
|
|
1: clear from cursor to end of screen
|
|
|
|
2: clear entire screen
|
|
|
|
*/
|
|
|
|
void eraseDisplay(uint8_t n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Erases part of a line dependent on the value of n:
|
|
|
|
0 or missing: clear from cursor to end of the line
|
|
|
|
1: clear from cursor to beginning of the line
|
|
|
|
2: clear entire line
|
|
|
|
*/
|
|
|
|
void eraseInline(uint8_t n);
|
|
|
|
|
2015-10-24 07:45:32 +00:00
|
|
|
/**
|
|
|
|
Hides the cursor
|
|
|
|
*/
|
|
|
|
void hideCursor(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Shows the cursor
|
|
|
|
*/
|
|
|
|
void showCursor(void);
|
|
|
|
|
2015-10-26 08:49:19 +00:00
|
|
|
//---------------------------------------------------------------------------------------------
|
|
|
|
// Utility functions (with no associated ASCII or ANSI escape)
|
2015-10-19 09:04:53 +00:00
|
|
|
|
Add boiler plate code for remaining ANSI escapes
Added function declarations and empty/implementation incomplete
definitions in lcdLib.h and lcdLib.c respectively for remaining ANSI
escape sequences; namely:
- scrollUp
- scrollDown
- eraseDisplay
- eraseInline
Prematurely edited the parsing of any ASCII escape which causes the
screen to be cleared (Eg. '\n' on the last line), to use the new (but
yet to be implemented) scrolling functions; thus after these functions have been
filled in and tested, the ANSI escape support will be complete.
Additionally, escapes that are not supported are passed over without
printing any characters. The two cases that are handled in this commit
are DSR and SGR. The parsing for DSR which when received, normally
prints the current location of the cursor to standard output in the form
"\e[n;mR", where n is the row and m is the column, is left unsupported
but may be supported in the future (thus comments have been left
indicating condition where a valid parse occurs).
The SGR ANSI escape sequence can vary in length and thus needs to be
completely consumed from the input before processing the next character.
This is taken care of correctly in this commit, and has been tested.
In a previous commit, forgot to add the declarations of the following
utility functions to the lcdLib.h header file:
- blinkCursorOff
- blinkCursorOn
- displayOff
- displayOn
There are still a few functions that will be needed for reading
data from the LCD that have not been declared/defined. These functions
are required for efficiently scrolling the screen up and down. They also
will be needed to finish the last remaining piece of this library which,
after completion of ANSI escapes and associated functions, leaves
support for custom characters. Namely writing characters to CGRAM and
displaying custom characters (from CGRAM) using ASCII codes 0-7 (or 0-3
if 5x10 font is used).
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-10-25 04:27:51 +00:00
|
|
|
/**
|
|
|
|
Turns the cursor blink off.
|
|
|
|
*/
|
|
|
|
void blinkCursorOff(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Turns the cursor blink on.
|
|
|
|
*/
|
|
|
|
void blinkCursorOn(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Turns the display off.
|
|
|
|
*/
|
|
|
|
void displayOff(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Turns the display on.
|
|
|
|
*/
|
|
|
|
void displayOn(void);
|
|
|
|
|
2015-10-26 08:49:19 +00:00
|
|
|
//---------------------------------------------------------------------------------------------
|
Add boiler plate code for remaining ANSI escapes
Added function declarations and empty/implementation incomplete
definitions in lcdLib.h and lcdLib.c respectively for remaining ANSI
escape sequences; namely:
- scrollUp
- scrollDown
- eraseDisplay
- eraseInline
Prematurely edited the parsing of any ASCII escape which causes the
screen to be cleared (Eg. '\n' on the last line), to use the new (but
yet to be implemented) scrolling functions; thus after these functions have been
filled in and tested, the ANSI escape support will be complete.
Additionally, escapes that are not supported are passed over without
printing any characters. The two cases that are handled in this commit
are DSR and SGR. The parsing for DSR which when received, normally
prints the current location of the cursor to standard output in the form
"\e[n;mR", where n is the row and m is the column, is left unsupported
but may be supported in the future (thus comments have been left
indicating condition where a valid parse occurs).
The SGR ANSI escape sequence can vary in length and thus needs to be
completely consumed from the input before processing the next character.
This is taken care of correctly in this commit, and has been tested.
In a previous commit, forgot to add the declarations of the following
utility functions to the lcdLib.h header file:
- blinkCursorOff
- blinkCursorOn
- displayOff
- displayOn
There are still a few functions that will be needed for reading
data from the LCD that have not been declared/defined. These functions
are required for efficiently scrolling the screen up and down. They also
will be needed to finish the last remaining piece of this library which,
after completion of ANSI escapes and associated functions, leaves
support for custom characters. Namely writing characters to CGRAM and
displaying custom characters (from CGRAM) using ASCII codes 0-7 (or 0-3
if 5x10 font is used).
Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-10-25 04:27:51 +00:00
|
|
|
|
2015-10-28 08:30:40 +00:00
|
|
|
/**
|
|
|
|
Read a single character from the row and column given (1 based) returning the cursor to
|
|
|
|
its previous original position.
|
2015-10-09 06:59:21 +00:00
|
|
|
*/
|
2015-10-28 08:30:40 +00:00
|
|
|
char readCharFromLCD(uint8_t row, uint8_t column);
|
2015-09-29 06:48:09 +00:00
|
|
|
|
2015-10-28 08:30:40 +00:00
|
|
|
/**
|
|
|
|
Read a line i (ones based) into str.
|
|
|
|
*/
|
|
|
|
void readLCDLine(uint8_t i, char* str);
|
2015-10-19 09:04:53 +00:00
|
|
|
|
2015-10-26 08:49:19 +00:00
|
|
|
//---------------------------------------------------------------------------------------------
|
|
|
|
// Advanced functions for special cases
|
2015-09-29 06:48:09 +00:00
|
|
|
|
2015-10-28 08:30:40 +00:00
|
|
|
/**
|
|
|
|
Read len characters from (from_row, from_column) to (to_row, to_column) returning the cursor
|
|
|
|
to its original position after the read. Upon success (not overflowing the screen), 0 is
|
|
|
|
returned; otherwise non zero will be returned. The str pointer will be updated with the
|
|
|
|
characters read from the screen. Even in the case of failure, str may be partially populated.
|
|
|
|
*/
|
|
|
|
void readCharsFromLCD(uint8_t from_row, uint8_t from_column, uint8_t to_row, uint8_t to_column, char* str, uint8_t len);
|
|
|
|
|
2015-10-15 05:23:11 +00:00
|
|
|
/**
|
2015-10-09 06:59:21 +00:00
|
|
|
Initialize the LCD display via its internal reset circuit.
|
|
|
|
|
|
|
|
Note: this is not the recommended way to initialize the LCD as it is unreliable and depends
|
|
|
|
on the power supply. Preferably the software initialization method should be used (via
|
|
|
|
the initLCD function).
|
|
|
|
*/
|
2015-09-29 10:06:37 +00:00
|
|
|
void initLCDByInternalReset(void);
|
2015-09-29 06:48:09 +00:00
|
|
|
|
2015-10-05 09:03:26 +00:00
|
|
|
|
2015-10-26 08:49:19 +00:00
|
|
|
//---------------------------------------------------------------------------------------------
|
|
|
|
// Mode and settings sanity check (preprocessor tests of lcdLibConfig.h)
|
|
|
|
//---------------------------------------------------------------------------------------------
|
2015-10-05 09:03:26 +00:00
|
|
|
|
2015-10-26 08:49:19 +00:00
|
|
|
#if !defined(LCD_CHARACTERS_PER_LINE)
|
|
|
|
#error "All modes require LCD_CHARACTERS_PER_LINE to be defined."
|
|
|
|
#elif !defined(LCD_NUMBER_OF_LINES)
|
|
|
|
#error "All modes require LCD_NUMBER_OF_LINES to be defined."
|
|
|
|
#elif !defined(LCD_LINE_BEGINNINGS)
|
|
|
|
#error "All modes require LCD_LINE_BEGINNINGS to be defined."
|
|
|
|
#else
|
2015-10-27 05:02:02 +00:00
|
|
|
|
|
|
|
#if LCD_NUMBER_OF_LINES == 1
|
|
|
|
#define LCD_LINES 0
|
|
|
|
#else
|
|
|
|
#define LCD_LINES (1 << INSTR_FUNC_SET_N)
|
|
|
|
#endif
|
|
|
|
|
2015-10-26 08:49:19 +00:00
|
|
|
#define LCD_CHARACTERS_PER_SCREEN (LCD_CHARACTERS_PER_LINE * LCD_NUMBER_OF_LINES)
|
|
|
|
#endif
|
|
|
|
|
2015-10-27 02:30:44 +00:00
|
|
|
#if !defined(LCD_FONT_5x8) &&\
|
|
|
|
!defined(LCD_FONT_5x10)
|
|
|
|
#error "All modes require LCD_FONT_5x8 or LCD_FONT_5x10 to be defined."
|
|
|
|
#elif defined(LCD_FONT_5x8) && \
|
|
|
|
defined(LCD_FONT_5x10)
|
|
|
|
#error "LCD_FONT_5x8 and LCD_FONT_5x10 are mutually exclusive. Choose one."
|
|
|
|
#elif defined(LCD_FONT_5x8)
|
|
|
|
#define LCD_FONT 0
|
|
|
|
#elif defined(LCD_FONT_5x10)
|
|
|
|
#define LCD_FONT (1 << INSTR_FUNC_SET_F)
|
|
|
|
#endif
|
|
|
|
|
2015-10-26 08:49:19 +00:00
|
|
|
#if !defined (LCD_RS) || \
|
|
|
|
!defined (LCD_RS_PORT) || \
|
|
|
|
!defined (LCD_RS_DDR) || \
|
|
|
|
!defined (LCD_RW) || \
|
|
|
|
!defined (LCD_RW_PORT) || \
|
|
|
|
!defined (LCD_RW_DDR) || \
|
|
|
|
!defined (LCD_ENABLE) || \
|
|
|
|
!defined (LCD_ENABLE_PORT) || \
|
|
|
|
!defined (LCD_ENABLE_DDR)
|
2015-10-05 09:03:26 +00:00
|
|
|
#error "All modes require LCD_RS[,_PORT,_DDR], LCD_RW[,_PORT,_DDR], and LCD_ENABLE[,_PORT,_DDR] be defined."
|
|
|
|
#endif
|
|
|
|
|
2015-10-26 08:49:19 +00:00
|
|
|
#if defined (EIGHT_BIT_ARBITRARY_PIN_MODE) && \
|
|
|
|
defined (FOUR_BIT_MODE)
|
2015-10-05 09:03:26 +00:00
|
|
|
#error "EIGHT_BIT_ARBITRARY_PIN_MODE and FOUR_BIT_MODE are mutually exclusive. Choose one."
|
2015-10-26 08:49:19 +00:00
|
|
|
#elif defined (EIGHT_BIT_ARBITRARY_PIN_MODE) || \
|
|
|
|
defined (FOUR_BIT_MODE)
|
2015-10-05 09:03:26 +00:00
|
|
|
|
|
|
|
// EIGHT_BIT_ARBITRARY_PIN_MODE specific requirements
|
|
|
|
#ifdef EIGHT_BIT_ARBITRARY_PIN_MODE
|
2015-10-26 08:49:19 +00:00
|
|
|
#if !defined (LCD_DBUS0) || \
|
|
|
|
!defined (LCD_DBUS0_PORT) || \
|
|
|
|
!defined (LCD_DBUS0_DDR) || \
|
|
|
|
!defined (LCD_DBUS0_PIN) || \
|
|
|
|
!defined (LCD_DBUS1) || \
|
|
|
|
!defined (LCD_DBUS1_PORT) || \
|
|
|
|
!defined (LCD_DBUS1_DDR) || \
|
|
|
|
!defined (LCD_DBUS1_PIN) || \
|
|
|
|
!defined (LCD_DBUS2) || \
|
|
|
|
!defined (LCD_DBUS2_PORT) || \
|
|
|
|
!defined (LCD_DBUS2_DDR) || \
|
|
|
|
!defined (LCD_DBUS2_PIN) || \
|
|
|
|
!defined (LCD_DBUS3) || \
|
|
|
|
!defined (LCD_DBUS3_PORT) || \
|
|
|
|
!defined (LCD_DBUS3_DDR) || \
|
|
|
|
!defined (LCD_DBUS3_PIN)
|
2015-10-05 09:03:26 +00:00
|
|
|
#error "EIGHT_BIT_ARBITRARY_PIN_MODE require that LCD_DBUS*[,_PORT,_DDR,_PIN] be defined."
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Requirements for EIGHT_BIT_ARBITRARY_PIN_MODE and FOUR_BIT_MODE
|
2015-10-26 08:49:19 +00:00
|
|
|
#if !defined (LCD_DBUS4) || \
|
|
|
|
!defined (LCD_DBUS4_PORT) || \
|
|
|
|
!defined (LCD_DBUS4_DDR) || \
|
|
|
|
!defined (LCD_DBUS4_PIN) || \
|
|
|
|
!defined (LCD_DBUS5) || \
|
|
|
|
!defined (LCD_DBUS5_PORT) || \
|
|
|
|
!defined (LCD_DBUS5_DDR) || \
|
|
|
|
!defined (LCD_DBUS5_PIN) || \
|
|
|
|
!defined (LCD_DBUS6) || \
|
|
|
|
!defined (LCD_DBUS6_PORT) || \
|
|
|
|
!defined (LCD_DBUS6_DDR) || \
|
|
|
|
!defined (LCD_DBUS6_PIN) || \
|
|
|
|
!defined (LCD_DBUS7) || \
|
|
|
|
!defined (LCD_DBUS7_PORT) || \
|
|
|
|
!defined (LCD_DBUS7_DDR) || \
|
|
|
|
!defined (LCD_DBUS7_PIN)
|
2015-10-05 09:03:26 +00:00
|
|
|
#error "Both EIGHT_BIT_ARBITRARY_PIN_MODE and FOUR_BIT_MODE require that LCD_DBUS*[,_PORT,_DDR,_PIN] be defined."
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Set LCD_BF automatically for both EIGHT_BIT_ARBITRARY_PIN_MODE and FOUR_BIT_MODE
|
|
|
|
#undef LCD_BF
|
|
|
|
#define LCD_BF LCD_DBUS7
|
|
|
|
|
|
|
|
#else
|
2015-10-26 08:49:19 +00:00
|
|
|
#if !defined (LCD_DBUS_PORT) || \
|
|
|
|
!defined (LCD_DBUS_DDR) || \
|
|
|
|
!defined (LCD_DBUS_PIN) || \
|
|
|
|
!defined (LCD_BF)
|
2015-10-05 09:03:26 +00:00
|
|
|
#error "Default mode requires that LCD_DBUS_[PORT,DDR,PIN] and LCD_BF be defined."
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#undef LCD_DBUS7_PORT
|
|
|
|
#define LCD_DBUS7_PORT LCD_DBUS_PORT
|
|
|
|
#undef LCD_DBUS7_DDR
|
|
|
|
#define LCD_DBUS7_DDR LCD_DBUS_DDR
|
|
|
|
#undef LCD_DBUS7_PIN
|
|
|
|
#define LCD_DBUS7_PIN LCD_DBUS_PIN
|
|
|
|
#endif
|
2015-10-26 08:49:19 +00:00
|
|
|
|
|
|
|
#endif /* LCD_LIB_H */
|