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
ec504067
Commit
ec504067
authored
Feb 26, 2022
by
Bodmer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Bodmer/TFT_eSPI
parents
b6708b65
d50b7f6c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
45 deletions
+24
-45
TFT_Drivers/HX8357D_Rotation.h
TFT_Drivers/HX8357D_Rotation.h
+24
-45
No files found.
TFT_Drivers/HX8357D_Rotation.h
View file @
ec504067
// This is the command sequence that rotates the HX8357D driver coordinate frame
writecommand
(
TFT_MADCTL
);
rotation
=
m
%
8
;
switch
(
rotation
)
{
case
0
:
// Portrait
writedata
(
TFT_MAD_BGR
|
TFT_MAD_MX
);
_width
=
_init_width
;
_height
=
_init_height
;
break
;
case
1
:
// Landscape (Portrait + 90)
writedata
(
TFT_MAD_BGR
|
TFT_MAD_MV
);
_width
=
_init_height
;
_height
=
_init_width
;
break
;
case
2
:
// Inverter portrait
writedata
(
TFT_MAD_BGR
|
TFT_MAD_MY
);
_width
=
_init_width
;
_height
=
_init_height
;
break
;
case
3
:
// Inverted landscape
writedata
(
TFT_MAD_BGR
|
TFT_MAD_MV
|
TFT_MAD_MX
|
TFT_MAD_MY
);
_width
=
_init_height
;
_height
=
_init_width
;
break
;
case
4
:
// Portrait
writedata
(
TFT_MAD_BGR
|
TFT_MAD_MX
|
TFT_MAD_MY
);
_width
=
_init_width
;
_height
=
_init_height
;
break
;
case
5
:
// Landscape (Portrait + 90)
writedata
(
TFT_MAD_BGR
|
TFT_MAD_MV
|
TFT_MAD_MX
);
_width
=
_init_height
;
_height
=
_init_width
;
break
;
case
6
:
// Inverter portrait
writedata
(
TFT_MAD_BGR
);
_width
=
_init_width
;
_height
=
_init_height
;
break
;
case
7
:
// Inverted landscape
writedata
(
TFT_MAD_BGR
|
TFT_MAD_MV
|
TFT_MAD_MY
);
_width
=
_init_height
;
_height
=
_init_width
;
break
;
}
writecommand
(
TFT_MADCTL
);
rotation
=
m
%
4
;
switch
(
rotation
)
{
case
0
:
// Portrait
writedata
(
TFT_MAD_MX
|
TFT_MAD_MY
|
TFT_MAD_RGB
);
_width
=
TFT_WIDTH
;
_height
=
TFT_HEIGHT
;
break
;
case
1
:
// Landscape (Portrait + 90)
writedata
(
TFT_MAD_MV
|
TFT_MAD_MY
|
TFT_MAD_RGB
);
_width
=
TFT_HEIGHT
;
_height
=
TFT_WIDTH
;
break
;
case
2
:
// Inverter portrait
writedata
(
TFT_MAD_RGB
);
_width
=
TFT_WIDTH
;
_height
=
TFT_HEIGHT
;
break
;
case
3
:
// Inverted landscape
writedata
(
TFT_MAD_MX
|
TFT_MAD_MV
|
TFT_MAD_RGB
);
_width
=
TFT_HEIGHT
;
_height
=
TFT_WIDTH
;
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