Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rust-card10
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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Danilo
rust-card10
Commits
d5074b38
Commit
d5074b38
authored
5 years ago
by
Astro
Browse files
Options
Downloads
Patches
Plain Diff
lcd
parent
d8b322ea
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
card10/src/lcd.rs
+30
-0
30 additions, 0 deletions
card10/src/lcd.rs
card10/src/lib.rs
+2
-0
2 additions, 0 deletions
card10/src/lib.rs
watchapp/src/main.rs
+17
-2
17 additions, 2 deletions
watchapp/src/main.rs
with
49 additions
and
2 deletions
card10/src/lcd.rs
0 → 100644
+
30
−
0
View file @
d5074b38
#[link(name
=
"card10"
)]
extern
{
fn
LCD_SetBacklight
(
brightness
:
usize
);
fn
LCD_Clear
(
color
:
usize
);
fn
LCD_ClearWindow
(
xstart
:
usize
,
ystart
:
usize
,
xend
:
usize
,
yend
:
usize
,
color
:
usize
);
fn
LCD_SetWindowColor
(
xstart
:
usize
,
ystart
:
usize
,
xend
:
usize
,
yend
:
usize
,
color
:
usize
);
fn
LCD_SetUWORD
(
x
:
usize
,
y
:
usize
,
color
:
usize
);
fn
LCD_Update
();
}
pub
const
W
:
usize
=
160
;
pub
const
H
:
usize
=
80
;
pub
fn
set_backlight
(
brightness
:
usize
)
{
unsafe
{
LCD_SetBacklight
(
brightness
);
}
}
pub
fn
put_pixel
(
x
:
usize
,
y
:
usize
,
color
:
usize
)
{
unsafe
{
LCD_SetUWORD
(
x
,
y
,
color
);
}
}
pub
fn
update
()
{
unsafe
{
LCD_Update
();
}
}
This diff is collapsed.
Click to expand it.
card10/src/lib.rs
+
2
−
0
View file @
d5074b38
...
@@ -4,6 +4,8 @@ pub use max32665;
...
@@ -4,6 +4,8 @@ pub use max32665;
pub
use
cortex_m_rt
as
_
;
pub
use
cortex_m_rt
as
_
;
pub
use
cortex_m_rt
::
entry
;
pub
use
cortex_m_rt
::
entry
;
pub
mod
lcd
;
#[link(name
=
"card10"
)]
#[link(name
=
"card10"
)]
extern
{
extern
{
fn
card10_init
();
fn
card10_init
();
...
...
This diff is collapsed.
Click to expand it.
watchapp/src/main.rs
+
17
−
2
View file @
d5074b38
...
@@ -2,12 +2,27 @@
...
@@ -2,12 +2,27 @@
#![no_main]
#![no_main]
use
panic_abort
as
_
;
use
panic_abort
as
_
;
use
card10
::
entry
;
use
card10
::
{
entry
,
lcd
}
;
#[entry]
#[entry]
fn
main
()
->
!
{
fn
main
()
->
!
{
card10
::
init
();
card10
::
init
();
panic!
(
"TODO"
);
lcd
::
set_backlight
(
1000
);
let
mut
t
=
0
;
loop
{
for
x
in
0
..
lcd
::
W
{
for
y
in
0
..
lcd
::
H
{
if
(((
x
-
2
*
t
)
/
8
)
+
((
y
+
t
)
/
8
))
%
2
==
0
{
lcd
::
put_pixel
(
x
,
y
,
0
);
}
else
{
lcd
::
put_pixel
(
x
,
y
,
0xffff
);
}
}
}
lcd
::
update
();
t
+=
1
;
}
}
}
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