Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rtic_f4xx_nucleo
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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Edvin Åkerfeldt
rtic_f4xx_nucleo
Commits
b875d605
Commit
b875d605
authored
Dec 9, 2020
by
Edvin Åkerfeldt
Browse files
Options
Downloads
Patches
Plain Diff
??
parent
805bf5b5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/dsi_debug.rs
+46
-12
46 additions, 12 deletions
examples/dsi_debug.rs
with
46 additions
and
12 deletions
examples/dsi_debug.rs
+
46
−
12
View file @
b875d605
...
...
@@ -10,8 +10,15 @@ use stm32f4;
use
stm32f4
::
stm32f413
::
GPIOA
;
//use stm32f411::{GPIOA, RCC};
//const bit_string: u16 = 0x0FFF;
const
bit_string
:
u16
=
0xF000
;
//const bit_string: u16 = 0x0;
//const bit_string: u16 = 0xFFFF;
const
bit_string
:
u16
=
0x0FFF
;
//actual string 0b1_01111101_1111
//const bit_s: u32 = 0b10_0110101010100110_10101010; // Start stop high 26 bits (start pos 25)
//const bit_s: u32 = 0b01_0110101010100110_01010101; // Start stop low
const
bit_s
:
u32
=
0b10_0101010101010101_10101010
;
//const bit_string: u16 = 0xF000;
/*(
0x0FFF full
0 11111111 1111
...
...
@@ -55,8 +62,9 @@ const APP: () = {
// configure PA5 as output
let
gpioa
=
cx
.device.GPIOA
;
gpioa
.moder
.modify
(|
_
,
w
|
unsafe
{
w
.moder5
()
.bits
(
1
)
});
gpioa
.moder
.modify
(|
_
,
w
|
unsafe
{
w
.moder6
()
.bits
(
1
)
});
let
mut
point
:
u16
=
0x0
;
let
mut
point
:
u16
=
25
;
init
::
LateResources
{
dwt
:
cx
.core.DWT
,
...
...
@@ -81,16 +89,35 @@ const APP: () = {
#[task(binds
=
SysTick,
resources
=
[
ON,
point]
,)]
fn
syst
(
cx
:
syst
::
Context
)
{
let
r
=
cx
.resources
;
if
*
r
.point
!=
0
{
let
m
=
bit_s
>>
*
r
.point
&
0x1
;
unsafe
{
if
m
==
1
{
(
*
GPIOA
::
ptr
())
.odr
.modify
(|
_
,
w
|
w
.odr5
()
.bit
(
true
));
}
else
{
(
*
GPIOA
::
ptr
())
.odr
.modify
(|
_
,
w
|
w
.odr5
()
.bit
(
false
));
}
}
*
r
.point
=
*
r
.point
-
1
;
}
else
{
unsafe
{
(
*
GPIOA
::
ptr
())
.odr
.modify
(|
_
,
w
|
w
.odr5
()
.bit
(
false
));
}
}
/*
let r = cx.resources;
*r.ON = !*r.ON;
if *r.ON == true {
if
*
r
.point
==
15
{
*
r
.point
=
0
;
if *r.point ==
2
{
} else {
*
r
.point
=
*
r
.point
+
1
;
*r.point = *r.point
-
1;
}
}
let
bit
:
u16
=
(
bit_string
&
(
0x8000
>>
*
r
.point
))
>>
(
15
-
*
r
.point
);
let bit: u16 = (bit_string >> *r.point) & 0x1;
//let bit: u16 = (bit_string & (0x8000 >> *r.point)) >> (15 - *r.point);
let t: u16 = bit ^ (*r.ON as u16);
let mut wr: bool;
if t == 1 {
...
...
@@ -100,11 +127,18 @@ const APP: () = {
} else {
panic!();
}
wr
=
*
r
.ON
;
if *r.point == 2 {
unsafe {
(*GPIOA::ptr()).odr.modify(|_, w| w.odr6().bit(false)); // output clock on PA6
(*GPIOA::ptr()).odr.modify(|_, w| w.odr5().bit(false));
}
} else {
unsafe {
(*GPIOA::ptr()).odr.modify(|_, w| w.odr5().bit(wr));
(*GPIOA::ptr()).odr.modify(|_, w| w.odr6().bit(*r.ON)); // output clock on PA6
}
}
*/
//rprintln!(*r.point);
//rprintln!("SysTick");
//asm::bkpt();
...
...
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