1 | /*
|
2 | * @name Definitions for MCU Clock Frequency
|
3 | * Adapt the MCU clock frequency in Hz to your target.
|
4 | */
|
5 | #define XTAL F_CPU /**< clock frequency in Hz, used to calculate delay timer */
|
6 |
|
7 | /*
|
8 | * @name Definition for LCD controller type
|
9 | * Use 0 for HD44780 controller, change to 1 for displays with KS0073 controller.
|
10 | */
|
11 | #define LCD_CONTROLLER_KS0073 0 /**< Use 0 for HD44780 controller, 1 for KS0073 controller */
|
12 |
|
13 | /*
|
14 | * @name Definitions for Display Size
|
15 | * Change these definitions to adapt setting to your display
|
16 | */
|
17 | #define LCD_LINES 4 /**< number of visible lines of the display */
|
18 | #define LCD_DISP_LENGTH 20 /**< visibles characters per line of the display */
|
19 | #define LCD_LINE_LENGTH 0x40 /**< internal line length of the display */
|
20 | #define LCD_START_LINE1 0x00 /**< DDRAM address of first char of line 1 */
|
21 | #define LCD_START_LINE2 0x40 /**< DDRAM address of first char of line 2 */
|
22 | #define LCD_START_LINE3 0x14 /**< DDRAM address of first char of line 3 */
|
23 | #define LCD_START_LINE4 0x54 /**< DDRAM address of first char of line 4 */
|
24 | #define LCD_WRAP_LINES 0 /**< 0: no wrap, 1: wrap at end of visibile line */
|
25 |
|
26 |
|
27 | #define LCD_IO_MODE 1 /**< 0: memory mapped mode, 1: IO port mode */
|
28 | #if LCD_IO_MODE
|
29 | /**
|
30 | * @name Definitions for 4-bit IO mode
|
31 | * Change LCD_PORT if you want to use a different port for the LCD pins.
|
32 | *
|
33 | * The four LCD data lines and the three control lines RS, RW, E can be on the
|
34 | * same port or on different ports.
|
35 | * Change LCD_RS_PORT, LCD_RW_PORT, LCD_E_PORT if you want the control lines on
|
36 | * different ports.
|
37 | *
|
38 | * Normally the four data lines should be mapped to bit 0..3 on one port, but it
|
39 | * is possible to connect these data lines in different order or even on different
|
40 | * ports by adapting the LCD_DATAx_PORT and LCD_DATAx_PIN definitions.
|
41 | *
|
42 | */
|
43 | #define LCD_PORT PORTC /**< port for the LCD lines */
|
44 | #define LCD_DATA0_PORT LCD_PORT /**< port for 4bit data bit 0 */
|
45 | #define LCD_DATA1_PORT LCD_PORT /**< port for 4bit data bit 1 */
|
46 | #define LCD_DATA2_PORT LCD_PORT /**< port for 4bit data bit 2 */
|
47 | #define LCD_DATA3_PORT LCD_PORT /**< port for 4bit data bit 3 */
|
48 | #define LCD_DATA0_PIN 0 /**< pin for 4bit data bit 0 */
|
49 | #define LCD_DATA1_PIN 1 /**< pin for 4bit data bit 1 */
|
50 | #define LCD_DATA2_PIN 2 /**< pin for 4bit data bit 2 */
|
51 | #define LCD_DATA3_PIN 3 /**< pin for 4bit data bit 3 */
|
52 | #define LCD_RS_PORT LCD_PORT /**< port for RS line */
|
53 | #define LCD_RS_PIN 4 /**< pin for RS line */
|
54 | #define LCD_RW_PORT LCD_PORT /**< port for RW line */
|
55 | #define LCD_RW_PIN 5 /**< pin for RW line */
|
56 | #define LCD_E_PORT LCD_PORT /**< port for Enable line */
|
57 | #define LCD_E_PIN 6 /**< pin for Enable line */
|