Skip to content

PWM Generation with TIM and DMA #846

Answered by burrbull
falOn-Dev asked this question in Q&A
Discussion options

You must be logged in to vote

@falOn-Dev Try https://github.com/stm32-rs/stm32f4xx-hal/tree/pwm-dma branch.
Theoretically with last commit it should be possible to add here

let max_duty = ch1.get_max_duty();
ch1.set_duty(max_duty / 2);
ch1.enable();
something like
let mut transfer = Transfer::init_memory_to_peripheral(
stream,
tx,
buffer,
None,
config::DmaConfig::default()
.memory_increment(true)
.fifo_enable(true)
.fifo_error_interrupt(true)
.transfer_complete_interrupt(true),
);
transfer.start(|_tx| {});

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@falOn-Dev
Comment options

Comment options

You must be logged in to vote
4 replies
@burrbull
Comment options

@falOn-Dev
Comment options

@burrbull
Comment options

@burrbull
Comment options

Answer selected by falOn-Dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants