Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TFT_eSPI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
TFT_eSPI
Commits
21811b17
Commit
21811b17
authored
Nov 11, 2018
by
Bodmer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct colour oder for ST7789 240x320 TFT
parent
beb9bb33
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
21 deletions
+31
-21
TFT_Drivers/ST7789_Rotation.h
TFT_Drivers/ST7789_Rotation.h
+31
-21
No files found.
TFT_Drivers/ST7789_Rotation.h
View file @
21811b17
...
@@ -4,39 +4,49 @@
...
@@ -4,39 +4,49 @@
rotation
=
m
%
4
;
rotation
=
m
%
4
;
switch
(
rotation
)
{
switch
(
rotation
)
{
case
0
:
// Portrait
case
0
:
// Portrait
writedata
(
TFT_MAD_RGB
);
_width
=
_init_width
;
_height
=
_init_height
;
#ifdef CGRAM_OFFSET
#ifdef CGRAM_OFFSET
writedata
(
TFT_MAD_BGR
);
colstart
=
0
;
colstart
=
0
;
rowstart
=
0
;
rowstart
=
0
;
#else
writedata
(
TFT_MAD_RGB
);
#endif
#endif
_width
=
_init_width
;
_height
=
_init_height
;
break
;
break
;
case
1
:
// Landscape (Portrait + 90)
case
1
:
// Landscape (Portrait + 90)
writedata
(
TFT_MAD_MX
|
TFT_MAD_MV
|
TFT_MAD_RGB
);
_width
=
_init_height
;
_height
=
_init_width
;
#ifdef CGRAM_OFFSET
#ifdef CGRAM_OFFSET
writedata
(
TFT_MAD_MX
|
TFT_MAD_MV
|
TFT_MAD_BGR
);
colstart
=
0
;
colstart
=
0
;
rowstart
=
0
;
rowstart
=
0
;
#else
writedata
(
TFT_MAD_MX
|
TFT_MAD_MV
|
TFT_MAD_RGB
);
#endif
#endif
_width
=
_init_height
;
_height
=
_init_width
;
break
;
break
;
case
2
:
// Inverter portrait
case
2
:
// Inverter portrait
writedata
(
TFT_MAD_MX
|
TFT_MAD_MY
|
TFT_MAD_RGB
);
_width
=
_init_width
;
_height
=
_init_height
;
#ifdef CGRAM_OFFSET
#ifdef CGRAM_OFFSET
writedata
(
TFT_MAD_MX
|
TFT_MAD_MY
|
TFT_MAD_BGR
);
colstart
=
0
;
colstart
=
0
;
rowstart
=
80
;
rowstart
=
80
;
#else
writedata
(
TFT_MAD_MX
|
TFT_MAD_MY
|
TFT_MAD_RGB
);
#endif
#endif
_width
=
_init_width
;
_height
=
_init_height
;
break
;
break
;
case
3
:
// Inverted landscape
case
3
:
// Inverted landscape
writedata
(
TFT_MAD_MV
|
TFT_MAD_MY
|
TFT_MAD_RGB
);
_width
=
_init_height
;
_height
=
_init_width
;
#ifdef CGRAM_OFFSET
#ifdef CGRAM_OFFSET
writedata
(
TFT_MAD_MV
|
TFT_MAD_MY
|
TFT_MAD_BGR
);
colstart
=
80
;
colstart
=
80
;
rowstart
=
0
;
rowstart
=
0
;
#else
writedata
(
TFT_MAD_MV
|
TFT_MAD_MY
|
TFT_MAD_RGB
);
#endif
#endif
_width
=
_init_height
;
_height
=
_init_width
;
break
;
break
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment