aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2023-12-21 09:36:38 +0000
committerGitHub <[email protected]>2023-12-21 09:36:38 +0000
commit8442e72589f47182f8ca1c979c668afc800e5d1e (patch)
tree9b1bde2878cdd102687c3bbe8e68ca7a7ea0c2b5
parentd832d45c0ba5f2624a5f5c1e549e2d7fe8bd0e01 (diff)
parent745d618ab7f40f518c25d8db2116cfd774c16623 (diff)
Merge pull request #2338 from eZioPan/note-on-circular-dma
docs: add a note about circular mode DMA
-rw-r--r--embassy-stm32/src/dma/bdma.rs4
-rw-r--r--embassy-stm32/src/dma/dma.rs4
2 files changed, 8 insertions, 0 deletions
diff --git a/embassy-stm32/src/dma/bdma.rs b/embassy-stm32/src/dma/bdma.rs
index 2f37b1edf..a2b83716d 100644
--- a/embassy-stm32/src/dma/bdma.rs
+++ b/embassy-stm32/src/dma/bdma.rs
@@ -23,6 +23,10 @@ use crate::pac::bdma::{regs, vals};
23#[non_exhaustive] 23#[non_exhaustive]
24pub struct TransferOptions { 24pub struct TransferOptions {
25 /// Enable circular DMA 25 /// Enable circular DMA
26 ///
27 /// Note:
28 /// If you enable circular mode manually, you may want to build and `.await` the `Transfer` in a separate task.
29 /// Since DMA in circular mode need manually stop, `.await` in current task would block the task forever.
26 pub circular: bool, 30 pub circular: bool,
27 /// Enable half transfer interrupt 31 /// Enable half transfer interrupt
28 pub half_transfer_ir: bool, 32 pub half_transfer_ir: bool,
diff --git a/embassy-stm32/src/dma/dma.rs b/embassy-stm32/src/dma/dma.rs
index 9b47ca5c3..16d02f273 100644
--- a/embassy-stm32/src/dma/dma.rs
+++ b/embassy-stm32/src/dma/dma.rs
@@ -30,6 +30,10 @@ pub struct TransferOptions {
30 /// FIFO threshold for DMA FIFO mode. If none, direct mode is used. 30 /// FIFO threshold for DMA FIFO mode. If none, direct mode is used.
31 pub fifo_threshold: Option<FifoThreshold>, 31 pub fifo_threshold: Option<FifoThreshold>,
32 /// Enable circular DMA 32 /// Enable circular DMA
33 ///
34 /// Note:
35 /// If you enable circular mode manually, you may want to build and `.await` the `Transfer` in a separate task.
36 /// Since DMA in circular mode need manually stop, `.await` in current task would block the task forever.
33 pub circular: bool, 37 pub circular: bool,
34 /// Enable half transfer interrupt 38 /// Enable half transfer interrupt
35 pub half_transfer_ir: bool, 39 pub half_transfer_ir: bool,