Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32F0/F3 Remap DMA channels #3653

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

fwolter
Copy link
Contributor

@fwolter fwolter commented Dec 15, 2024

Fixes #3643

I'm not sure if this is the most elegant way to retrieve the byte and bit offset of SYSCFG.CFGR1 and do the pointer arithmetic. I'm happy to receive feedback!

Tested on STM32F072CB with I2C1.

Depends on embassy-rs/stm32-data#548

@fwolter
Copy link
Contributor Author

fwolter commented Jan 1, 2025

I fixed the merge conflict. Please let me know if there's anything left to accept this PR. I'm happy to implement feedback!

The CI fails because it depends on a change in stm32-data.

if remap {
quote! { (#cfgr1 as *mut u32).write((#cfgr1 as *mut u32).read() | 1 << #bit_offset) }
} else {
quote! { (#cfgr1 as *mut u32).write((#cfgr1 as *mut u32).read() & !(1 << #bit_offset)) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you make this use the PAC to do the register writes, like all the other build.rs-generated code? pac::SYSCFG.cfgr1().modify(|w| w.set_whatever(val))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

STM32F0/F3 DMA not usable on specific channels which need remapping
2 participants