diff options
| author | Matous Hybl <[email protected]> | 2022-04-12 14:06:53 +0200 |
|---|---|---|
| committer | Matous Hybl <[email protected]> | 2022-04-25 14:30:43 +0200 |
| commit | 945fa0871f03a1db9a9be16e92346d62825decdd (patch) | |
| tree | ca867531d8a4670b39f24e7afa6bd9c739cf7225 /embassy-stm32/src/dma/mod.rs | |
| parent | a1746f4ddac734cd8912007b6155ca340df89f19 (diff) | |
Implement giant (chunked) DMA transfers for DCMI.
Diffstat (limited to 'embassy-stm32/src/dma/mod.rs')
| -rw-r--r-- | embassy-stm32/src/dma/mod.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/embassy-stm32/src/dma/mod.rs b/embassy-stm32/src/dma/mod.rs index 8e9823772..f96ccbf6e 100644 --- a/embassy-stm32/src/dma/mod.rs +++ b/embassy-stm32/src/dma/mod.rs | |||
| @@ -76,6 +76,25 @@ pub(crate) mod sealed { | |||
| 76 | options: TransferOptions, | 76 | options: TransferOptions, |
| 77 | ); | 77 | ); |
| 78 | 78 | ||
| 79 | /// DMA double-buffered mode is unsafe as UB can happen when the hardware writes to a buffer currently owned by the software | ||
| 80 | /// more information can be found here: https://github.com/embassy-rs/embassy/issues/702 | ||
| 81 | /// This feature is now used solely for the purposes of implementing giant DMA transfers required for DCMI | ||
| 82 | unsafe fn start_double_buffered_read<W: super::Word>( | ||
| 83 | &mut self, | ||
| 84 | request: Request, | ||
| 85 | reg_addr: *const W, | ||
| 86 | buffer0: *mut W, | ||
| 87 | buffer1: *mut W, | ||
| 88 | buffer_len: usize, | ||
| 89 | options: TransferOptions, | ||
| 90 | ); | ||
| 91 | |||
| 92 | unsafe fn set_buffer0<W: super::Word>(&mut self, buffer: *mut W); | ||
| 93 | |||
| 94 | unsafe fn set_buffer1<W: super::Word>(&mut self, buffer: *mut W); | ||
| 95 | |||
| 96 | unsafe fn is_buffer0_accessible(&mut self) -> bool; | ||
| 97 | |||
| 79 | /// Requests the channel to stop. | 98 | /// Requests the channel to stop. |
| 80 | /// NOTE: The channel does not immediately stop, you have to wait | 99 | /// NOTE: The channel does not immediately stop, you have to wait |
| 81 | /// for `is_running() = false`. | 100 | /// for `is_running() = false`. |
