some refactoring,

minor code changes
added a small class for SNESController reading
This commit is contained in:
2021-01-03 16:21:20 +01:00
parent ac74587ee7
commit 3babe3f1ef
8 changed files with 188 additions and 22 deletions

View File

@@ -230,8 +230,8 @@ private:
public:
void flush(const uint16_t* data) {
void startWrite() {
select();
sendCommand(ST7735_CASET); // Column addr set
@@ -249,6 +249,22 @@ public:
sendCommand(ST7735_RAMWR);
modeData();
}
void writePixel(const uint16_t rgb) {
spi.writeByte(rgb >> 0);
spi.writeByte(rgb >> 8);
}
void stopWrite() {
deselect();
}
void flush(const uint16_t* data) {
startWrite();
/*
for (int i = 0; i < (V*H); ++i) {
const uint16_t color = data[i];
@@ -262,7 +278,7 @@ public:
spi.write((const uint8_t*)data, V*H*sizeof(uint16_t));
deselect();
stopWrite();
}