3 * I/O Port defines / LCD.
4 * Copyright (C) 2013-08-22 K.Ohta <whatisthis.sowhat ai gmail.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2,
10 * or (at your option) any later version.
11 * This library / program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this library; see the file COPYING. If not, write to the
18 * Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
21 * As a special exception, if you link this(includeed from sdcc) library
22 * with other files, some of which are compiled with SDCC,
23 * to produce an executable, this library does not by itself cause
24 * the resulting executable to be covered by the GNU General Public License.
25 * This exception does not however invalidate any other reasons why
26 * the executable file might be covered by the GNU General Public License.
37 #define _LCD_BACKLIGHT LATC
38 #define _LCD_BACKLIGHT_BIT b1
39 #define _LCD_BACKLIGHT_TRIS TRISC
41 //#define _LCD_BACKLIGHT _PORTC_RC2_MASK
44 #define _LCD_PORT LATC
47 * LCD Control: Default register values, You should re-define in iodef.h if you need.
52 * 4bit Interface, Used Below:
59 #define _LCDPORT_DATA PORTD
60 #define _LCDPORT_TRIS_DATA TRISD
61 #define _LCDPORT_LATCH_DATA LATD
62 #define _LCDPORT_BUSYMASK 0b10000000
63 #define _LCDPORT_READMASK TRIS_D_RVAL
64 #define _LCDPORT_DATA_SHIFT 4
68 #define _LCDPORT_CONT PORTD
69 #define _LCDPORT_TRIS_CONT TRISD
70 #define _LCDPORT_CONT_LATCH LATD
71 #define _LCDPORT_CONT_RSbit b0
72 #define _LCDPORT_CONT_RWbit b1
73 #define _LCDPORT_CONT_ENbit b2
74 #define _LCDPORT_CONT_BLbit b3
75 #define _LCDPORT_CONT_RS LATDbits.LATD0
76 #define _LCDPORT_CONT_RW LATDbits.LATD1
77 #define _LCDPORT_CONT_EN LATDbits.LATD2
82 * 8bit Interface, Used Below:
86 * PORTD: RD0-RD7: DATA(0-7).
90 #define _LCDPORT_DATA PORTD
91 #define _LCDPORT_TRIS_DATA TRISD
92 #define _LCDPORT_LATCH_DATA LATD
93 #define _LCDPORT_BUSYMASK 0b10000000
94 #define _LCDPORT_READMASK TRIS_D_RVAL
98 #define _LCDPORT_CONT PORTE
99 #define _LCDPORT_TRIS_CONT TRISE
100 #define _LCDPORT_CONT_RSbit 0
101 #define _LCDPORT_CONT_RWbit 1
102 #define _LCDPORT_CONT_ENbit 2
103 #define _LCDPORT_CONT_RS _PORTE_RE0
104 #define _LCDPORT_CONT_RW _PORTE_RE1
105 #define _LCDPORT_CONT_EN _PORTE_RE2
106 #define _LCDPORT_CONT_LATCH LATE
115 #endif /* IODEF_LCD_H */