-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/stm32: Implement periph/gpio_ll{,_irq} except for STM32F1 #17981
Conversation
Co-authored-by: Gunar Schorcht <gunar@schorcht.net> Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
Hi. I tested this PR using Nucleo-L552ze-q. Test output:
|
Tested the nucleo-g474re:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#elif defined(CPU_FAM_STM32U5) | |
#elif defined(RCC_APB3ENR_SYSCFGEN) |
Thanks :) |
Contribution description
Implements
gpio_ll
andgpio_ll_irq
for STM32* except for STM32F1.Testing procedure
Testing State
STM32F1 (Cannot test, no implementation yet)Issues/PRs references
Depends on and includes: #16787