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
f3135aea
Commit
f3135aea
authored
Oct 07, 2021
by
Dave Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changing the rotation file so that text is not flipped. Rotation values from
the ILI9486 driver work well with this
parent
9e64092f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
25 deletions
+46
-25
TFT_Drivers/HX8357D_Rotation.h
TFT_Drivers/HX8357D_Rotation.h
+46
-25
No files found.
TFT_Drivers/HX8357D_Rotation.h
View file @
f3135aea
// This is the command sequence that rotates the
ILI9481
driver coordinate frame
// This is the command sequence that rotates the
HX8357D
driver coordinate frame
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
;
}
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
;
}
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