Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
stm32f4-hal
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
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
Per Lindgren
stm32f4-hal
Commits
5b1dfe92
Commit
5b1dfe92
authored
7 years ago
by
Per Lindgren
Browse files
Options
Downloads
Patches
Plain Diff
dma Stream 5
parent
5abf299b
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
src/dma.rs
+47
-9
47 additions, 9 deletions
src/dma.rs
with
47 additions
and
9 deletions
src/dma.rs
+
47
−
9
View file @
5b1dfe92
...
...
@@ -167,15 +167,53 @@ pub mod dma1 {
pub
struct
Streams
(
pub
S4
<
C0
>
,
pub
S5
<
C0
>
);
//
impl
{
//
pub fn listen(&mut self, event: Event) {
//
match event {
//
Event::HalfTransfer => self.ccr().modify(|_, w| w.htie().set_bit()),
//
Event::TransferComplete => {
impl
<
CHANNEL
>
S5
<
CHANNEL
>
{
pub
fn
listen
(
&
mut
self
,
event
:
Event
)
{
match
event
{
Event
::
HalfTransfer
=>
(),
//
self.ccr().modify(|_, w| w.htie().set_bit()),
Event
::
TransferComplete
=>
{
// self.ccr().modify(|_, w| w.tcie().set_bit())
// }
// }
// }
}
}
}
}
// hifcr high interrupt flag clear register
// hisr high interrupt status register
// lifcr low interrupt flag clear register
// lisr low interrupt status register
impl
<
CHANNEL
>
S5
<
CHANNEL
>
{
// sXcr stream x configuration register
pub
(
crate
)
fn
cr
(
&
mut
self
)
->
&
dma2
::
S5CR
{
unsafe
{
&
(
*
DMA1
::
ptr
())
.s5cr
}
}
// sXfcr stream x FIFO control register
pub
(
crate
)
fn
fcr
(
&
mut
self
)
->
&
dma2
::
S5FCR
{
unsafe
{
&
(
*
DMA1
::
ptr
())
.s5fcr
}
}
// sXm0ar stream x memory 0 address register
pub
(
crate
)
fn
m0ar
(
&
mut
self
)
->
&
dma2
::
S5M0AR
{
unsafe
{
&
(
*
DMA1
::
ptr
())
.s5m0ar
}
}
// sXm1ar stream x memory 0 address register
pub
(
crate
)
fn
m1ar
(
&
mut
self
)
->
&
dma2
::
S5M1AR
{
unsafe
{
&
(
*
DMA1
::
ptr
())
.s5m1ar
}
}
// sXndtr stream x number of data register
pub
(
crate
)
fn
ndtr
(
&
mut
self
)
->
&
dma2
::
S5NDTR
{
unsafe
{
&
(
*
DMA1
::
ptr
())
.s5ndtr
}
}
// s0par stream x peripheral address register
pub
(
crate
)
fn
par
(
&
mut
self
)
->
&
dma2
::
S5PAR
{
unsafe
{
&
(
*
DMA1
::
ptr
())
.s5par
}
}
}
impl
DmaExt
for
DMA1
{
type
Streams
=
Streams
;
...
...
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