|
LevelMeter-Display
2.0
An ultrasonic Level Meter for Stormwater Cisterns
|


Go to the source code of this file.
Macros | |
| #define | LCD_MAX_LINES 4 |
| Maximum allowable numbers of lines for all possible displays. More... | |
| #define | LCD_MAX_WIDTH 20 |
| Maximum allowable with of all possible displays. More... | |
Functions | |
| void | InitLCD (void) |
| Initializes the LC-Display. More... | |
| bool | LCDBuildVBarChar (uint8_t nBars) |
| Builds a Character for vertical Bar Graph. More... | |
| bool | LCDBuildVBarChars (uint8_t nBars) |
| Builds the Character Array for vertical Bar Graphs. More... | |
| void | LCDClear (void) |
| Clears the LCD and sets Cursor to Home Postion. More... | |
| static uint8_t | LCDGetBrightness (void) |
| Gets the current Brightness of the LCD Backlight. More... | |
| static uint8_t | LCDGetContrast (void) |
| Gets the current Contrast of the LCD. More... | |
| void | LCDGoTo (uint8_t pos) |
| Sets the Cursor Position. More... | |
| int8_t | LCDHBarGraph (uint8_t line, uint8_t val) |
| Prints a Line of Bar Graph. The rest of the line is cleared. More... | |
| void | LCDInitCGRAM () |
| Initializes the Character Generator RAM. More... | |
| void | LCDPrintLine_P (uint8_t line, const char *fmt,...) |
| Printf for one complete Line of the Display. More... | |
| static void | LCDSetBrightness (uint8_t val) |
| Sets the Brightness of the LCD Backlight. More... | |
| static void | LCDSetContrast (uint8_t val) |
| Sets the Contrast of the LCD. More... | |
Variables | |
| FILE | lcd |
| uint8_t | lcdVbarChar [LCD_MAX_LINES] |
| Holds the characters for Vertical Bar Graph from Line 3 to 0. More... | |
| #define LCD_MAX_LINES 4 |
Maximum allowable numbers of lines for all possible displays.
| #define LCD_MAX_WIDTH 20 |
Maximum allowable with of all possible displays.
| void InitLCD | ( | void | ) |
Initializes the LC-Display.
References delay50ms(), delay50us(), delay5ms(), LCD_DDR, LCD_EN, LCD_LIGHT, LCD_PORT, LCDClear(), LCDInitCGRAM(), and LCDWriteCmd().
Referenced by Init().


| bool LCDBuildVBarChar | ( | uint8_t | nBars | ) |
Builds a Character for vertical Bar Graph.
The vertical bar graph character can be printed as character code 3
| nBars | The number of black Lines (0..8) |
References LCDGoTo(), LCDWriteCmd(), and LCDWriteData().
Referenced by LCDBuildVBarChars().


| bool LCDBuildVBarChars | ( | uint8_t | nBars | ) |
Builds the Character Array for vertical Bar Graphs.
| nBars | The number of black Bars |
References config, displayMetrics, confStruct_t::displayType, LCDBuildVBarChar(), lcdVbarChar, and displayMetrics_T::nLines.
Referenced by VBarGraphPrepare(), and VBarTest().


| void LCDClear | ( | void | ) |
Clears the LCD and sets Cursor to Home Postion.
References LCDWriteCmd().
Referenced by CmdCalibrate(), CmdSetDisplay(), HBarTest(), InitLCD(), ShowScreen(), and VBarTest().


|
inlinestatic |
Gets the current Brightness of the LCD Backlight.
Referenced by CmdSetBright(), DoKFlags(), and DoTflags().

|
inlinestatic |
Gets the current Contrast of the LCD.
Referenced by CmdSetContrast().

| void LCDGoTo | ( | uint8_t | pos | ) |
Sets the Cursor Position.
Lines start at 0 and 64 for the 2x16 and
0,64,20 and 84 for the 4x20-Display
| pos | The Position |
References LCDWriteCmd().
Referenced by EnterDouble(), LCDBuildVBarChar(), LCDHBarGraph(), LCDPrintLine_P(), and ShowScreen().


| int8_t LCDHBarGraph | ( | uint8_t | line, |
| uint8_t | val | ||
| ) |
Prints a Line of Bar Graph. The rest of the line is cleared.
| line | The 0-based Line Number |
| val | The number of black Lines to draw. This is not a percent value! Maximum is five times the width of the display (i.e. 100 for 4x20 and 80 for 2x16). |
References config, displayMetrics, confStruct_t::displayType, LCDBuildHBarChar(), LCDGoTo(), LCDWriteData(), displayMetrics_T::nLines, displayMetrics_T::startLine, and displayMetrics_T::width.
Referenced by HBarGraphPerCent(), and HBarTest().


| void LCDInitCGRAM | ( | ) |
Initializes the Character Generator RAM.
This routine basically defines the antenna-character (DCF77-symbol). Since a character 0 cannot be used for printf, we use character 1 for it.
The symbols for bargraph display use character codes 2 to 6. Character code 7 is unused until now.
References LCDWriteCmd(), and LCDWriteData().
Referenced by InitLCD().


| void LCDPrintLine_P | ( | uint8_t | line, |
| const char * | fmt, | ||
| ... | |||
| ) |
Printf for one complete Line of the Display.
This is a handy printf-like function for outputting display content. It ensures that no more characters are written than one line can hold and automatically deletes all characters beyond the content so that no fragments of the previous content remain visible.
| line | The line to print on (0-based) |
| fmt | A printf-like format string |
| ... | Optional further parameters |
References config, displayMetrics, confStruct_t::displayType, LCD_MAX_WIDTH, LCDGoTo(), LCDWriteData(), LCDWriteString(), displayMetrics_T::nLines, displayMetrics_T::startLine, and displayMetrics_T::width.
Referenced by FTest485(), HBarTest(), ShowScreen(), and VBarTestPrint().


|
inlinestatic |
Sets the Brightness of the LCD Backlight.
| val | The Brightness |
Referenced by CmdCalibrate(), CmdSetBright(), DoKFlags(), DoTflags(), and WaitKeyBlinking().

|
inlinestatic |
Sets the Contrast of the LCD.
| val | The Contrast |
Referenced by CmdSetContrast().

| FILE lcd |
Referenced by Init().
| uint8_t lcdVbarChar[LCD_MAX_LINES] |
Holds the characters for Vertical Bar Graph from Line 3 to 0.
Referenced by LCDBuildVBarChars(), ShowScreen(), and VBarTestPrint().
1.8.15