Skip to content

Commit 1659139

Browse files
committed
Inky 7.3: Rename class.
1 parent 43382ba commit 1659139

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

drivers/inky73/inky73.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,23 @@ namespace pimoroni {
4343
TSSET = 0xE6 // E5 or E6
4444
};
4545

46-
bool UC8159Inky7::is_busy() {
46+
bool Inky73::is_busy() {
4747
return !(sr.read() & 128);
4848
}
4949

50-
void UC8159Inky7::busy_wait() {
50+
void Inky73::busy_wait() {
5151
while(is_busy()) {
5252
tight_loop_contents();
5353
}
5454
}
5555

56-
void UC8159Inky7::reset() {
56+
void Inky73::reset() {
5757
gpio_put(RESET, 0); sleep_ms(10);
5858
gpio_put(RESET, 1); sleep_ms(10);
5959
busy_wait();
6060
}
6161

62-
void UC8159Inky7::init() {
62+
void Inky73::init() {
6363
// configure spi interface and pins
6464
spi_init(spi, 20'000'000);
6565

@@ -78,7 +78,7 @@ namespace pimoroni {
7878
gpio_set_function(MOSI, GPIO_FUNC_SPI);
7979
};
8080

81-
void UC8159Inky7::setup() {
81+
void Inky73::setup() {
8282
reset();
8383
busy_wait();
8484

@@ -108,16 +108,16 @@ namespace pimoroni {
108108
command(TSSET, {0x00});
109109
}
110110

111-
void UC8159Inky7::set_blocking(bool blocking) {
111+
void Inky73::set_blocking(bool blocking) {
112112
this->blocking = blocking;
113113
}
114114

115-
void UC8159Inky7::power_off() {
115+
void Inky73::power_off() {
116116
busy_wait();
117117
command(POF); // turn off
118118
}
119119

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) {
121121
gpio_put(CS, 0);
122122

123123
gpio_put(DC, 0); // command mode
@@ -131,18 +131,18 @@ namespace pimoroni {
131131
gpio_put(CS, 1);
132132
}
133133

134-
void UC8159Inky7::data(size_t len, const uint8_t *data) {
134+
void Inky73::data(size_t len, const uint8_t *data) {
135135
gpio_put(CS, 0);
136136
gpio_put(DC, 1); // data mode
137137
spi_write_blocking(spi, (const uint8_t*)data, len);
138138
gpio_put(CS, 1);
139139
}
140140

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) {
142142
command(reg, values.size(), (uint8_t *)values.begin());
143143
}
144144

145-
void UC8159Inky7::update(PicoGraphics *graphics) {
145+
void Inky73::update(PicoGraphics *graphics) {
146146
if(graphics->pen_type != PicoGraphics::PEN_INKY7) return; // Incompatible buffer
147147

148148
if(blocking) {
@@ -189,7 +189,7 @@ namespace pimoroni {
189189
}
190190
}
191191

192-
bool UC8159Inky7::is_pressed(Button button) {
192+
bool Inky73::is_pressed(Button button) {
193193
return sr.read() & button;
194194
}
195195

drivers/inky73/inky73.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace pimoroni {
1414

15-
class UC8159Inky7 : public DisplayDriver {
15+
class Inky73 : public DisplayDriver {
1616
//--------------------------------------------------
1717
// Variables
1818
//--------------------------------------------------
@@ -54,11 +54,11 @@ namespace pimoroni {
5454
CLEAN = 7
5555
};
5656

57-
UC8159Inky7(uint16_t width, uint16_t height) : UC8159Inky7(width, height, ROTATE_0, {PIMORONI_SPI_DEFAULT_INSTANCE, SPI_BG_FRONT_CS, SPI_DEFAULT_SCK, SPI_DEFAULT_MOSI, PIN_UNUSED, 28, PIN_UNUSED}) {};
57+
Inky73(uint16_t width, uint16_t height) : Inky73(width, height, ROTATE_0, {PIMORONI_SPI_DEFAULT_INSTANCE, SPI_BG_FRONT_CS, SPI_DEFAULT_SCK, SPI_DEFAULT_MOSI, PIN_UNUSED, 28, PIN_UNUSED}) {};
5858

59-
UC8159Inky7(uint16_t width, uint16_t height, SPIPins pins, uint reset=27) : UC8159Inky7(width, height, ROTATE_0, pins, reset) {};
59+
Inky73(uint16_t width, uint16_t height, SPIPins pins, uint reset=27) : Inky73(width, height, ROTATE_0, pins, reset) {};
6060

61-
UC8159Inky7(uint16_t width, uint16_t height, Rotation rotation, SPIPins pins, uint reset=27) :
61+
Inky73(uint16_t width, uint16_t height, Rotation rotation, SPIPins pins, uint reset=27) :
6262
DisplayDriver(width, height, rotation),
6363
spi(pins.spi),
6464
CS(pins.cs), DC(pins.dc), SCK(pins.sck), MOSI(pins.mosi), RESET(reset) {

examples/inky_frame/inky_frame7_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ int main() {
1818

1919
PSRamDisplay ramDisplay(800, 480);
2020
PicoGraphics_PenInky7 graphics(800, 480, ramDisplay);
21-
UC8159Inky7 inky7(800,400);
21+
Inky73 inky7(800,400);
2222

2323
while (true) {
24-
while(!inky7.is_pressed(UC8159Inky7::BUTTON_A)) {
24+
while(!inky7.is_pressed(Inky73::BUTTON_A)) {
2525
sleep_ms(10);
2626
}
2727
graphics.set_pen(1);

0 commit comments

Comments
 (0)