-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathRickmanLiquidCrystal_I2C.h
More file actions
59 lines (51 loc) · 1.55 KB
/
RickmanLiquidCrystal_I2C.h
File metadata and controls
59 lines (51 loc) · 1.55 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
/* -*- C++ -*- */
// Note: this file copied and slightly modified from
#ifndef RSITE_ARDUINO_MENU_RICKMAN_OUT
#define RSITE_ARDUINO_MENU_RICKMAN_OUT
// #ifndef ARDUINO_SAM_DUE
#include <menuDefs.h>
#include <Wire.h>
// #include <LiquidCrystal_PCF8574.h>
// #include <LiquidCrystal_I2C.h>
#include "GPAD_HAL.h"
namespace Menu
{
class lcdOut : public cursorOut
{
public:
LCDWrapper *device;
inline lcdOut(LCDWrapper *o, idx_t *t, panelsList &p, menuOut::styles s = menuOut::minimalRedraw)
: cursorOut(t, p, s), device(o) {}
size_t write(uint8_t ch) override { return device->write(ch); }
void clear() override
{
device->clear();
panels.reset();
}
void setCursor(idx_t x, idx_t y, idx_t panelNr = 0) override
{
const panel p = panels[panelNr];
device->setCursor(p.x + x, p.y + y);
}
idx_t startCursor(navRoot &root, idx_t x, idx_t y, bool charEdit, idx_t panelNr = 0) override { return 0; }
idx_t endCursor(navRoot &root, idx_t x, idx_t y, bool charEdit, idx_t panelNr = 0) override { return 0; }
idx_t editCursor(navRoot &root, idx_t x, idx_t y, bool editing, bool charEdit, idx_t panelNr = 0) override
{
trace(MENU_DEBUG_OUT << "lcdOut::editCursor " << x << "," << y << endl);
// text editor cursor
device->noBlink();
device->noCursor();
if (editing)
{
device->setCursor(x, y);
if (charEdit)
device->cursor();
else
device->blink();
}
return 0;
}
};
} // namespace Menu
#endif
// #endif