lcd.h


1
/*------------------------------------------------------------------------------
2
 Copyright:      Radig Ulrich  mailto: mail@ulrichradig.de
3
 Author:         Radig Ulrich
4
 Remarks:        
5
 known Problems: none
6
 Version:        22.11.2007
7
 Description:    Programm zur Ansteuerung eines Standart LCD
8
         (HD44870),(SED1278F) und kompatible
9
------------------------------------------------------------------------------*/
10
11
#ifndef _LCD_H_
12
  #define _LCD_H_
13
  
14
  //Prototypes
15
  extern void lcd_write (char,char);
16
  extern void shift_data_out (char);
17
  extern void lcd_init (void);
18
  extern void lcd_clear (void);
19
  extern void lcd_print_P (unsigned char,unsigned char,const char *Buffer,...);
20
  extern void lcd_print_str (char *Buffer);
21
  
22
  #define lcd_print(a,b,format, args...)  lcd_print_P(a,b,PSTR(format) , ## args)
23
  
24
  extern volatile unsigned char back_light;
25
  
26
  //Anzahl der Zeilen 1,2 oder 4
27
  //#define ONE_LINES          
28
  #define TWO_LINES          
29
  //#define THREE_LINES          
30
  //#define FOUR_LINES          
31
  #define LCD_DDR          DDRB
32
  #define PORT_LCD_DATA_ENABLE  PORTB
33
  #define DDR_LCD_DATA_ENABLE    DDRB
34
  #define LCD_DATA_ENABLE      0
35
  
36
  #define PORT_LCD_CLOCK      PORTB
37
  #define DDR_LCD_CLOCK      DDRB
38
  #define LCD_CLOCK        2
39
  
40
  #define PORT_LCD_DATA      PORTB
41
  #define DDR_LCD_DATA      DDRB
42
  #define LCD_DATA        1
43
  
44
  #define BUSY_WAIT        7
45
  
46
  #define LCD_RS_PIN         
47
  #define LCD_LIGHT_PIN      7
48
  
49
  #define NOP()  asm("nop")
50
  #define WAIT(x) for (unsigned long count=0;count<x;count++){NOP();}
51
52
#endif //_LCD_H_