1 | /*
|
2 | * lcd.h
|
3 | *
|
4 | * Created: 12.11.2013 08:46:45
|
5 | * Author: Test1
|
6 | */
|
7 |
|
8 | #ifndef _LCD_H_
|
9 | #define _LCD_H_
|
10 | #define _LCD_H_
|
11 |
|
12 | #ifndef F_CPU
|
13 | #define F_CPU 16000000UL
|
14 | #endif
|
15 | //Prototypes
|
16 | extern void lcd_write (char,char);
|
17 | extern void shift_data_out (char);
|
18 | extern void lcd_init (void);
|
19 | extern void lcd_clear (void);
|
20 | extern void lcd_print_P (unsigned char,unsigned char,const char *Buffer,...);
|
21 | extern void lcd_print_str (char *Buffer);
|
22 | extern void enable(void);
|
23 | extern void Clock(void);
|
24 | void lcd_char(char ps, char cd);
|
25 |
|
26 |
|
27 | #define lcd_print(a,b,format, args...) lcd_print_P(a,b,PSTR(format) , ## args);
|
28 | volatile unsigned char back_light;
|
29 |
|
30 | //Anzahl der Zeilen 1,2 oder 4
|
31 | //#define ONE_LINES
|
32 | #define TWO_LINES
|
33 | //#define THREE_LINES
|
34 | //#define FOUR_LINES
|
35 |
|
36 |
|
37 | #define PORT_LCD_DATA_ENABLE PORTB
|
38 | #define DDR_LCD_DATA_ENABLE DDRB
|
39 | #define LCD_DATA_ENABLE 0
|
40 |
|
41 | #define PORT_LCD_CLOCK PORTB
|
42 | #define DDR_LCD_CLOCK DDRB
|
43 | #define LCD_CLOCK 2
|
44 |
|
45 | #define PORT_LCD_DATA PORTB
|
46 | #define DDR_LCD_DATA DDRB
|
47 | #define LCD_DATA 1
|
48 |
|
49 | #define BUSY_WAIT_US 1
|
50 |
|
51 | #define LCD_RS_PIN 0
|
52 | #define LCD_LIGHT_PIN 7
|
53 |
|
54 | #define NOP() asm("nop")
|
55 | #define WAIT(x) for (unsigned long count=0;count<x;count++){NOP();}
|
56 |
|
57 | #endif //_LCD_H_
|