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
aa7bad45
Unverified
Commit
aa7bad45
authored
Nov 05, 2021
by
Bodmer
Committed by
GitHub
Nov 05, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1356 from DaveBben/hx8357D-rotation
Fix HX8375D rotation values
parents
0ad6de91
f3135aea
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 @
aa7bad45
// 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
);
writecommand
(
TFT_MADCTL
);
rotation
=
m
%
4
;
rotation
=
m
%
8
;
switch
(
rotation
)
{
switch
(
rotation
)
case
0
:
// Portrait
{
writedata
(
TFT_MAD_MX
|
TFT_MAD_MY
|
TFT_MAD_RGB
);
case
0
:
// Portrait
_width
=
TFT_WIDTH
;
writedata
(
TFT_MAD_BGR
|
TFT_MAD_MX
);
_height
=
TFT_HEIGHT
;
_width
=
_init_width
;
break
;
_height
=
_init_height
;
case
1
:
// Landscape (Portrait + 90)
break
;
writedata
(
TFT_MAD_MV
|
TFT_MAD_MY
|
TFT_MAD_RGB
);
case
1
:
// Landscape (Portrait + 90)
_width
=
TFT_HEIGHT
;
writedata
(
TFT_MAD_BGR
|
TFT_MAD_MV
);
_height
=
TFT_WIDTH
;
_width
=
_init_height
;
break
;
_height
=
_init_width
;
case
2
:
// Inverter portrait
break
;
writedata
(
TFT_MAD_RGB
);
case
2
:
// Inverter portrait
_width
=
TFT_WIDTH
;
writedata
(
TFT_MAD_BGR
|
TFT_MAD_MY
);
_height
=
TFT_HEIGHT
;
_width
=
_init_width
;
break
;
_height
=
_init_height
;
case
3
:
// Inverted landscape
break
;
writedata
(
TFT_MAD_MX
|
TFT_MAD_MV
|
TFT_MAD_RGB
);
case
3
:
// Inverted landscape
_width
=
TFT_HEIGHT
;
writedata
(
TFT_MAD_BGR
|
TFT_MAD_MV
|
TFT_MAD_MX
|
TFT_MAD_MY
);
_height
=
TFT_WIDTH
;
_width
=
_init_height
;
break
;
_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