Skip to content

Commit 89a1346

Browse files
committed
docs: Update PWM waveform function documentation for data alignment
1 parent cbc7a9f commit 89a1346

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

embassy-stm32/src/timer/simple_pwm.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,10 @@ macro_rules! impl_waveform_chx {
365365
/// Generate a sequence of PWM waveform
366366
///
367367
/// Note:
368-
/// you will need to provide corresponding TIMx_CHy DMA channel to use this method.
368+
/// 1. you will need to provide corresponding TIMx_CHy DMA channel to use this method.
369+
/// 2. Please make sure the duty data length is aligned to the timer data width(16-bit or 32-bit).
370+
/// 3. Please notice the endianess of the duty data. STM32 use little endian,
371+
/// for example, 0x12345678 as u32 will be stored as [0x78, 0x56, 0x34, 0x12] in memory.
369372
pub async fn $fn_name(&mut self, dma: impl Peripheral<P = impl super::$dma_ch<T>>, duty: &[u8]) {
370373
use crate::pac::timer::vals::Ccds;
371374

0 commit comments

Comments
 (0)