LevelMeter-Display  2.0
An ultrasonic Level Meter for Stormwater Cisterns
lcd.h
Go to the documentation of this file.
1 /*
2  * lcd.h
3  *
4  * Created: 21.11.2012 15:46:04
5  * Author: rolo
6  */
7 
8 
9 #ifndef LCD_H_
10 #define LCD_H_
11 
12 #include <stdio.h>
13 #include <stdbool.h>
14 
15 #define LCD_MAX_WIDTH 20
16 #define LCD_MAX_LINES 4
17 
18 extern uint8_t lcdVbarChar[LCD_MAX_LINES];
19 extern void LCDInitCGRAM();
20 extern void InitLCD(void);
21 extern void LCDClear(void);
22 extern void LCDGoTo(uint8_t pos);
23 extern void LCDPrintLine_P(uint8_t line, const char *fmt, ...);
24 extern int8_t LCDHBarGraph(uint8_t line,uint8_t val);
25 extern bool LCDBuildVBarChars(uint8_t nBars);
26 extern uint8_t lcdVbarChar[LCD_MAX_LINES];
27 
28 extern FILE lcd;
29 
34 static inline void LCDSetBrightness(uint8_t val)
35 {
36  OCR1AL=val;
37 }
38 
42 static inline uint8_t LCDGetBrightness(void)
43 {
44  return OCR1AL;
45 }
46 
51 static inline void LCDSetContrast(uint8_t val)
52 {
53  OCR1BL=val;
54 }
55 
59 static inline uint8_t LCDGetContrast(void)
60 {
61  return OCR1BL;
62 }
63 
64 
65 bool LCDBuildVBarChar(uint8_t nBars);
66 
67 #endif /* LCD_H_ */
void InitLCD(void)
Initializes the LC-Display.
Definition: lcd.c:187
void LCDGoTo(uint8_t pos)
Sets the Cursor Position.
Definition: lcd.c:222
static uint8_t LCDGetBrightness(void)
Gets the current Brightness of the LCD Backlight.
Definition: lcd.h:42
bool LCDBuildVBarChars(uint8_t nBars)
Builds the Character Array for vertical Bar Graphs.
Definition: lcd.c:329
FILE lcd
Definition: lcd.c:41
void LCDPrintLine_P(uint8_t line, const char *fmt,...)
Printf for one complete Line of the Display.
Definition: lcd.c:254
uint8_t lcdVbarChar[LCD_MAX_LINES]
Holds the characters for Vertical Bar Graph from Line 3 to 0.
Definition: lcd.h:26
#define LCD_MAX_LINES
Maximum allowable numbers of lines for all possible displays.
Definition: lcd.h:16
static void LCDSetBrightness(uint8_t val)
Sets the Brightness of the LCD Backlight.
Definition: lcd.h:34
void LCDInitCGRAM()
Initializes the Character Generator RAM.
Definition: lcd.c:165
static uint8_t LCDGetContrast(void)
Gets the current Contrast of the LCD.
Definition: lcd.h:59
void LCDClear(void)
Clears the LCD and sets Cursor to Home Postion.
Definition: lcd.c:150
int8_t LCDHBarGraph(uint8_t line, uint8_t val)
Prints a Line of Bar Graph. The rest of the line is cleared.
Definition: lcd.c:364
bool LCDBuildVBarChar(uint8_t nBars)
Builds a Character for vertical Bar Graph.
Definition: lcd.c:306
static void LCDSetContrast(uint8_t val)
Sets the Contrast of the LCD.
Definition: lcd.h:51