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_ */
LCD_LINES
#define LCD_LINES
Number of lines.
Definition: lcd.h:17
LCDGoToXY
uint8_t LCDGoToXY(uint8_t x, uint8_t y)
Sets the Cursor Position.
Definition: lcd.c:277
LCDSecondlyCallback
void LCDSecondlyCallback(void)
Has to be called once per Second by the surrounding program.
Definition: lcd.c:460
LCDCursorOff
void LCDCursorOff(void)
Definition: lcd.c:256
LCDGoTo
void LCDGoTo(uint8_t pos)
Sets the Cursor Position.
Definition: lcd.c:267
LCDGetBrightness
static uint8_t LCDGetBrightness(void)
Gets the current Brightness of the LCD Backlight.
Definition: lcd.h:57
LDCInit
void LDCInit(void)
Initializes the LC-Display.
Definition: lcd.c:221
LCDBuildVBarChars
bool LCDBuildVBarChars(uint8_t nBars)
Builds the Character Array for vertical Bar Graphs.
Definition: lcd.c:386
LCDWriteString_P
void LCDWriteString_P(const char *s)
Displays a String in Flash Memory.
Definition: lcd.c:158
lcdVbarChar
uint8_t lcdVbarChar[LCD_LINES]
Holds the characters for Vertical Bar Graph from Line 3 to 0.
Definition: lcd.h:39
LCDActivateBacklight
void LCDActivateBacklight(void)
Definition: lcd.c:476
lcd
FILE lcd
Definition: lcd.c:45
LCDPrintLine_P
void LCDPrintLine_P(uint8_t line, const char *fmt,...)
Printf for one complete Line of the Display.
Definition: lcd.c:311
LCDSetBrightness
static void LCDSetBrightness(uint8_t val)
Sets the Brightness of the LCD Backlight.
Definition: lcd.h:49
LCDInitCGRAM
void LCDInitCGRAM()
Initializes the Character Generator RAM.
Definition: lcd.c:181
LCDCursorOn
void LCDCursorOn(void)
Definition: lcd.c:251
LCDGetContrast
static uint8_t LCDGetContrast(void)
Gets the current Contrast of the LCD.
Definition: lcd.h:74
LCDWriteData
void LCDWriteData(char c)
Writes a Data-Byte to the Display.
Definition: lcd.c:139
LCDClear
void LCDClear(void)
Clears the LCD and sets Cursor to Home Postion.
Definition: lcd.c:166
LCDStartLine
const uint8_t LCDStartLine[]
Definition: lcd.c:47
LCDWriteString
void LCDWriteString(const char *s)
Displays a String.
Definition: lcd.c:149
LCDHBarGraph
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
LCDBuildVBarChar
bool LCDBuildVBarChar(uint8_t nBars)
Builds a Character for vertical Bar Graph.
Definition: lcd.c:363
LCDSetContrast
static void LCDSetContrast(uint8_t val)
Sets the Contrast of the LCD.
Definition: lcd.h:66