Electronic Load  1.0
Programmable Constant Current Sink
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 <avr/io.h>
13 #include <stdio.h>
14 #include <stdbool.h>
15 
16 #define LCD_WIDTH 20
17 #define LCD_LINES 4
18 #define LCD_LINE1 0
19 #define LCD_LINE2 64
20 #define LCD_LINE3 20
21 #define LCD_LINE4 84
22 
23 
24 extern uint8_t lcdVbarChar[LCD_LINES];
25 extern const uint8_t LCDStartLine[];
26 extern void LCDInitCGRAM();
27 extern void LDCInit(void);
28 extern void LCDCursorOn(void);
29 extern void LCDCursorOff(void);
30 extern void LCDClear(void);
31 extern void LCDGoTo(uint8_t pos);
32 extern uint8_t LCDGoToXY(uint8_t x, uint8_t y);
33 void LCDWriteData(char c);
34 extern void LCDPrintLine_P(uint8_t line, const char *fmt, ...);
35 void LCDWriteString(const char *s);
36 void LCDWriteString_P(const char *s);
37 extern int8_t LCDHBarGraph(uint8_t line,uint8_t val);
38 extern bool LCDBuildVBarChars(uint8_t nBars);
39 extern uint8_t lcdVbarChar[LCD_LINES];
40 extern void LCDSecondlyCallback(void);
41 extern void LCDActivateBacklight(void);
42 
43 extern FILE lcd;
44 
49 static inline void LCDSetBrightness(uint8_t val)
50 {
51  OCR2B=val;
52 }
53 
57 static inline uint8_t LCDGetBrightness(void)
58 {
59  return OCR2B;
60 }
61 
66 static inline void LCDSetContrast(uint8_t val)
67 {
68  OCR2A=val;
69 }
70 
74 static inline uint8_t LCDGetContrast(void)
75 {
76  return OCR2A;
77 }
78 
79 
80 bool LCDBuildVBarChar(uint8_t nBars);
81 
82 #endif /* LCD_H_ */
#define LCD_LINES
Number of lines.
Definition: lcd.h:17
uint8_t LCDGoToXY(uint8_t x, uint8_t y)
Sets the Cursor Position.
Definition: lcd.c:277
void LCDSecondlyCallback(void)
Has to be called once per Second by the surrounding program.
Definition: lcd.c:460
void LCDCursorOff(void)
Definition: lcd.c:256
void LCDGoTo(uint8_t pos)
Sets the Cursor Position.
Definition: lcd.c:267
static uint8_t LCDGetBrightness(void)
Gets the current Brightness of the LCD Backlight.
Definition: lcd.h:57
void LDCInit(void)
Initializes the LC-Display.
Definition: lcd.c:221
bool LCDBuildVBarChars(uint8_t nBars)
Builds the Character Array for vertical Bar Graphs.
Definition: lcd.c:386
void LCDWriteString_P(const char *s)
Displays a String in Flash Memory.
Definition: lcd.c:158
uint8_t lcdVbarChar[LCD_LINES]
Holds the characters for Vertical Bar Graph from Line 3 to 0.
Definition: lcd.h:39
void LCDActivateBacklight(void)
Definition: lcd.c:476
FILE lcd
Definition: lcd.c:45
void LCDPrintLine_P(uint8_t line, const char *fmt,...)
Printf for one complete Line of the Display.
Definition: lcd.c:311
static void LCDSetBrightness(uint8_t val)
Sets the Brightness of the LCD Backlight.
Definition: lcd.h:49
void LCDInitCGRAM()
Initializes the Character Generator RAM.
Definition: lcd.c:181
void LCDCursorOn(void)
Definition: lcd.c:251
static uint8_t LCDGetContrast(void)
Gets the current Contrast of the LCD.
Definition: lcd.h:74
void LCDWriteData(char c)
Writes a Data-Byte to the Display.
Definition: lcd.c:139
void LCDClear(void)
Clears the LCD and sets Cursor to Home Postion.
Definition: lcd.c:166
const uint8_t LCDStartLine[]
Definition: lcd.c:47
void LCDWriteString(const char *s)
Displays a String.
Definition: lcd.c:149
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:421
bool LCDBuildVBarChar(uint8_t nBars)
Builds a Character for vertical Bar Graph.
Definition: lcd.c:363
static void LCDSetContrast(uint8_t val)
Sets the Contrast of the LCD.
Definition: lcd.h:66