Skip to content
Permalink
Browse files

drivers: interrupt_controller: Add STM32G0X interrupt support

Add interrupt support for STM32G0X SoC series.

Signed-off-by: Philippe Retornaz <philippe@shapescale.com>
Signed-off-by: Francois Ramu <francois.ramu@st.com>

# Conflicts:
#	drivers/interrupt_controller/exti_stm32.c
  • Loading branch information...
FRASTM authored and MaureenHelm committed Jun 21, 2019
1 parent dd3ee06 commit f9d2a41612800b8bd86622da9672f736f674f653
@@ -16,28 +16,28 @@ config EXTI_STM32
config EXTI_STM32_EXTI1_0_IRQ_PRI
int "EXTI1:0 IRQ priority"
depends on EXTI_STM32
depends on SOC_SERIES_STM32F0X || SOC_SERIES_STM32L0X
depends on SOC_SERIES_STM32F0X || SOC_SERIES_STM32L0X || SOC_SERIES_STM32G0X
default 0
help
IRQ priority of EXTI1:0 interrupt

config EXTI_STM32_EXTI3_2_IRQ_PRI
int "EXTI3:2 IRQ priority"
depends on EXTI_STM32
depends on SOC_SERIES_STM32F0X || SOC_SERIES_STM32L0X
depends on SOC_SERIES_STM32F0X || SOC_SERIES_STM32L0X || SOC_SERIES_STM32G0X
default 0
help
IRQ priority of EXTI3:2 interrupt

config EXTI_STM32_EXTI15_4_IRQ_PRI
int "EXTI15:4 IRQ priority"
depends on EXTI_STM32
depends on SOC_SERIES_STM32F0X || SOC_SERIES_STM32L0X
depends on SOC_SERIES_STM32F0X || SOC_SERIES_STM32L0X || SOC_SERIES_STM32G0X
default 0
help
IRQ priority of EXTI15:4 interrupt

if SOC_SERIES_STM32F0X!=y && SOC_SERIES_STM32L0X!=y
if SOC_SERIES_STM32F0X!=y && SOC_SERIES_STM32L0X!=y && SOC_SERIES_STM32G0X!=y

config EXTI_STM32_EXTI0_IRQ_PRI
int "EXTI0 IRQ priority"
@@ -170,12 +170,12 @@ config EXTI_STM32_EXTI15_10_IRQ_PRI
IRQ priority of EXTI15:10 interrupt
endif # SOC_SERIES_STM32MP1X!=y

endif # SOC_SERIES_STM32F0X!=y && SOC_SERIES_STM32L0X!=y
endif # SOC_SERIES_STM32F0X!=y && SOC_SERIES_STM32L0X!=y && SOC_SERIES_STM32G0X!=y

config EXTI_STM32_PVD_IRQ_PRI
int "RVD Through IRQ priority"
depends on EXTI_STM32
depends on SOC_SERIES_STM32F4X || SOC_SERIES_STM32F7X || SOC_SERIES_STM32F2X
depends on SOC_SERIES_STM32F4X || SOC_SERIES_STM32F7X || SOC_SERIES_STM32F2X || SOC_SERIES_STM32G0X
default 0
help
IRQ priority of RVD Through interrupt
@@ -11,7 +11,7 @@
*
* Driver is currently implemented to support following EXTI lines
* STM32F1/STM32F3: Lines 0 to 15. Lines > 15 not supported
* STM32F0/STM32L0/STM32L4: Lines 0 to 15. Lines > 15 are not mapped on an IRQ
* STM32F0/STM32L0/STM32L4/STM32G0: Lines 0 to 15. Lines > 15 are not mapped on an IRQ
* STM32F2/STM32F4: Lines 0 to 15, 16, 17 18, 21 and 22. Others not supported
* STM32F7: Lines 0 to 15, 16, 17 18, 21, 22 and 23. Others not supported
*
@@ -22,7 +22,8 @@
#include "exti_stm32.h"

#if defined(CONFIG_SOC_SERIES_STM32F0X) || \
defined(CONFIG_SOC_SERIES_STM32L0X)
defined(CONFIG_SOC_SERIES_STM32L0X) || \
defined(CONFIG_SOC_SERIES_STM32G0X)
const IRQn_Type exti_irq_table[] = {
EXTI0_1_IRQn, EXTI0_1_IRQn, EXTI2_3_IRQn, EXTI2_3_IRQn,
EXTI4_15_IRQn, EXTI4_15_IRQn, EXTI4_15_IRQn, EXTI4_15_IRQn,
@@ -132,7 +133,7 @@ void stm32_exti_disable(int line)
static inline int stm32_exti_is_pending(int line)
{
if (line < 32) {
#if defined(CONFIG_SOC_SERIES_STM32MP1X)
#if defined(CONFIG_SOC_SERIES_STM32MP1X) || defined(CONFIG_SOC_SERIES_STM32G0X)
return (LL_EXTI_IsActiveRisingFlag_0_31(1 << line) ||
LL_EXTI_IsActiveFallingFlag_0_31(1 << line));
#else
@@ -152,7 +153,7 @@ static inline int stm32_exti_is_pending(int line)
static inline void stm32_exti_clear_pending(int line)
{
if (line < 32) {
#if defined(CONFIG_SOC_SERIES_STM32MP1X)
#if defined(CONFIG_SOC_SERIES_STM32MP1X) || defined(CONFIG_SOC_SERIES_STM32G0X)
LL_EXTI_ClearRisingFlag_0_31(1 << line);
LL_EXTI_ClearFallingFlag_0_31(1 << line);
#else
@@ -214,7 +215,9 @@ static void __stm32_exti_isr(int min, int max, void *arg)
}
}

#if defined(CONFIG_SOC_SERIES_STM32F0X) || defined(CONFIG_SOC_SERIES_STM32L0X)
#if defined(CONFIG_SOC_SERIES_STM32F0X) || \
defined(CONFIG_SOC_SERIES_STM32L0X) || \
defined(CONFIG_SOC_SERIES_STM32G0X)
static inline void __stm32_exti_isr_0_1(void *arg)
{
__stm32_exti_isr(0, 2, arg);
@@ -409,7 +412,8 @@ static void __stm32_exti_connect_irqs(struct device *dev)
ARG_UNUSED(dev);

#if defined(CONFIG_SOC_SERIES_STM32F0X) || \
defined(CONFIG_SOC_SERIES_STM32L0X)
defined(CONFIG_SOC_SERIES_STM32L0X) || \
defined(CONFIG_SOC_SERIES_STM32G0X)
IRQ_CONNECT(EXTI0_1_IRQn,
CONFIG_EXTI_STM32_EXTI1_0_IRQ_PRI,
__stm32_exti_isr_0_1, DEVICE_GET(exti_stm32),
@@ -36,6 +36,10 @@
#include <stm32g0xx_ll_rcc.h>
#endif /* CONFIG_CLOCK_CONTROL_STM32_CUBE */

#ifdef CONFIG_EXTI_STM32
#include <stm32g0xx_ll_exti.h>
#endif

#ifdef CONFIG_GPIO_STM32
#include <stm32g0xx_ll_gpio.h>
#endif

0 comments on commit f9d2a41

Please sign in to comment.
You can’t perform that action at this time.