STM32L4xx_HAL_Driver  1.14.0

IO operation functions. More...

Functions

void HAL_EXTI_IRQHandler (EXTI_HandleTypeDef *hexti)
 Handle EXTI interrupt request. More...
 
uint32_t HAL_EXTI_GetPending (EXTI_HandleTypeDef *hexti, uint32_t Edge)
 Get interrupt pending bit of a dedicated line. More...
 
void HAL_EXTI_ClearPending (EXTI_HandleTypeDef *hexti, uint32_t Edge)
 Clear interrupt pending bit of a dedicated line. More...
 
void HAL_EXTI_GenerateSWI (EXTI_HandleTypeDef *hexti)
 Generate a software interrupt for a dedicated line. More...
 

Detailed Description

IO operation functions.

EXTI IO functions.

 ===============================================================================
                       ##### IO operation functions #####
 ===============================================================================

Function Documentation

◆ HAL_EXTI_ClearPending()

void HAL_EXTI_ClearPending ( EXTI_HandleTypeDef hexti,
uint32_t  Edge 
)

Clear interrupt pending bit of a dedicated line.

Parameters
hextiExti handle.
EdgeSpecify which pending edge as to be clear. This parameter can be one of the following values:
  • EXTI_TRIGGER_RISING_FALLING This parameter is kept for compatibility with other series.
Return values
None.

Definition at line 579 of file stm32l4xx_hal_exti.c.

580 {
581  __IO uint32_t *regaddr;
582  uint32_t maskline;
583  uint32_t offset;
584 
585  /* Check parameters */
586  assert_param(IS_EXTI_LINE(hexti->Line));
587  assert_param(IS_EXTI_CONFIG_LINE(hexti->Line));
588  assert_param(IS_EXTI_PENDING_EDGE(Edge));
589 
590  /* compute line register offset and line mask */
591  offset = ((hexti->Line & EXTI_REG_MASK) >> EXTI_REG_SHIFT);
592  maskline = (1uL << (hexti->Line & EXTI_PIN_MASK));
593 
594  /* Get pending register address */
595  regaddr = (&EXTI->PR1 + (EXTI_CONFIG_OFFSET * offset));
596 
597  /* Clear Pending bit */
598  *regaddr = maskline;
599 }
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_EXTI_GenerateSWI()

void HAL_EXTI_GenerateSWI ( EXTI_HandleTypeDef hexti)

Generate a software interrupt for a dedicated line.

Parameters
hextiExti handle.
Return values
None.

Definition at line 607 of file stm32l4xx_hal_exti.c.

608 {
609  __IO uint32_t *regaddr;
610  uint32_t maskline;
611  uint32_t offset;
612 
613  /* Check parameters */
614  assert_param(IS_EXTI_LINE(hexti->Line));
615  assert_param(IS_EXTI_CONFIG_LINE(hexti->Line));
616 
617  /* compute line register offset and line mask */
618  offset = ((hexti->Line & EXTI_REG_MASK) >> EXTI_REG_SHIFT);
619  maskline = (1uL << (hexti->Line & EXTI_PIN_MASK));
620 
621  regaddr = (&EXTI->SWIER1 + (EXTI_CONFIG_OFFSET * offset));
622  *regaddr = maskline;
623 }
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_EXTI_GetPending()

uint32_t HAL_EXTI_GetPending ( EXTI_HandleTypeDef hexti,
uint32_t  Edge 
)

Get interrupt pending bit of a dedicated line.

Parameters
hextiExti handle.
EdgeSpecify which pending edge as to be checked. This parameter can be one of the following values:
  • EXTI_TRIGGER_RISING_FALLING This parameter is kept for compatibility with other series.
Return values
1if interrupt is pending else 0.

Definition at line 543 of file stm32l4xx_hal_exti.c.

544 {
545  __IO uint32_t *regaddr;
546  uint32_t regval;
547  uint32_t linepos;
548  uint32_t maskline;
549  uint32_t offset;
550 
551  /* Check parameters */
552  assert_param(IS_EXTI_LINE(hexti->Line));
553  assert_param(IS_EXTI_CONFIG_LINE(hexti->Line));
554  assert_param(IS_EXTI_PENDING_EDGE(Edge));
555 
556  /* Compute line register offset and line mask */
557  offset = ((hexti->Line & EXTI_REG_MASK) >> EXTI_REG_SHIFT);
558  linepos = (hexti->Line & EXTI_PIN_MASK);
559  maskline = (1uL << linepos);
560 
561  /* Get pending bit */
562  regaddr = (&EXTI->PR1 + (EXTI_CONFIG_OFFSET * offset));
563 
564  /* return 1 if bit is set else 0 */
565  regval = ((*regaddr & maskline) >> linepos);
566  return regval;
567 }
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_EXTI_IRQHandler()

void HAL_EXTI_IRQHandler ( EXTI_HandleTypeDef hexti)

Handle EXTI interrupt request.

Parameters
hextiExti handle.
Return values
none.

Definition at line 505 of file stm32l4xx_hal_exti.c.

506 {
507  __IO uint32_t *regaddr;
508  uint32_t regval;
509  uint32_t maskline;
510  uint32_t offset;
511 
512  /* Compute line register offset and line mask */
513  offset = ((hexti->Line & EXTI_REG_MASK) >> EXTI_REG_SHIFT);
514  maskline = (1uL << (hexti->Line & EXTI_PIN_MASK));
515 
516  /* Get pending bit */
517  regaddr = (&EXTI->PR1 + (EXTI_CONFIG_OFFSET * offset));
518  regval = (*regaddr & maskline);
519 
520  if (regval != 0x00u)
521  {
522  /* Clear pending bit */
523  *regaddr = maskline;
524 
525  /* Call callback */
526  if (hexti->PendingCallback != NULL)
527  {
528  hexti->PendingCallback();
529  }
530  }
531 }
void(* PendingCallback)(void)