2021-05-21 10:10:29 +02:00
|
|
|
#ifndef TFTS_H
|
|
|
|
#define TFTS_H
|
|
|
|
|
2021-05-30 00:08:24 +02:00
|
|
|
#include "wled.h"
|
2021-05-21 10:10:29 +02:00
|
|
|
#include <FS.h>
|
|
|
|
|
|
|
|
#include <TFT_eSPI.h>
|
|
|
|
#include "Hardware.h"
|
|
|
|
#include "ChipSelect.h"
|
|
|
|
|
|
|
|
class TFTs : public TFT_eSPI {
|
|
|
|
private:
|
|
|
|
uint8_t digits[NUM_DIGITS];
|
|
|
|
|
2022-03-05 03:10:32 +01:00
|
|
|
|
2021-05-21 10:10:29 +02:00
|
|
|
// These read 16- and 32-bit types from the SD card file.
|
|
|
|
// BMP data is stored little-endian, Arduino is little-endian too.
|
|
|
|
// May need to reverse subscript order if porting elsewhere.
|
|
|
|
|
|
|
|
uint16_t read16(fs::File &f) {
|
|
|
|
uint16_t result;
|
|
|
|
((uint8_t *)&result)[0] = f.read(); // LSB
|
|
|
|
((uint8_t *)&result)[1] = f.read(); // MSB
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t read32(fs::File &f) {
|
|
|
|
uint32_t result;
|
|
|
|
((uint8_t *)&result)[0] = f.read(); // LSB
|
|
|
|
((uint8_t *)&result)[1] = f.read();
|
|
|
|
((uint8_t *)&result)[2] = f.read();
|
|
|
|
((uint8_t *)&result)[3] = f.read(); // MSB
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint16_t output_buffer[TFT_HEIGHT][TFT_WIDTH];
|
2022-03-05 21:48:11 +01:00
|
|
|
int16_t w = 135, h = 240, x = 0, y = 0, bufferedDigit = 255;
|
2022-03-06 22:24:24 +01:00
|
|
|
uint16_t digitR, digitG, digitB, dimming = 255;
|
|
|
|
uint32_t digitColor = 0;
|
2022-03-05 21:48:11 +01:00
|
|
|
|
|
|
|
void drawBuffer() {
|
|
|
|
bool oldSwapBytes = getSwapBytes();
|
|
|
|
setSwapBytes(true);
|
|
|
|
pushImage(x, y, w, h, (uint16_t *)output_buffer);
|
|
|
|
setSwapBytes(oldSwapBytes);
|
|
|
|
}
|
2021-05-21 10:10:29 +02:00
|
|
|
|
|
|
|
// These BMP functions are stolen directly from the TFT_SPIFFS_BMP example in the TFT_eSPI library.
|
|
|
|
// Unfortunately, they aren't part of the library itself, so I had to copy them.
|
|
|
|
// I've modified drawBmp to buffer the whole image at once instead of doing it line-by-line.
|
|
|
|
|
|
|
|
//// BEGIN STOLEN CODE
|
|
|
|
|
2022-03-05 03:10:32 +01:00
|
|
|
// Draw directly from file stored in RGB565 format. Fastest
|
2021-06-04 10:39:31 +02:00
|
|
|
bool drawBin(const char *filename) {
|
|
|
|
fs::File bmpFS;
|
|
|
|
|
|
|
|
// Open requested file on SD card
|
|
|
|
bmpFS = WLED_FS.open(filename, "r");
|
|
|
|
|
2022-03-05 03:10:32 +01:00
|
|
|
size_t sz = bmpFS.size();
|
|
|
|
if (sz > 64800) {
|
|
|
|
bmpFS.close();
|
2022-03-05 21:48:11 +01:00
|
|
|
return false;
|
2021-06-04 10:39:31 +02:00
|
|
|
}
|
|
|
|
|
2022-03-05 03:10:32 +01:00
|
|
|
uint16_t r, g, b, dimming = 255;
|
2022-03-05 21:48:11 +01:00
|
|
|
int16_t row, col;
|
2021-06-09 12:57:16 +02:00
|
|
|
|
2022-03-05 03:10:32 +01:00
|
|
|
//draw img that is shorter than 240pix into the center
|
|
|
|
w = 135;
|
|
|
|
h = sz / (w * 2);
|
2022-03-05 21:48:11 +01:00
|
|
|
x = 0;
|
2022-03-05 03:10:32 +01:00
|
|
|
y = (height() - h) /2;
|
|
|
|
|
|
|
|
uint8_t lineBuffer[w * 2];
|
2021-06-04 10:39:31 +02:00
|
|
|
|
2022-03-25 16:36:05 +01:00
|
|
|
if (!realtimeMode || realtimeOverride || (realtimeMode && useMainSegmentOnly)) strip.service();
|
2021-06-04 10:39:31 +02:00
|
|
|
|
2022-03-05 03:10:32 +01:00
|
|
|
// 0,0 coordinates are top left
|
|
|
|
for (row = 0; row < h; row++) {
|
2021-06-09 12:57:16 +02:00
|
|
|
|
2022-03-05 03:10:32 +01:00
|
|
|
bmpFS.read(lineBuffer, sizeof(lineBuffer));
|
|
|
|
uint8_t PixM, PixL;
|
|
|
|
|
|
|
|
// Colors are already in 16-bit R5, G6, B5 format
|
|
|
|
for (col = 0; col < w; col++)
|
|
|
|
{
|
2022-03-06 22:24:24 +01:00
|
|
|
if (dimming == 255 && !digitColor) { // not needed, copy directly
|
2022-03-05 03:10:32 +01:00
|
|
|
output_buffer[row][col] = (lineBuffer[col*2+1] << 8) | (lineBuffer[col*2]);
|
|
|
|
} else {
|
|
|
|
// 16 BPP pixel format: R5, G6, B5 ; bin: RRRR RGGG GGGB BBBB
|
|
|
|
PixM = lineBuffer[col*2+1];
|
|
|
|
PixL = lineBuffer[col*2];
|
|
|
|
// align to 8-bit value (MSB left aligned)
|
|
|
|
r = (PixM) & 0xF8;
|
|
|
|
g = ((PixM << 5) | (PixL >> 3)) & 0xFC;
|
|
|
|
b = (PixL << 3) & 0xF8;
|
2022-03-06 22:24:24 +01:00
|
|
|
r *= dimming; g *= dimming; b *= dimming;
|
|
|
|
r = r >> 8; g = g >> 8; b = b >> 8;
|
|
|
|
if (digitColor) { // grayscale pixel coloring
|
|
|
|
uint8_t l = (r > g) ? ((r > b) ? r:b) : ((g > b) ? g:b);
|
|
|
|
r = g = b = l;
|
|
|
|
r *= digitR; g *= digitG; b *= digitB;
|
|
|
|
r = r >> 8; g = g >> 8; b = b >> 8;
|
|
|
|
}
|
2022-03-05 03:10:32 +01:00
|
|
|
output_buffer[row][col] = ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
|
|
|
|
}
|
|
|
|
}
|
2021-06-09 12:57:16 +02:00
|
|
|
}
|
2021-06-04 10:39:31 +02:00
|
|
|
|
2022-03-05 21:48:11 +01:00
|
|
|
drawBuffer();
|
2022-03-05 03:10:32 +01:00
|
|
|
|
2021-06-04 10:39:31 +02:00
|
|
|
bmpFS.close();
|
|
|
|
|
2022-03-05 21:48:11 +01:00
|
|
|
return true;
|
2021-06-04 10:39:31 +02:00
|
|
|
}
|
|
|
|
|
2021-05-21 15:19:18 +02:00
|
|
|
bool drawBmp(const char *filename) {
|
2021-05-21 10:10:29 +02:00
|
|
|
fs::File bmpFS;
|
|
|
|
|
|
|
|
// Open requested file on SD card
|
|
|
|
bmpFS = WLED_FS.open(filename, "r");
|
|
|
|
|
2022-03-05 21:48:11 +01:00
|
|
|
uint32_t seekOffset, headerSize, paletteSize = 0;
|
|
|
|
int16_t row;
|
|
|
|
uint16_t r, g, b, dimming = 255, bitDepth;
|
2021-05-21 10:10:29 +02:00
|
|
|
|
|
|
|
uint16_t magic = read16(bmpFS);
|
2022-03-05 21:48:11 +01:00
|
|
|
if (magic != ('B' | ('M' << 8))) { // File not found or not a BMP
|
2021-05-21 10:10:29 +02:00
|
|
|
Serial.println(F("BMP not found!"));
|
|
|
|
bmpFS.close();
|
2022-03-05 21:48:11 +01:00
|
|
|
return false;
|
2021-05-21 10:10:29 +02:00
|
|
|
}
|
|
|
|
|
2022-03-05 21:48:11 +01:00
|
|
|
read32(bmpFS); // filesize in bytes
|
|
|
|
read32(bmpFS); // reserved
|
|
|
|
seekOffset = read32(bmpFS); // start of bitmap
|
|
|
|
headerSize = read32(bmpFS); // header size
|
|
|
|
w = read32(bmpFS); // width
|
|
|
|
h = read32(bmpFS); // height
|
|
|
|
read16(bmpFS); // color planes (must be 1)
|
|
|
|
bitDepth = read16(bmpFS);
|
2021-05-21 10:10:29 +02:00
|
|
|
|
2022-03-05 21:48:11 +01:00
|
|
|
if (read32(bmpFS) != 0 || (bitDepth != 24 && bitDepth != 1 && bitDepth != 4 && bitDepth != 8)) {
|
2021-05-21 10:10:29 +02:00
|
|
|
Serial.println(F("BMP format not recognized."));
|
|
|
|
bmpFS.close();
|
2022-03-05 21:48:11 +01:00
|
|
|
return false;
|
2021-05-21 10:10:29 +02:00
|
|
|
}
|
|
|
|
|
2022-03-05 21:48:11 +01:00
|
|
|
uint32_t palette[256];
|
|
|
|
if (bitDepth <= 8) // 1,4,8 bit bitmap: read color palette
|
|
|
|
{
|
|
|
|
read32(bmpFS); read32(bmpFS); read32(bmpFS); // size, w resolution, h resolution
|
|
|
|
paletteSize = read32(bmpFS);
|
|
|
|
if (paletteSize == 0) paletteSize = bitDepth * bitDepth; //if 0, size is 2^bitDepth
|
|
|
|
bmpFS.seek(14 + headerSize); // start of color palette
|
|
|
|
for (uint16_t i = 0; i < paletteSize; i++) {
|
|
|
|
palette[i] = read32(bmpFS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// draw img that is shorter than 240pix into the center
|
|
|
|
x = (width() - w) /2;
|
|
|
|
y = (height() - h) /2;
|
2021-05-21 15:19:18 +02:00
|
|
|
|
2021-05-21 10:10:29 +02:00
|
|
|
bmpFS.seek(seekOffset);
|
|
|
|
|
2022-03-05 21:48:11 +01:00
|
|
|
uint32_t lineSize = ((bitDepth * w +31) >> 5) * 4;
|
|
|
|
uint8_t lineBuffer[lineSize];
|
2021-05-21 10:10:29 +02:00
|
|
|
|
2022-03-25 16:36:05 +01:00
|
|
|
uint8_t serviceStrip = (!realtimeMode || realtimeOverride || (realtimeMode && useMainSegmentOnly)) ? 7 : 0;
|
2021-05-21 10:10:29 +02:00
|
|
|
// row is decremented as the BMP image is drawn bottom up
|
|
|
|
for (row = h-1; row >= 0; row--) {
|
2021-05-30 00:08:24 +02:00
|
|
|
if ((row & 0b00000111) == serviceStrip) strip.service(); //still refresh backlight to mitigate stutter every few rows
|
2021-05-21 10:10:29 +02:00
|
|
|
bmpFS.read(lineBuffer, sizeof(lineBuffer));
|
|
|
|
uint8_t* bptr = lineBuffer;
|
|
|
|
|
2022-03-05 21:48:11 +01:00
|
|
|
// Convert 24 to 16 bit colors while copying to output buffer.
|
2021-05-21 10:10:29 +02:00
|
|
|
for (uint16_t col = 0; col < w; col++)
|
|
|
|
{
|
2022-03-05 21:48:11 +01:00
|
|
|
if (bitDepth == 24) {
|
|
|
|
b = *bptr++;
|
|
|
|
g = *bptr++;
|
|
|
|
r = *bptr++;
|
|
|
|
} else {
|
|
|
|
uint32_t c = 0;
|
|
|
|
if (bitDepth == 8) {
|
|
|
|
c = palette[*bptr++];
|
|
|
|
}
|
|
|
|
else if (bitDepth == 4) {
|
|
|
|
c = palette[(*bptr >> ((col & 0x01)?0:4)) & 0x0F];
|
|
|
|
if (col & 0x01) bptr++;
|
|
|
|
}
|
|
|
|
else { // bitDepth == 1
|
|
|
|
c = palette[(*bptr >> (7 - (col & 0x07))) & 0x01];
|
|
|
|
if ((col & 0x07) == 0x07) bptr++;
|
|
|
|
}
|
|
|
|
b = c; g = c >> 8; r = c >> 16;
|
|
|
|
}
|
2022-03-05 03:10:32 +01:00
|
|
|
if (dimming != 255) { // only dimm when needed
|
2022-03-06 22:24:24 +01:00
|
|
|
r *= dimming; g *= dimming; b *= dimming;
|
|
|
|
r = r >> 8; g = g >> 8; b = b >> 8;
|
|
|
|
}
|
|
|
|
if (digitColor) { // grayscale pixel coloring
|
|
|
|
uint8_t l = (r > g) ? ((r > b) ? r:b) : ((g > b) ? g:b);
|
|
|
|
r = g = b = l;
|
|
|
|
|
|
|
|
r *= digitR; g *= digitG; b *= digitB;
|
|
|
|
r = r >> 8; g = g >> 8; b = b >> 8;
|
2022-03-05 03:10:32 +01:00
|
|
|
}
|
2022-03-05 21:48:11 +01:00
|
|
|
output_buffer[row][col] = ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xFF) >> 3);
|
2021-05-21 10:10:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-05 21:48:11 +01:00
|
|
|
drawBuffer();
|
2021-05-21 10:10:29 +02:00
|
|
|
|
|
|
|
bmpFS.close();
|
2022-03-05 21:48:11 +01:00
|
|
|
return true;
|
2021-05-21 10:10:29 +02:00
|
|
|
}
|
|
|
|
|
2022-03-05 03:10:32 +01:00
|
|
|
bool drawClk(const char *filename) {
|
|
|
|
fs::File bmpFS;
|
|
|
|
|
|
|
|
// Open requested file on SD card
|
|
|
|
bmpFS = WLED_FS.open(filename, "r");
|
|
|
|
|
|
|
|
if (!bmpFS)
|
|
|
|
{
|
|
|
|
Serial.print("File not found: ");
|
|
|
|
Serial.println(filename);
|
2022-03-05 21:48:11 +01:00
|
|
|
return false;
|
2022-03-05 03:10:32 +01:00
|
|
|
}
|
|
|
|
|
2022-03-05 21:48:11 +01:00
|
|
|
uint16_t r, g, b, dimming = 255, magic;
|
|
|
|
int16_t row, col;
|
2022-03-05 03:10:32 +01:00
|
|
|
|
|
|
|
magic = read16(bmpFS);
|
|
|
|
if (magic != 0x4B43) { // look for "CK" header
|
|
|
|
Serial.print(F("File not a CLK. Magic: "));
|
|
|
|
Serial.println(magic);
|
|
|
|
bmpFS.close();
|
2022-03-05 21:48:11 +01:00
|
|
|
return false;
|
2022-03-05 03:10:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
w = read16(bmpFS);
|
|
|
|
h = read16(bmpFS);
|
2022-03-05 21:48:11 +01:00
|
|
|
x = (width() - w) / 2;
|
|
|
|
y = (height() - h) / 2;
|
2022-03-05 03:10:32 +01:00
|
|
|
|
|
|
|
uint8_t lineBuffer[w * 2];
|
|
|
|
|
2022-03-25 16:36:05 +01:00
|
|
|
if (!realtimeMode || realtimeOverride || (realtimeMode && useMainSegmentOnly)) strip.service();
|
2022-03-05 03:10:32 +01:00
|
|
|
|
|
|
|
// 0,0 coordinates are top left
|
|
|
|
for (row = 0; row < h; row++) {
|
|
|
|
|
|
|
|
bmpFS.read(lineBuffer, sizeof(lineBuffer));
|
|
|
|
uint8_t PixM, PixL;
|
|
|
|
|
|
|
|
// Colors are already in 16-bit R5, G6, B5 format
|
|
|
|
for (col = 0; col < w; col++)
|
|
|
|
{
|
2022-03-06 22:24:24 +01:00
|
|
|
if (dimming == 255 && !digitColor) { // not needed, copy directly
|
2022-03-05 03:10:32 +01:00
|
|
|
output_buffer[row][col+x] = (lineBuffer[col*2+1] << 8) | (lineBuffer[col*2]);
|
|
|
|
} else {
|
|
|
|
// 16 BPP pixel format: R5, G6, B5 ; bin: RRRR RGGG GGGB BBBB
|
|
|
|
PixM = lineBuffer[col*2+1];
|
|
|
|
PixL = lineBuffer[col*2];
|
|
|
|
// align to 8-bit value (MSB left aligned)
|
|
|
|
r = (PixM) & 0xF8;
|
|
|
|
g = ((PixM << 5) | (PixL >> 3)) & 0xFC;
|
|
|
|
b = (PixL << 3) & 0xF8;
|
2022-03-06 22:24:24 +01:00
|
|
|
r *= dimming; g *= dimming; b *= dimming;
|
|
|
|
r = r >> 8; g = g >> 8; b = b >> 8;
|
|
|
|
if (digitColor) { // grayscale pixel coloring
|
|
|
|
uint8_t l = (r > g) ? ((r > b) ? r:b) : ((g > b) ? g:b);
|
|
|
|
r = g = b = l;
|
|
|
|
r *= digitR; g *= digitG; b *= digitB;
|
|
|
|
r = r >> 8; g = g >> 8; b = b >> 8;
|
|
|
|
}
|
2022-03-05 03:10:32 +01:00
|
|
|
output_buffer[row][col+x] = ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-05 21:48:11 +01:00
|
|
|
drawBuffer();
|
2022-03-05 03:10:32 +01:00
|
|
|
|
|
|
|
bmpFS.close();
|
2022-03-05 21:48:11 +01:00
|
|
|
return true;
|
2022-03-05 03:10:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-05-21 10:10:29 +02:00
|
|
|
public:
|
|
|
|
TFTs() : TFT_eSPI(), chip_select()
|
|
|
|
{ for (uint8_t digit=0; digit < NUM_DIGITS; digit++) digits[digit] = 0; }
|
|
|
|
|
|
|
|
// no == Do not send to TFT. yes == Send to TFT if changed. force == Send to TFT.
|
|
|
|
enum show_t { no, yes, force };
|
|
|
|
// A digit of 0xFF means blank the screen.
|
|
|
|
const static uint8_t blanked = 255;
|
2022-03-06 22:24:24 +01:00
|
|
|
|
|
|
|
uint8_t tubeSegment = 1;
|
|
|
|
uint8_t digitOffset = 0;
|
2021-05-21 10:10:29 +02:00
|
|
|
|
|
|
|
void begin() {
|
|
|
|
pinMode(TFT_ENABLE_PIN, OUTPUT);
|
|
|
|
digitalWrite(TFT_ENABLE_PIN, HIGH); //enable displays on boot
|
|
|
|
|
|
|
|
// Start with all displays selected.
|
|
|
|
chip_select.begin();
|
|
|
|
chip_select.setAll();
|
|
|
|
|
|
|
|
// Initialize the super class.
|
|
|
|
init();
|
|
|
|
}
|
|
|
|
|
|
|
|
void showDigit(uint8_t digit) {
|
|
|
|
chip_select.setDigit(digit);
|
2022-03-05 21:48:11 +01:00
|
|
|
uint8_t digitToDraw = digits[digit];
|
2022-03-06 22:24:24 +01:00
|
|
|
if (digitToDraw < 10) digitToDraw += digitOffset;
|
2021-05-21 10:10:29 +02:00
|
|
|
|
2022-03-05 21:48:11 +01:00
|
|
|
if (digitToDraw == blanked) {
|
2022-03-05 03:10:32 +01:00
|
|
|
fillScreen(TFT_BLACK); return;
|
2021-05-21 10:10:29 +02:00
|
|
|
}
|
2022-03-05 03:10:32 +01:00
|
|
|
|
2022-03-05 21:48:11 +01:00
|
|
|
// if last digit was the same, skip loading from FS to buffer
|
2022-03-06 22:24:24 +01:00
|
|
|
if (!digitColor && digitToDraw == bufferedDigit) drawBuffer();
|
|
|
|
digitR = R(digitColor); digitG = G(digitColor); digitB = B(digitColor);
|
2022-03-05 21:48:11 +01:00
|
|
|
|
|
|
|
// Filenames are no bigger than "254.bmp\0"
|
2022-03-05 03:10:32 +01:00
|
|
|
char file_name[10];
|
|
|
|
// Fastest, raw RGB565
|
2022-03-05 21:48:11 +01:00
|
|
|
sprintf(file_name, "/%d.bin", digitToDraw);
|
2022-03-05 03:10:32 +01:00
|
|
|
if (WLED_FS.exists(file_name)) {
|
2022-03-05 21:48:11 +01:00
|
|
|
if (drawBin(file_name)) bufferedDigit = digitToDraw;
|
|
|
|
return;
|
2021-05-21 10:10:29 +02:00
|
|
|
}
|
2022-03-05 21:48:11 +01:00
|
|
|
// Fast, raw RGB565, see https://github.com/aly-fly/EleksTubeHAX on how to create this clk format
|
|
|
|
sprintf(file_name, "/%d.clk", digitToDraw);
|
2022-03-05 03:10:32 +01:00
|
|
|
if (WLED_FS.exists(file_name)) {
|
2022-03-05 21:48:11 +01:00
|
|
|
if (drawClk(file_name)) bufferedDigit = digitToDraw;
|
|
|
|
return;
|
2022-03-05 03:10:32 +01:00
|
|
|
}
|
2022-03-05 21:48:11 +01:00
|
|
|
// Slow, regular RGB888 or 1,4,8 bit palette BMP
|
|
|
|
sprintf(file_name, "/%d.bmp", digitToDraw);
|
|
|
|
if (drawBmp(file_name)) bufferedDigit = digitToDraw;
|
|
|
|
return;
|
2022-03-05 03:10:32 +01:00
|
|
|
}
|
2021-05-21 10:10:29 +02:00
|
|
|
|
|
|
|
void setDigit(uint8_t digit, uint8_t value, show_t show=yes) {
|
|
|
|
uint8_t old_value = digits[digit];
|
2022-03-06 22:24:24 +01:00
|
|
|
digits[digit] = value;
|
|
|
|
|
|
|
|
// Color in grayscale bitmaps if Segment 1 exists
|
|
|
|
// TODO If secondary and tertiary are black, color all in primary,
|
|
|
|
// else color first three from Seg 1 color slots and last three from Seg 2 color slots
|
2022-07-06 13:13:54 +02:00
|
|
|
Segment& seg1 = strip.getSegment(tubeSegment);
|
2022-03-06 22:24:24 +01:00
|
|
|
if (seg1.isActive()) {
|
|
|
|
digitColor = strip.getPixelColor(seg1.start + digit);
|
|
|
|
dimming = seg1.opacity;
|
|
|
|
} else {
|
|
|
|
digitColor = 0;
|
|
|
|
dimming = 255;
|
|
|
|
}
|
2022-03-05 03:10:32 +01:00
|
|
|
|
2021-05-21 10:10:29 +02:00
|
|
|
if (show != no && (old_value != value || show == force)) {
|
|
|
|
showDigit(digit);
|
|
|
|
}
|
|
|
|
}
|
2022-03-06 22:24:24 +01:00
|
|
|
uint8_t getDigit(uint8_t digit) {return digits[digit];}
|
2021-05-21 10:10:29 +02:00
|
|
|
|
2022-03-06 22:24:24 +01:00
|
|
|
void showAllDigits() {for (uint8_t digit=0; digit < NUM_DIGITS; digit++) showDigit(digit);}
|
2021-05-21 10:10:29 +02:00
|
|
|
|
|
|
|
// Making chip_select public so we don't have to proxy all methods, and the caller can just use it directly.
|
|
|
|
ChipSelect chip_select;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TFTS_H
|