2020-10-16 14:39:55 +08:00
|
|
|
#ifndef _TFTTERMINAL_H_
|
|
|
|
|
#define _TFTTERMINAL_H_
|
|
|
|
|
|
|
|
|
|
#include <M5Stack.h>
|
|
|
|
|
#include <Print.h>
|
|
|
|
|
|
2022-07-06 14:21:26 +08:00
|
|
|
class TFTTerminal : public Print {
|
|
|
|
|
private:
|
2020-10-16 14:39:55 +08:00
|
|
|
TFT_eSprite *disptr;
|
|
|
|
|
char discharbuff[60][55];
|
2022-07-06 14:21:26 +08:00
|
|
|
uint32_t xpos = 0, ypos = 0, dispos = 0;
|
|
|
|
|
TFT_eSprite *_dis_buff_ptr = NULL;
|
|
|
|
|
uint16_t _bkcolor = TFT_BLACK;
|
|
|
|
|
uint16_t _color = TFT_GREEN;
|
2020-10-16 14:39:55 +08:00
|
|
|
|
2022-07-06 14:21:26 +08:00
|
|
|
uint16_t _win_x_pos = 0, _win_y_pos = 0, _win_w = 320, _win_h = 240;
|
|
|
|
|
uint16_t _font_x_size = 6, _font_y_size = 8;
|
|
|
|
|
uint8_t _fontSize = 0;
|
|
|
|
|
uint16_t _line_x_limit = 53, _line_y_limit = 30;
|
2020-10-16 14:39:55 +08:00
|
|
|
|
2022-07-06 14:21:26 +08:00
|
|
|
public:
|
2020-10-16 14:39:55 +08:00
|
|
|
TFTTerminal(TFT_eSprite *dis_buff_ptr);
|
|
|
|
|
~TFTTerminal();
|
2022-07-06 14:21:26 +08:00
|
|
|
|
|
|
|
|
void setcolor(uint16_t color, uint16_t bk_color);
|
|
|
|
|
void setGeometry(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
|
2020-10-16 14:39:55 +08:00
|
|
|
void setFontsize(uint8_t size);
|
|
|
|
|
|
2022-07-06 14:21:26 +08:00
|
|
|
size_t write(uint8_t);
|
2020-10-16 14:39:55 +08:00
|
|
|
size_t write(const uint8_t *buffer, size_t size);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|