cpu/stm32: Implement periph/gpio_ll{,_irq} except for STM32F1#17981
Merged
Conversation
Co-authored-by: Gunar Schorcht <gunar@schorcht.net> Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
Contributor
|
Hi. I tested this PR using Nucleo-L552ze-q. Test output: |
Member
|
Tested the nucleo-g474re: |
benpicco
approved these changes
May 23, 2022
benpicco
left a comment
Contributor
There was a problem hiding this comment.
I wonder if we could make porting a bit easier though while we're at it
| # ifdef PWR_CR2_IOSV | ||
| # define PORTG_REQUIRES_EXTERNAL_POWER | ||
| # endif | ||
| #elif defined(CPU_FAM_STM32MP1) |
Contributor
There was a problem hiding this comment.
Suggested change
| #elif defined(CPU_FAM_STM32MP1) | |
| #elif defined(RCC_MC_AHB4ENSETR_GPIOAEN) |
| defined(CPU_FAM_STM32G4) || defined(CPU_FAM_STM32L5) || \ | ||
| defined(CPU_FAM_STM32U5) || defined(CPU_FAM_STM32WL) | ||
| #define GPIO_BUS AHB2 | ||
| # if defined(CPU_FAM_STM32U5) |
Contributor
There was a problem hiding this comment.
Suggested change
| # if defined(CPU_FAM_STM32U5) | |
| # if defined(RCC_AHB2ENR1_GPIOAEN) |
| #if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F3) || defined(CPU_FAM_STM32L1) | ||
| # define GPIO_BUS AHB | ||
| # define GPIOAEN RCC_AHBENR_GPIOAEN | ||
| #elif defined(CPU_FAM_STM32L0) || defined(CPU_FAM_STM32G0) |
Contributor
There was a problem hiding this comment.
Suggested change
| #elif defined(CPU_FAM_STM32L0) || defined(CPU_FAM_STM32G0) | |
| #elif defined(RCC_IOPENR_GPIOAEN) |
| #include "bitarithm.h" | ||
| #include "periph/gpio_ll.h" | ||
|
|
||
| #if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F3) || defined(CPU_FAM_STM32L1) |
Contributor
There was a problem hiding this comment.
Suggested change
| #if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F3) || defined(CPU_FAM_STM32L1) | |
| #if defined(RCC_AHBENR_GPIOAEN) |
| /* enable clock of the SYSCFG module for EXTI configuration */ | ||
| #if !defined(CPU_FAM_STM32WB) && !defined(CPU_FAM_STM32MP1) && \ | ||
| !defined(CPU_FAM_STM32WL) | ||
| #ifdef CPU_FAM_STM32F0 |
Contributor
There was a problem hiding this comment.
Suggested change
| #ifdef CPU_FAM_STM32F0 | |
| #if defined(RCC_APB2ENR_SYSCFGCOMPEN) |
| !defined(CPU_FAM_STM32WL) | ||
| #ifdef CPU_FAM_STM32F0 | ||
| periph_clk_en(APB2, RCC_APB2ENR_SYSCFGCOMPEN); | ||
| #elif defined(CPU_FAM_STM32G0) |
Contributor
There was a problem hiding this comment.
Suggested change
| #elif defined(CPU_FAM_STM32G0) | |
| #elif defined(RCC_APBENR2_SYSCFGEN) |
| periph_clk_en(APB2, RCC_APB2ENR_SYSCFGCOMPEN); | ||
| #elif defined(CPU_FAM_STM32G0) | ||
| periph_clk_en(APB12, RCC_APBENR2_SYSCFGEN); | ||
| #elif defined(CPU_FAM_STM32U5) |
Contributor
There was a problem hiding this comment.
Suggested change
| #elif defined(CPU_FAM_STM32U5) | |
| #elif defined(RCC_APB3ENR_SYSCFGEN) |
Member
Author
|
Thanks :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
Implements
gpio_llandgpio_ll_irqfor STM32* except for STM32F1.Testing procedure
Testing State
STM32F1 (Cannot test, no implementation yet)Issues/PRs references
Depends on and includes: #16787