-
Notifications
You must be signed in to change notification settings - Fork 2
/
AdaScroller.h
38 lines (33 loc) · 956 Bytes
/
AdaScroller.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef __ADASCROLLER_H__
#define __ADASCROLLER_H__
#include "Adafruit_HX8357.h"
class Log2TFT : public Print {
public:
typedef struct RECT {
unsigned short x, y, w, h;
} RECT;
Log2TFT(Adafruit_HX8357 *tft);
void begin(int);
void setTextSize(int x);
void setLinePadSize(int x);
void config(int rotation, int fontsize);
void setTextColor(unsigned short col) {textColor_ = col; }
void setBackgroundColor(unsigned short col) {bgroundColor_ = col; }
size_t write(uint8_t x);
RECT getCurrentLineBounds();
private:
void scrollAddress(uint16_t VSP);
void setupScrollArea(uint16_t TFA, uint16_t BFA);
void scroll();
Adafruit_HX8357 *tft_;
char buf_[64];
unsigned char bsize_;
unsigned char blen_;
unsigned short scrollPos_;
unsigned char charsize_;
unsigned short dwidth_, dheight_;
unsigned char yspacing_;
unsigned short textColor_;
unsigned short bgroundColor_;
};
#endif