4 * Copyright (C) 2013-06-10 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 * Machine depended flags
39 #if defined(__18F23K22) || defined(__18F24K22) || defined(__18F25K22) || defined(__18F26K22)
40 #define _I2C_IO_TWO_MSSPS
41 #define _PIO_HAS_THREE
44 #if defined(__18F23K20) || defined(__18F24K20) || defined(__18F25K20) || defined(__18F26K20)
45 #define _I2C_IO_ONE_MSSP
46 #define _PIO_HAS_THREE
49 #if defined(__18F43K20) || defined(__18F44K20) || defined(__18F45K20) || defined(__18F46K20)
50 #define _I2C_IO_ONE_MSSP
57 // If you use I2C-Type ACM1602, You should define, otherwise #undef.
63 * PORTA: RA2-RA5 : READ
67 * PORTB: RB4-RB5 : RESERVED
79 * In addition, usage of PARALLEL-LCD,You should use 40Pin(or greater) PIC.
80 * PORTD: RD0-RD7 : LCD DATA(DB0-DB7)
84 * RE3: VPP (ICSP Programing Voltage) / MCLR
87 #define TRIS_A_VAL 0b11111101
88 #define AN_A_VAL 0b00000001
89 #define TRIS_B_VAL 0b11111110
90 #define AN_B_VAL 0b00000000
91 #define TRIS_C_VAL_O 0b11000000 /* FOR I2C-WRITE */
92 #define TRIS_C_VAL_I 0b11011000 /* FOR I2C-WRITE */
93 #define AN_C_VAL 0b00000000
95 #define TRIS_D_VAL 0b00000000 /* FOR OUTPUT, LCD(Optional) */
96 #define TRIS_E_VAL 0b00000000 /* FOR OUTPUT, LCD(Optional), PSP=OFF */
133 unsigned char byte[3];
157 charcode_s3, // Reserve
161 * LCD Control: Default register values, You should re-define in iodef.h if you need.
163 #ifndef _LCDPORT_DATA
164 #define _LCDPORT_DATA PORTD
165 #define _LCDPORT_TRIS_DATA TRISD
166 #define _LCDPORT_LATCH_DATA LATD
169 #ifndef _LCDPORT_CONT
170 #define _LCDPORT_CONT PORTE
171 #define _LCDPORT_TRIS_CONT TRISE
172 #define _LCDPORT_CONT_RS _PORTE_RE0
173 #define _LCDPORT_CONT_RW _PORTE_RE1
174 #define _LCDPORT_CONT_EN _PORTE_RE2
175 #define _LCDPORT_CONT_LATCH LATE