Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stud-support
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Veronika Kolářová
stud-support
Commits
0c81312d
Commit
0c81312d
authored
4 years ago
by
Pavel Pisa
Browse files
Options
Downloads
Patches
Plain Diff
seminaries/mzapo/lcd/mzapo_lcdip: add reset parameter to cause LCD controller HW reset.
Signed-off-by:
Pavel Pisa
<
pisa@cmp.felk.cvut.cz
>
parent
0a181b66
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
seminaries/mzapo/lcd/mzapo_lcdip/mzapo_lcdip.c
+19
-0
19 additions, 0 deletions
seminaries/mzapo/lcd/mzapo_lcdip/mzapo_lcdip.c
with
19 additions
and
0 deletions
seminaries/mzapo/lcd/mzapo_lcdip/mzapo_lcdip.c
+
19
−
0
View file @
0c81312d
...
...
@@ -52,6 +52,7 @@ char *memdev="/dev/mem";
#define PARLCD_REG_BASE_PHYS 0x43c00000
#define PARLCD_REG_SIZE 0x00004000
#define PARLCD_REG_CR_o 0x0000
#define PARLCD_REG_CMD_o 0x0008
#define PARLCD_REG_DATA_o 0x000C
...
...
@@ -85,6 +86,11 @@ void *map_phys_address(off_t region_base, size_t region_size, int opt_cached)
return
mem
;
}
void
parlcd_write_cr
(
unsigned
char
*
parlcd_mem_base
,
uint16_t
data
)
{
*
(
volatile
uint16_t
*
)(
parlcd_mem_base
+
PARLCD_REG_CR_o
)
=
data
;
}
void
parlcd_write_cmd
(
unsigned
char
*
parlcd_mem_base
,
uint16_t
cmd
)
{
*
(
volatile
uint16_t
*
)(
parlcd_mem_base
+
PARLCD_REG_CMD_o
)
=
cmd
;
...
...
@@ -377,6 +383,12 @@ int main(int argc, char *argv[])
struct
ifaddrs
*
ifa
=
NULL
;
struct
ifaddrs
*
ifa_it
;
int
lcd_hw_reset
=
0
;
if
(
argc
>=
2
)
if
(
!
strcmp
(
argv
[
1
],
"reset"
))
lcd_hw_reset
=
1
;
if
(
getifaddrs
(
&
ifa
))
{
return
-
1
;
}
...
...
@@ -404,6 +416,13 @@ int main(int argc, char *argv[])
if
(
parlcd_mem_base
==
NULL
)
exit
(
1
);
if
(
lcd_hw_reset
)
{
parlcd_write_cr
(
parlcd_mem_base
,
2
);
parlcd_delay
(
100
);
parlcd_write_cr
(
parlcd_mem_base
,
0
);
parlcd_delay
(
100
);
}
parlcd_hx8357_init
(
parlcd_mem_base
);
parlcd_hx8357_init
(
parlcd_mem_base
);
...
...
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