forked from vitotai/BrewPiLess
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNullLcdDriver.cpp
More file actions
149 lines (124 loc) · 3.34 KB
/
Copy pathNullLcdDriver.cpp
File metadata and controls
149 lines (124 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
* Copyright 2012-2013 BrewPi/Elco Jacobs.
*
* This file is part of BrewPi.
*
* BrewPi is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BrewPi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with BrewPi. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Brewpi.h"
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include "NullLcdDriver.h"
void NullLcdDriver::init()
{
}
void NullLcdDriver::begin(uint8_t cols, uint8_t lines) {
_numlines = lines;
_currline = 0;
_currpos = 0;
clear();
home();
display();
}
/********** high level commands, for the user! */
void NullLcdDriver::clear()
{
for(uint8_t i = 0; i<4; i++){
for(uint8_t j = 0; j<20; j++){
content[i][j]=' '; // initialize on all spaces
}
content[i][20]='\0'; // NULL terminate string
}
}
void NullLcdDriver::home()
{
_currline = 0;
_currpos = 0;
}
void NullLcdDriver::setCursor(uint8_t col, uint8_t row)
{
if ( row >= _numlines ) {
row = 0; //write to first line if out off bounds
}
_currline = row;
_currpos = col;
}
// Turn the display on/off (quickly)
void NullLcdDriver::noDisplay() {
}
void NullLcdDriver::display() {
}
// Turns the underline cursor on/off
void NullLcdDriver::noCursor() {
}
void NullLcdDriver::cursor() {
}
// Turn on and off the blinking cursor
void NullLcdDriver::noBlink() {
}
void NullLcdDriver::blink() {
}
// These commands scroll the display without changing the RAM
void NullLcdDriver::scrollDisplayLeft(void) {
}
void NullLcdDriver::scrollDisplayRight(void) {
}
// This is for text that flows Left to Right
void NullLcdDriver::leftToRight(void) {
}
// This is for text that flows Right to Left
void NullLcdDriver::rightToLeft(void) {
}
// This will 'right justify' text from the cursor
void NullLcdDriver::autoscroll(void) {
}
// This will 'left justify' text from the cursor
void NullLcdDriver::noAutoscroll(void) {
}
// Allows us to fill the first 8 CGRAM locations
// with custom characters
void NullLcdDriver::createChar(uint8_t location, uint8_t charmap[]) {
location &= 0x7; // we only have 8 locations 0-7
for (int i=0; i<8; i++) {
write(charmap[i]);
}
}
// This resets the backlight timer and updates the SPI output
void NullLcdDriver::resetBacklightTimer(void){
}
void NullLcdDriver::updateBacklight(void){
}
// Puts the content of one LCD line into the provided buffer.
void NullLcdDriver::getLine(uint8_t lineNumber, char * buffer){
const char* src = content[lineNumber];
for(uint8_t i =0;i<20;i++){
char c = src[i];
buffer[i] = (c == 0b11011111) ? 0xB0 : c;
}
buffer[20] = '\0'; // NULL terminate string
}
/*********** mid level commands, for sending data/cmds */
inline void NullLcdDriver::command(uint8_t value) {
}
inline size_t NullLcdDriver::write(uint8_t value) {
content[_currline][_currpos] = value;
_currpos++;
return 1;
}
void NullLcdDriver::printSpacesToRestOfLine(void){
while(_currpos < 20){
print(' ') ;
}
}