121 #include "stm32h7xx_hal.h"
131 #ifdef HAL_EXTI_MODULE_ENABLED
138 #define EXTI_MODE_OFFSET 0x04U
139 #define EXTI_CONFIG_OFFSET 0x08U
173 __IO uint32_t *regaddr;
181 if ((hexti ==
NULL) || (pExtiConfig ==
NULL))
196 maskline = (1UL << linepos);
204 regaddr = (
__IO uint32_t *)(&
EXTI->RTSR1 + (EXTI_CONFIG_OFFSET * offset));
221 regaddr = (
__IO uint32_t *)(&
EXTI->FTSR1 + (EXTI_CONFIG_OFFSET * offset));
243 regval =
SYSCFG->EXTICR[(linepos >> 2U) & 0x03UL];
246 SYSCFG->EXTICR[(linepos >> 2U) & 0x03UL] = regval;
251 regaddr = (
__IO uint32_t *)(&
EXTI->IMR1 + (EXTI_MODE_OFFSET * offset));
271 regaddr = (
__IO uint32_t *)(&
EXTI->EMR1 + (EXTI_MODE_OFFSET * offset));
287 #if defined (DUAL_CORE)
289 regaddr = (
__IO uint32_t *)(&
EXTI->C2IMR1 + (EXTI_MODE_OFFSET * offset));
293 if ((pExtiConfig->
Mode & EXTI_MODE_CORE2_INTERRUPT) != 0x00U)
309 regaddr = (
__IO uint32_t *)(&
EXTI->C2EMR1 + (EXTI_MODE_OFFSET * offset));
313 if ((pExtiConfig->
Mode & EXTI_MODE_CORE2_EVENT) != 0x00U)
332 regaddr = (
__IO uint32_t *)(&
EXTI->D3PMR1 + (EXTI_CONFIG_OFFSET * offset));
351 regaddr = (
__IO uint32_t *)(&
EXTI->D3PCR1L + (EXTI_CONFIG_OFFSET * offset));
352 pcrlinepos = 1UL << linepos;
356 regaddr = (
__IO uint32_t *)(&
EXTI->D3PCR1H + (EXTI_CONFIG_OFFSET * offset));
357 pcrlinepos = 1UL << (linepos - 16UL);
360 regval = (*regaddr & (~(pcrlinepos * pcrlinepos * 3UL))) | (pcrlinepos * pcrlinepos * (pExtiConfig->
PendClearSource - 1UL));
377 __IO uint32_t *regaddr;
385 if ((hexti ==
NULL) || (pExtiConfig ==
NULL))
399 maskline = (1UL << linepos);
402 regaddr = (
__IO uint32_t *)(&
EXTI->IMR1 + (EXTI_MODE_OFFSET * offset));
408 if ((regval & maskline) != 0x00U)
414 regaddr = (
__IO uint32_t *)(&
EXTI->EMR1 + (EXTI_MODE_OFFSET * offset));
418 if ((regval & maskline) != 0x00U)
422 #if defined (DUAL_CORE)
423 regaddr = (
__IO uint32_t *)(&
EXTI->C2IMR1 + (EXTI_MODE_OFFSET * offset));
427 if ((regval & maskline) != 0x00U)
429 pExtiConfig->
Mode = EXTI_MODE_CORE2_INTERRUPT;
433 regaddr = (
__IO uint32_t *)(&
EXTI->C2EMR1 + (EXTI_MODE_OFFSET * offset));
437 if ((regval & maskline) != 0x00U)
439 pExtiConfig->
Mode |= EXTI_MODE_CORE2_EVENT;
446 regaddr = (
__IO uint32_t *)(&
EXTI->RTSR1 + (EXTI_CONFIG_OFFSET * offset));
450 if ((regval & maskline) != 0x00U)
460 regaddr = (
__IO uint32_t *)(&
EXTI->FTSR1 + (EXTI_CONFIG_OFFSET * offset));
464 if ((regval & maskline) != 0x00U)
474 regval =
SYSCFG->EXTICR[(linepos >> 2U) & 0x03UL];
491 regaddr = (
__IO uint32_t *)(&
EXTI->D3PMR1 + (EXTI_CONFIG_OFFSET * offset));
492 if(((*regaddr) & linepos) == 0UL)
502 regaddr = (
__IO uint32_t *)(&
EXTI->D3PCR1L + (EXTI_CONFIG_OFFSET * offset));
503 pcrlinepos = 1UL << linepos;
507 regaddr = (
__IO uint32_t *)(&
EXTI->D3PCR1H + (EXTI_CONFIG_OFFSET * offset));
508 pcrlinepos = 1UL << (linepos - 16UL);
511 pExtiConfig->
PendClearSource = 1UL + ((*regaddr & (pcrlinepos * pcrlinepos * 3UL)) / (pcrlinepos * pcrlinepos));
531 __IO uint32_t *regaddr;
550 maskline = (1UL << linepos);
553 regaddr = (
__IO uint32_t *)(&
EXTI->IMR1 + (EXTI_MODE_OFFSET * offset));
554 regval = (*regaddr & ~maskline);
558 regaddr = (
__IO uint32_t *)(&
EXTI->EMR1 + (EXTI_MODE_OFFSET * offset));
559 regval = (*regaddr & ~maskline);
562 #if defined (DUAL_CORE)
564 regaddr = (
__IO uint32_t *)(&
EXTI->C2IMR1 + (EXTI_MODE_OFFSET * offset));
565 regval = (*regaddr & ~maskline);
569 regaddr = (
__IO uint32_t *)(&
EXTI->C2EMR1 + (EXTI_MODE_OFFSET * offset));
570 regval = (*regaddr & ~maskline);
577 regaddr = (
__IO uint32_t *)(&
EXTI->RTSR1 + (EXTI_CONFIG_OFFSET * offset));
578 regval = (*regaddr & ~maskline);
581 regaddr = (
__IO uint32_t *)(&
EXTI->FTSR1 + (EXTI_CONFIG_OFFSET * offset));
582 regval = (*regaddr & ~maskline);
590 regval =
SYSCFG->EXTICR[(linepos >> 2U) & 0x03UL];
592 SYSCFG->EXTICR[(linepos >> 2U) & 0x03UL] = regval;
599 regaddr = (
__IO uint32_t *)(&
EXTI->D3PMR1 + (EXTI_CONFIG_OFFSET * offset));
600 *regaddr = (*regaddr & ~maskline);
604 regaddr = (
__IO uint32_t *)(&
EXTI->D3PCR1L + (EXTI_CONFIG_OFFSET * offset));
605 pcrlinepos = 1UL << linepos;
609 regaddr = (
__IO uint32_t *)(&
EXTI->D3PCR1H + (EXTI_CONFIG_OFFSET * offset));
610 pcrlinepos = 1UL << (linepos - 16UL);
614 *regaddr &= (~(pcrlinepos * pcrlinepos * 3UL));
674 hexti->
Line = ExtiLine;
704 __IO uint32_t *regaddr;
713 #if defined(DUAL_CORE)
717 regaddr = (
__IO uint32_t *)(&
EXTI->PR1 + (EXTI_MODE_OFFSET * offset));
722 regaddr = (
__IO uint32_t *)(&
EXTI->C2PR1 + (EXTI_MODE_OFFSET * offset));
725 regaddr = (
__IO uint32_t *)(&
EXTI->PR1 + (EXTI_MODE_OFFSET * offset));
729 regval = (*regaddr & maskline);
756 __IO uint32_t *regaddr;
770 maskline = (1UL << linepos);
772 #if defined(DUAL_CORE)
776 regaddr = (
__IO uint32_t *)(&
EXTI->PR1 + (EXTI_MODE_OFFSET * offset));
781 regaddr = (
__IO uint32_t *)(&
EXTI->C2PR1 + (EXTI_MODE_OFFSET * offset));
784 regaddr = (
__IO uint32_t *)(&
EXTI->PR1 + (EXTI_MODE_OFFSET * offset));
788 regval = ((*regaddr & maskline) >> linepos);
804 __IO uint32_t *regaddr;
817 #if defined(DUAL_CORE)
821 regaddr = (
__IO uint32_t *)(&
EXTI->PR1 + (EXTI_MODE_OFFSET * offset));
826 regaddr = (
__IO uint32_t *)(&
EXTI->C2PR1 + (EXTI_MODE_OFFSET * offset));
829 regaddr = (
__IO uint32_t *)(&
EXTI->PR1 + (EXTI_MODE_OFFSET * offset));
843 __IO uint32_t *regaddr;
855 regaddr = (
__IO uint32_t *)(&
EXTI->SWIER1 + (EXTI_CONFIG_OFFSET * offset));