diff options
| author | JuliDi <[email protected]> | 2023-06-28 15:21:24 +0200 |
|---|---|---|
| committer | JuliDi <[email protected]> | 2023-06-28 15:21:24 +0200 |
| commit | 27a89019adaebfd1916d3b71dde1db3a6a768883 (patch) | |
| tree | 51ed3e3d1bbb54379257913fa7bb0f6ef7764bd9 /examples | |
| parent | 91c31d5e437b510af3c535f5e597881042563496 (diff) | |
add doc
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/stm32l4/src/bin/dac_dma.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/stm32l4/src/bin/dac_dma.rs b/examples/stm32l4/src/bin/dac_dma.rs index 81e6a58e4..aefc8412f 100644 --- a/examples/stm32l4/src/bin/dac_dma.rs +++ b/examples/stm32l4/src/bin/dac_dma.rs | |||
| @@ -52,6 +52,8 @@ async fn dac_task1(dac: &'static mut Dac1Type<'static>) { | |||
| 52 | 52 | ||
| 53 | info!("TIM6 frequency is {}", TIM6::frequency()); | 53 | info!("TIM6 frequency is {}", TIM6::frequency()); |
| 54 | const FREQUENCY: Hertz = Hertz::hz(200); | 54 | const FREQUENCY: Hertz = Hertz::hz(200); |
| 55 | |||
| 56 | // Compute the reload value such that we obtain the FREQUENCY for the sine | ||
| 55 | let reload: u32 = (TIM6::frequency().0 / FREQUENCY.0) / data.len() as u32; | 57 | let reload: u32 = (TIM6::frequency().0 / FREQUENCY.0) / data.len() as u32; |
| 56 | 58 | ||
| 57 | // Depends on your clock and on the specific chip used, you may need higher or lower values here | 59 | // Depends on your clock and on the specific chip used, you may need higher or lower values here |
