Skip to content

Commit 1284fb1

Browse files
committed
TFT_MAD_...
1 parent 03929a4 commit 1284fb1

File tree

8 files changed

+71
-71
lines changed

8 files changed

+71
-71
lines changed

Arduino/libraries_esp32/tsd_setup/Setup.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010

1111
// ---------------- Constans to use in REV and ROTATION ----------------------
1212

13-
#define MAD_MY 0x80 // 00 top to botom, 80 bottom to top
14-
#define MAD_MX 0x40 // 00 left to right, 40 right to left
15-
#define MAD_YX 0x20 // it means that X and Y are exchanged, wrongly called MV
16-
//#define MAD_MV 0x10 // vertical refresh direction, wrongly called ML
17-
//#define MAD_RGB 0x00
18-
//#define MAD_BGR 0x08
19-
//#define MAD_MH 0x04 // horizontal refresh direction,
20-
#define MAD_SS 0x02 // horizontal flip
21-
#define MAD_GS 0x01 // vertical flip
13+
#define TFT_MAD_MY 0x80 // 00 top to botom, 80 bottom to top
14+
#define TFT_MAD_MX 0x40 // 00 left to right, 40 right to left
15+
#define TFT_MAD_YX 0x20 // it means that X and Y are exchanged, wrongly called MV
16+
//#define TFT_MAD_MV 0x10 // vertical refresh direction, wrongly called ML
17+
//#define TFT_MAD_RGB 0x00
18+
//#define TFT_MAD_BGR 0x08
19+
//#define TFT_MAD_MH 0x04 // horizontal refresh direction,
20+
#define TFT_MAD_SS 0x02 // horizontal flip
21+
#define TFT_MAD_GS 0x01 // vertical flip
2222

2323
// ------------------- Constants to use in examples --------------------------
2424

Arduino/libraries_esp8266/tsd_setup/Setup.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010

1111
// ---------------- Constans to use in REV and ROTATION ----------------------
1212

13-
#define MAD_MY 0x80 // 00 top to botom, 80 bottom to top
14-
#define MAD_MX 0x40 // 00 left to right, 40 right to left
15-
#define MAD_YX 0x20 // it means that X and Y are exchanged, wrongly called MV
16-
//#define MAD_MV 0x10 // vertical refresh direction, wrongly called ML
17-
//#define MAD_RGB 0x00
18-
//#define MAD_BGR 0x08
19-
//#define MAD_MH 0x04 // horizontal refresh direction,
20-
#define MAD_SS 0x02 // horizontal flip
21-
#define MAD_GS 0x01 // vertical flip
13+
#define TFT_MAD_MY 0x80 // 00 top to botom, 80 bottom to top
14+
#define TFT_MAD_MX 0x40 // 00 left to right, 40 right to left
15+
#define TFT_MAD_YX 0x20 // it means that X and Y are exchanged, wrongly called MV
16+
//#define TFT_MAD_MV 0x10 // vertical refresh direction, wrongly called ML
17+
//#define TFT_MAD_RGB 0x00
18+
//#define TFT_MAD_BGR 0x08
19+
//#define TFT_MAD_MH 0x04 // horizontal refresh direction,
20+
#define TFT_MAD_SS 0x02 // horizontal flip
21+
#define TFT_MAD_GS 0x01 // vertical flip
2222

2323
// ------------------- Constants to use in examples --------------------------
2424

Arduino/libraries_pic32/tsd_setup/Setup.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010

1111
// ---------------- Constans to use in REV and ROTATION ----------------------
1212

13-
#define MAD_MY 0x80 // 00 top to botom, 80 bottom to top
14-
#define MAD_MX 0x40 // 00 left to right, 40 right to left
15-
#define MAD_YX 0x20 // it means that X and Y are exchanged, wrongly called MV
16-
//#define MAD_MV 0x10 // vertical refresh direction, wrongly called ML
17-
//#define MAD_RGB 0x00
18-
//#define MAD_BGR 0x08
19-
//#define MAD_MH 0x04 // horizontal refresh direction,
20-
#define MAD_SS 0x02 // horizontal flip
21-
#define MAD_GS 0x01 // vertical flip
13+
#define TFT_MAD_MY 0x80 // 00 top to botom, 80 bottom to top
14+
#define TFT_MAD_MX 0x40 // 00 left to right, 40 right to left
15+
#define TFT_MAD_YX 0x20 // it means that X and Y are exchanged, wrongly called MV
16+
//#define TFT_MAD_MV 0x10 // vertical refresh direction, wrongly called ML
17+
//#define TFT_MAD_RGB 0x00
18+
//#define TFT_MAD_BGR 0x08
19+
//#define TFT_MAD_MH 0x04 // horizontal refresh direction,
20+
#define TFT_MAD_SS 0x02 // horizontal flip
21+
#define TFT_MAD_GS 0x01 // vertical flip
2222

2323
// ------------------- Constants to use in examples --------------------------
2424

Arduino/libraries_rp2040/tsd_setup/Setup.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
// ---------------- Constans to use in REV and ROTATION ----------------------
88

9-
#define MAD_MY 0x80 // 00 top to botom, 80 bottom to top
10-
#define MAD_MX 0x40 // 00 left to right, 40 right to left
11-
#define MAD_YX 0x20 // it means that X and Y are exchanged, wrongly called MV
12-
//#define MAD_MV 0x10 // vertical refresh direction, wrongly called ML
13-
//#define MAD_RGB 0x00
14-
//#define MAD_BGR 0x08
15-
//#define MAD_MH 0x04 // horizontal refresh direction,
16-
#define MAD_SS 0x02 // horizontal flip
17-
#define MAD_GS 0x01 // vertical flip
9+
#define TFT_MAD_MY 0x80 // 00 top to botom, 80 bottom to top
10+
#define TFT_MAD_MX 0x40 // 00 left to right, 40 right to left
11+
#define TFT_MAD_YX 0x20 // it means that X and Y are exchanged, wrongly called MV
12+
//#define TFT_MAD_MV 0x10 // vertical refresh direction, wrongly called ML
13+
//#define TFT_MAD_RGB 0x00
14+
//#define TFT_MAD_BGR 0x08
15+
//#define TFT_MAD_MH 0x04 // horizontal refresh direction,
16+
#define TFT_MAD_SS 0x02 // horizontal flip
17+
#define TFT_MAD_GS 0x01 // vertical flip
1818

1919
// ------------------- Constants to use in examples --------------------------
2020

Arduino/libraries_stm32/tsd_setup/Setup.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010

1111
// ---------------- Constans to use in REV and ROTATION ----------------------
1212

13-
#define MAD_MY 0x80 // 00 top to botom, 80 bottom to top
14-
#define MAD_MX 0x40 // 00 left to right, 40 right to left
15-
#define MAD_YX 0x20 // it means that X and Y are exchanged, wrongly called MV
16-
//#define MAD_MV 0x10 // vertical refresh direction, wrongly called ML
17-
//#define MAD_RGB 0x00
18-
//#define MAD_BGR 0x08
19-
//#define MAD_MH 0x04 // horizontal refresh direction,
20-
#define MAD_SS 0x02 // horizontal flip
21-
#define MAD_GS 0x01 // vertical flip
13+
#define TFT_MAD_MY 0x80 // 00 top to botom, 80 bottom to top
14+
#define TFT_MAD_MX 0x40 // 00 left to right, 40 right to left
15+
#define TFT_MAD_YX 0x20 // it means that X and Y are exchanged, wrongly called MV
16+
//#define TFT_MAD_MV 0x10 // vertical refresh direction, wrongly called ML
17+
//#define TFT_MAD_RGB 0x00
18+
//#define TFT_MAD_BGR 0x08
19+
//#define TFT_MAD_MH 0x04 // horizontal refresh direction,
20+
#define TFT_MAD_SS 0x02 // horizontal flip
21+
#define TFT_MAD_GS 0x01 // vertical flip
2222

2323
// ------------------- Constants to use in examples --------------------------
2424

media/Touch.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ bool Touch::WhereAreYou(point_t* p)
1919
if (IamHere(x, y)) {
2020
uint8_t r = reverse ^ TOUCH_ROTATION(rotation);
2121

22-
if (r & MAD_YX) {
22+
if (r & TFT_MAD_YX) {
2323
int16_t tmp = x; x = y; y = tmp;
2424
}
25-
if ((r & MAD_SS) | (r & MAD_MX)) {
25+
if ((r & TFT_MAD_SS) | (r & TFT_MAD_MX)) {
2626
x = 4095 - x;
2727
}
28-
if ((r & MAD_GS) | (r & MAD_MY)) {
28+
if ((r & TFT_MAD_GS) | (r & TFT_MAD_MY)) {
2929
y = 4095 - y;
3030
}
3131

media/Touch_Rotation.hh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ uint8_t touch_9xxx(const uint8_t rotation)
66
{
77
switch (rotation % 4) {
88
case 0:
9-
return MAD_YX | MAD_MX | MAD_MY;
9+
return TFT_MAD_YX | TFT_MAD_MX | TFT_MAD_MY;
1010
case 1:
11-
return MAD_MX;
11+
return TFT_MAD_MX;
1212
case 2:
13-
return MAD_YX;
13+
return TFT_MAD_YX;
1414
case 3:
15-
return MAD_MY;
15+
return TFT_MAD_MY;
1616
}
1717
return 0;
1818
}
@@ -21,13 +21,13 @@ uint8_t touch_9488_1(const uint8_t rotation)
2121
{
2222
switch (rotation % 4) {
2323
case 0:
24-
return MAD_MY;
24+
return TFT_MAD_MY;
2525
case 1:
26-
return MAD_YX | MAD_MX | MAD_MY;
26+
return TFT_MAD_YX | TFT_MAD_MX | TFT_MAD_MY;
2727
case 2:
28-
return MAD_MX;
28+
return TFT_MAD_MX;
2929
case 3:
30-
return MAD_YX;
30+
return TFT_MAD_YX;
3131
}
3232
return 0;
3333
}
@@ -36,13 +36,13 @@ uint8_t touch_7789(const uint8_t rotation)
3636
{
3737
switch (rotation % 4) {
3838
case 0:
39-
return MAD_YX | MAD_MX;
39+
return TFT_MAD_YX | TFT_MAD_MX;
4040
case 1:
4141
return 0;
4242
case 2:
43-
return MAD_YX | MAD_MY;
43+
return TFT_MAD_YX | TFT_MAD_MY;
4444
case 3:
45-
return MAD_MX | MAD_MY;
45+
return TFT_MAD_MX | TFT_MAD_MY;
4646
}
4747
return 0;
4848
}
@@ -51,11 +51,11 @@ uint8_t touch_7796(const uint8_t rotation)
5151
{
5252
switch (rotation % 4) {
5353
case 0:
54-
return MAD_YX | MAD_MY;
54+
return TFT_MAD_YX | TFT_MAD_MY;
5555
case 1:
56-
return MAD_MY | MAD_MX;
56+
return TFT_MAD_MY | TFT_MAD_MX;
5757
case 2:
58-
return MAD_YX | MAD_MX;
58+
return TFT_MAD_YX | TFT_MAD_MX;
5959
case 3:
6060
return 0;
6161
}

pico-sdk/libs/setup/Setup.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
// ---------------- Constans to use in REV and ROTATION ----------------------
1010

11-
#define MAD_MY 0x80 // 00 top to botom, 80 bottom to top
12-
#define MAD_MX 0x40 // 00 left to right, 40 right to left
13-
#define MAD_YX 0x20 // it means that X and Y are exchanged, wrongly called MV
14-
//#define MAD_MV 0x10 // vertical refresh direction, wrongly called ML
15-
//#define MAD_RGB 0x00
16-
//#define MAD_BGR 0x08
17-
//#define MAD_MH 0x04 // horizontal refresh direction,
18-
#define MAD_SS 0x02 // horizontal flip
19-
#define MAD_GS 0x01 // vertical flip
11+
#define TFT_MAD_MY 0x80 // 00 top to botom, 80 bottom to top
12+
#define TFT_MAD_MX 0x40 // 00 left to right, 40 right to left
13+
#define TFT_MAD_YX 0x20 // it means that X and Y are exchanged, wrongly called MV
14+
//#define TFT_MAD_MV 0x10 // vertical refresh direction, wrongly called ML
15+
//#define TFT_MAD_RGB 0x00
16+
//#define TFT_MAD_BGR 0x08
17+
//#define TFT_MAD_MH 0x04 // horizontal refresh direction,
18+
#define TFT_MAD_SS 0x02 // horizontal flip
19+
#define TFT_MAD_GS 0x01 // vertical flip
2020

2121
// ------------------- Constants to use in examples --------------------------
2222

0 commit comments

Comments
 (0)