some refactoring,
minor code changes added a small class for SNESController reading
This commit is contained in:
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user