@@ -43,23 +43,23 @@ namespace pimoroni {
43
43
TSSET = 0xE6 // E5 or E6
44
44
};
45
45
46
- bool UC8159Inky7 ::is_busy () {
46
+ bool Inky73 ::is_busy () {
47
47
return !(sr.read () & 128 );
48
48
}
49
49
50
- void UC8159Inky7 ::busy_wait () {
50
+ void Inky73 ::busy_wait () {
51
51
while (is_busy ()) {
52
52
tight_loop_contents ();
53
53
}
54
54
}
55
55
56
- void UC8159Inky7 ::reset () {
56
+ void Inky73 ::reset () {
57
57
gpio_put (RESET, 0 ); sleep_ms (10 );
58
58
gpio_put (RESET, 1 ); sleep_ms (10 );
59
59
busy_wait ();
60
60
}
61
61
62
- void UC8159Inky7 ::init () {
62
+ void Inky73 ::init () {
63
63
// configure spi interface and pins
64
64
spi_init (spi, 20'000'000 );
65
65
@@ -78,7 +78,7 @@ namespace pimoroni {
78
78
gpio_set_function (MOSI, GPIO_FUNC_SPI);
79
79
};
80
80
81
- void UC8159Inky7 ::setup () {
81
+ void Inky73 ::setup () {
82
82
reset ();
83
83
busy_wait ();
84
84
@@ -108,16 +108,16 @@ namespace pimoroni {
108
108
command (TSSET, {0x00 });
109
109
}
110
110
111
- void UC8159Inky7 ::set_blocking (bool blocking) {
111
+ void Inky73 ::set_blocking (bool blocking) {
112
112
this ->blocking = blocking;
113
113
}
114
114
115
- void UC8159Inky7 ::power_off () {
115
+ void Inky73 ::power_off () {
116
116
busy_wait ();
117
117
command (POF); // turn off
118
118
}
119
119
120
- void UC8159Inky7 ::command (uint8_t reg, size_t len, const uint8_t *data) {
120
+ void Inky73 ::command (uint8_t reg, size_t len, const uint8_t *data) {
121
121
gpio_put (CS, 0 );
122
122
123
123
gpio_put (DC, 0 ); // command mode
@@ -131,18 +131,18 @@ namespace pimoroni {
131
131
gpio_put (CS, 1 );
132
132
}
133
133
134
- void UC8159Inky7 ::data (size_t len, const uint8_t *data) {
134
+ void Inky73 ::data (size_t len, const uint8_t *data) {
135
135
gpio_put (CS, 0 );
136
136
gpio_put (DC, 1 ); // data mode
137
137
spi_write_blocking (spi, (const uint8_t *)data, len);
138
138
gpio_put (CS, 1 );
139
139
}
140
140
141
- void UC8159Inky7 ::command (uint8_t reg, std::initializer_list<uint8_t > values) {
141
+ void Inky73 ::command (uint8_t reg, std::initializer_list<uint8_t > values) {
142
142
command (reg, values.size (), (uint8_t *)values.begin ());
143
143
}
144
144
145
- void UC8159Inky7 ::update (PicoGraphics *graphics) {
145
+ void Inky73 ::update (PicoGraphics *graphics) {
146
146
if (graphics->pen_type != PicoGraphics::PEN_INKY7) return ; // Incompatible buffer
147
147
148
148
if (blocking) {
@@ -189,7 +189,7 @@ namespace pimoroni {
189
189
}
190
190
}
191
191
192
- bool UC8159Inky7 ::is_pressed (Button button) {
192
+ bool Inky73 ::is_pressed (Button button) {
193
193
return sr.read () & button;
194
194
}
195
195
0 commit comments