-
Notifications
You must be signed in to change notification settings - Fork 9
/
LCD-PIC16.h
70 lines (60 loc) · 2.51 KB
/
LCD-PIC16.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* Driver for HD44780 Compatible LCD Modules
Copyright (C) 2014 Jesus Ruben Santa Anna Zamudio.
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/>.
Author website: http://www.geekfactory.mx
Author e-mail: ruben at geekfactory dot mx
*/
#ifndef LCD_PIC16_H
#define LCD_PIC16_H
/*-------------------------------------------------------------*/
/* Configuration for Control Signals */
/*-------------------------------------------------------------*/
#define LCD_PIN_RS PORTBbits.RB1
#define LCD_TRIS_RS TRISBbits.TRISB1
#define LCD_PIN_E PORTBbits.RB0
#define LCD_TRIS_E TRISBbits.TRISB0
// NOT NEEDED YET, CONNECT RW TO GROUND
//#define LCD_PIN_RW PORTBbits.RB2
//#define LCD_TRIS_RW TRISBbits.TRISB2
/*-------------------------------------------------------------*/
/* Configuration example: 4 bit mode */
/*-------------------------------------------------------------*/
#define LCD_TRIS_D4 TRISAbits.TRISA0
#define LCD_TRIS_D5 TRISAbits.TRISA1
#define LCD_TRIS_D6 TRISAbits.TRISA2
#define LCD_TRIS_D7 TRISAbits.TRISA3
#define LCD_PIN_D4 PORTAbits.RA0
#define LCD_PIN_D5 PORTAbits.RA1
#define LCD_PIN_D6 PORTAbits.RA2
#define LCD_PIN_D7 PORTAbits.RA3
/*-------------------------------------------------------------*/
/* Configuration example: 8 bit mode */
/*-------------------------------------------------------------*/
//#define LCD_TRIS_D0 TRISAbits.TRISA0
//#define LCD_TRIS_D1 TRISAbits.TRISA1
//#define LCD_TRIS_D2 TRISAbits.TRISA2
//#define LCD_TRIS_D3 TRISAbits.TRISA3
//#define LCD_TRIS_D4 TRISAbits.TRISA0
//#define LCD_TRIS_D5 TRISAbits.TRISA1
//#define LCD_TRIS_D6 TRISAbits.TRISA2
//#define LCD_TRIS_D7 TRISAbits.TRISA3
//#define LCD_PIN_D0 PORTAbits.RA0
//#define LCD_PIN_D1 PORTAbits.RA1
//#define LCD_PIN_D2 PORTAbits.RA2
//#define LCD_PIN_D3 PORTAbits.RA3
//#define LCD_PIN_D4 PORTAbits.RA4
//#define LCD_PIN_D5 PORTAbits.RA5
//#define LCD_PIN_D6 PORTAbits.RA6
//#define LCD_PIN_D7 PORTAbits.RA7
#define CONFIG_TIMING_MAIN_CLOCK 1000000
#endif
// End of Header file