Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Miosix GUI library - mxgui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
Third Party
Miosix GUI library - mxgui
Commits
c0a3a66b
Commit
c0a3a66b
authored
1 year ago
by
Federico
Browse files
Options
Downloads
Patches
Plain Diff
Formatting and made Transaction noncopyable
parent
1f31a78b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/display_st25dvdiscovery.cpp
+29
-17
29 additions, 17 deletions
drivers/display_st25dvdiscovery.cpp
drivers/display_st25dvdiscovery.h
+3
-1
3 additions, 1 deletion
drivers/display_st25dvdiscovery.h
with
32 additions
and
18 deletions
drivers/display_st25dvdiscovery.cpp
+
29
−
17
View file @
c0a3a66b
...
...
@@ -112,12 +112,12 @@ DisplayImpl& DisplayImpl::instance()
void
DisplayImpl
::
doTurnOn
()
{
sendCmd
(
0x29
,
0
);
//LCD_DISPLAY_ON
}
;
}
void
DisplayImpl
::
doTurnOff
()
{
sendCmd
(
0x28
,
0
);
//LCD_DISPLAY_ON
}
;
}
void
DisplayImpl
::
doSetBrightness
(
int
brt
)
{
...
...
@@ -129,19 +129,23 @@ pair<short int, short int> DisplayImpl::doGetSize() const
return
make_pair
(
height
,
width
);
}
void
DisplayImpl
::
write
(
Point
p
,
const
char
*
text
)
{
void
DisplayImpl
::
write
(
Point
p
,
const
char
*
text
)
{
font
.
draw
(
*
this
,
textColor
,
p
,
text
);
}
void
DisplayImpl
::
clippedWrite
(
Point
p
,
Point
a
,
Point
b
,
const
char
*
text
)
{
void
DisplayImpl
::
clippedWrite
(
Point
p
,
Point
a
,
Point
b
,
const
char
*
text
)
{
font
.
clippedDraw
(
*
this
,
textColor
,
p
,
a
,
b
,
text
);
}
void
DisplayImpl
::
clear
(
Color
color
)
{
void
DisplayImpl
::
clear
(
Color
color
)
{
clear
(
Point
(
0
,
0
),
Point
(
width
-
1
,
height
-
1
),
color
);
}
void
DisplayImpl
::
clear
(
Point
p1
,
Point
p2
,
Color
color
)
{
void
DisplayImpl
::
clear
(
Point
p1
,
Point
p2
,
Color
color
)
{
unsigned
char
lsb
=
color
&
0xFF
;
unsigned
char
msb
=
(
color
>>
8
)
&
0xFF
;
...
...
@@ -150,7 +154,8 @@ void DisplayImpl::clear(Point p1, Point p2, Color color) {
Transaction
t
(
0x2c
);
//Send data to write on GRAM
for
(
int
i
=
0
;
i
<
numPixels
;
i
++
)
{
for
(
int
i
=
0
;
i
<
numPixels
;
i
++
)
{
t
.
write
(
msb
);
t
.
write
(
lsb
);
}
...
...
@@ -188,7 +193,8 @@ void DisplayImpl::scanLine(Point p, const Color *colors, unsigned short length)
}
}
Color
*
DisplayImpl
::
getScanLineBuffer
()
{
Color
*
DisplayImpl
::
getScanLineBuffer
()
{
if
(
buffer
==
0
)
buffer
=
new
Color
[
getWidth
()];
return
buffer
;
}
...
...
@@ -223,28 +229,34 @@ void DisplayImpl::drawImage(Point p, const ImageBase& img)
t
.
write
(
lsb
);
}
}
else
{
img
.
draw
(
*
this
,
p
);
}
else
img
.
draw
(
*
this
,
p
);
}
void
DisplayImpl
::
clippedDrawImage
(
Point
p
,
Point
a
,
Point
b
,
const
ImageBase
&
img
)
{
void
DisplayImpl
::
clippedDrawImage
(
Point
p
,
Point
a
,
Point
b
,
const
ImageBase
&
img
)
{
img
.
clippedDraw
(
*
this
,
p
,
a
,
b
);
}
void
DisplayImpl
::
drawRectangle
(
Point
a
,
Point
b
,
Color
c
)
{
void
DisplayImpl
::
drawRectangle
(
Point
a
,
Point
b
,
Color
c
)
{
line
(
a
,
Point
(
b
.
x
(),
a
.
y
()),
c
);
line
(
Point
(
b
.
x
(),
a
.
y
()),
b
,
c
);
line
(
b
,
Point
(
a
.
x
(),
b
.
y
()),
c
);
line
(
Point
(
a
.
x
(),
b
.
y
()),
a
,
c
);
}
DisplayImpl
::
pixel_iterator
DisplayImpl
::
begin
(
Point
p1
,
Point
p2
,
IteratorDirection
d
)
{
if
(
p1
.
x
()
<
0
||
p1
.
y
()
<
0
||
p2
.
x
()
<
0
||
p2
.
y
()
<
0
)
{
DisplayImpl
::
pixel_iterator
DisplayImpl
::
begin
(
Point
p1
,
Point
p2
,
IteratorDirection
d
)
{
if
(
p1
.
x
()
<
0
||
p1
.
y
()
<
0
||
p2
.
x
()
<
0
||
p2
.
y
()
<
0
)
{
return
pixel_iterator
();
}
if
(
p1
.
x
()
>=
width
||
p1
.
y
()
>=
height
||
p2
.
x
()
>=
width
||
p2
.
y
()
>=
height
)
{
if
(
p1
.
x
()
>=
width
||
p1
.
y
()
>=
height
||
p2
.
x
()
>=
width
||
p2
.
y
()
>=
height
)
{
return
pixel_iterator
();
}
if
(
p2
.
x
()
<
p1
.
x
()
||
p2
.
y
()
<
p1
.
y
())
{
if
(
p2
.
x
()
<
p1
.
x
()
||
p2
.
y
()
<
p1
.
y
())
{
return
pixel_iterator
();
}
...
...
@@ -318,7 +330,7 @@ DisplayImpl::DisplayImpl() : buffer(0)
DisplayImpl
::~
DisplayImpl
()
{
if
(
buffer
)
delete
[]
buffer
;
}
;
}
}
...
...
This diff is collapsed.
Click to expand it.
drivers/display_st25dvdiscovery.h
+
3
−
1
View file @
c0a3a66b
...
...
@@ -64,6 +64,8 @@ public:
Transaction
(
unsigned
char
cmd
);
void
write
(
unsigned
char
c
);
~
Transaction
();
Transaction
(
const
Transaction
&
)
=
delete
;
Transaction
&
operator
=
(
const
Transaction
&
)
=
delete
;
};
class
DisplayImpl
:
public
Display
...
...
@@ -375,7 +377,7 @@ private:
{
#ifdef MXGUI_ORIENTATION_VERTICAL
// p3 is p2 transposed relative to p1. So that the column and page addresses exchanges
Point
p3
=
Point
(
p1
.
x
()
+
p2
.
y
()
-
p1
.
y
(),
p1
.
y
()
+
p2
.
x
()
-
p1
.
x
());
Point
p3
(
p1
.
x
()
+
p2
.
y
()
-
p1
.
y
(),
p1
.
y
()
+
p2
.
x
()
-
p1
.
x
());
window
(
p1
,
p3
);
sendCmd
(
0x36
,
1
,
0x28
);
//LCD_MAC
#elif defined MXGUI_ORIENTATION_HORIZONTAL
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment