aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src
diff options
context:
space:
mode:
authorxoviat <[email protected]>2025-12-09 20:03:13 +0000
committerGitHub <[email protected]>2025-12-09 20:03:13 +0000
commitcf069b3e4e6a02660893ef8014e4ab69df6d46e0 (patch)
tree680ced0d79b26e3cce48a81ee81e05d4c9761da7 /embassy-stm32/src
parent337e6e264e27908356ec65a80bf3ea779c01b7ab (diff)
parentac764a85a1287b9ca921352aa1fd21c78ffa0312 (diff)
Merge pull request #4706 from rolim/stm32-sai-allow-nodiv-and-master-clock-divider
STM32/SAI: allow again to set nodiv independently of master clock divider
Diffstat (limited to 'embassy-stm32/src')
-rw-r--r--embassy-stm32/src/sai/mod.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/embassy-stm32/src/sai/mod.rs b/embassy-stm32/src/sai/mod.rs
index ce4bc43c3..579c34c13 100644
--- a/embassy-stm32/src/sai/mod.rs
+++ b/embassy-stm32/src/sai/mod.rs
@@ -394,7 +394,8 @@ pub struct Config {
394 pub frame_length: u16, 394 pub frame_length: u16,
395 pub clock_strobe: ClockStrobe, 395 pub clock_strobe: ClockStrobe,
396 pub output_drive: OutputDrive, 396 pub output_drive: OutputDrive,
397 pub master_clock_divider: Option<MasterClockDivider>, 397 pub master_clock_divider: MasterClockDivider,
398 pub nodiv: bool,
398 pub is_high_impedance_on_inactive_slot: bool, 399 pub is_high_impedance_on_inactive_slot: bool,
399 pub fifo_threshold: FifoThreshold, 400 pub fifo_threshold: FifoThreshold,
400 pub companding: Companding, 401 pub companding: Companding,
@@ -423,7 +424,8 @@ impl Default for Config {
423 frame_sync_active_level_length: word::U7(16), 424 frame_sync_active_level_length: word::U7(16),
424 frame_sync_definition: FrameSyncDefinition::ChannelIdentification, 425 frame_sync_definition: FrameSyncDefinition::ChannelIdentification,
425 frame_length: 32, 426 frame_length: 32,
426 master_clock_divider: None, 427 master_clock_divider: MasterClockDivider::DIV1,
428 nodiv: false,
427 clock_strobe: ClockStrobe::Rising, 429 clock_strobe: ClockStrobe::Rising,
428 output_drive: OutputDrive::Immediately, 430 output_drive: OutputDrive::Immediately,
429 is_high_impedance_on_inactive_slot: false, 431 is_high_impedance_on_inactive_slot: false,
@@ -677,8 +679,8 @@ impl<'d, T: Instance, W: word::Word> Sai<'d, T, W> {
677 w.set_syncen(config.sync_input.syncen()); 679 w.set_syncen(config.sync_input.syncen());
678 w.set_mono(config.stereo_mono.mono()); 680 w.set_mono(config.stereo_mono.mono());
679 w.set_outdriv(config.output_drive.outdriv()); 681 w.set_outdriv(config.output_drive.outdriv());
680 w.set_mckdiv(config.master_clock_divider.unwrap_or(MasterClockDivider::DIV1)); 682 w.set_mckdiv(config.master_clock_divider);
681 w.set_nodiv(config.master_clock_divider.is_none()); 683 w.set_nodiv(config.nodiv);
682 w.set_dmaen(true); 684 w.set_dmaen(true);
683 }); 685 });
684 686