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

Stm32 rcc clock #642

Closed
wants to merge 4 commits into from
Closed

Stm32 rcc clock #642

wants to merge 4 commits into from

Conversation

gautierhattenberger
Copy link
Member

reopening #639

flixr and others added 2 commits February 15, 2014 01:23
There is now a convenience function in libopencm3 that makes the clock enable for peripherals easier across different STM families:
e.g.
rcc_periph_clock_enable(RCC_USART1);
@flixr
Copy link
Member

flixr commented Feb 19, 2014

Maybe there is a nice way to automatically create RCC_GPIOx defines based on the gpio that is used instead of having lots of x_RCC defines in the board files?
I quickly tried with a macro but couldn't get it to concatenate the parts with evaluating the respective define exactly once (only managed twice or not at all).
e.g. LED_2_GPIO should be evaluated once to yield GPIOB, but not twice to yield the reg address of GPIOB.

@gautierhattenberger
Copy link
Member Author

I spend some time trying to do it with macros, but it didn't work. Maybe it is acceptable this way until we have a better idea. At least, the configuration is easier than before.

@flixr
Copy link
Member

flixr commented Feb 19, 2014

Yeah, just hoped that you found a macro solution that I missed...
So we just need to test it on some different boards before we merge it...

@flixr
Copy link
Member

flixr commented Feb 21, 2014

If I didn't miss any other typos, it is probably good to merge.
Tested on a Lisa/M 1.0 and Lisa/MX with F415...

@gautierhattenberger did you test this as well?

@gautierhattenberger
Copy link
Member Author

Yep, tested and working on Apogee

@flixr flixr closed this in 5c013a1 Feb 22, 2014
@flixr flixr deleted the stm32_rcc_clock branch February 22, 2014 10:35
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.

None yet

2 participants