Src/stm32f1xx_hal_exti.c
HAL_StatusTypeDef HAL_EXTI_RegisterCallback(EXTI_HandleTypeDef *hexti, EXTI_CallbackIDTypeDef CallbackID, void (*pPendingCbfn)(void))
{
  HAL_StatusTypeDef status = HAL_OK;

  switch (CallbackID)
  {
#ifdef EXTI_IMR1_IM0
    case  HAL_EXTI_COMMON_CB_ID:
      hexti->RisingCallback = pPendingCbfn;
      hexti->FallingCallback = pPendingCbfn;
      break;

    case  HAL_EXTI_RISING_CB_ID:
      hexti->RisingCallback = pPendingCbfn;
      break;

    case  HAL_EXTI_FALLING_CB_ID:
      hexti->FallingCallback = pPendingCbfn;
      break; 
#else
    case  HAL_EXTI_COMMON_CB_ID:
      hexti->Callback = pPendingCbfn;
      break;      
#endif
    default:
      status = HAL_ERROR;
      break;
  }

  return status;
}
/**
  * @brief  Register callback for a dedicaated Exti line.
  * @param  hexti Exti handle.
  * @param  CallbackID User callback identifier.
  *         This parameter can be one of @arg @ref EXTI_CallbackIDTypeDef values.
  * @param  pPendingCbfn function pointer to be stored as callback.
  * @retval HAL Status.
  */
@brief  Register callback for a dedicaated Exti line.
@param  hexti Exti handle.
@param  CallbackID User callback identifier.
This parameter can be one of @arg @ref EXTI_CallbackIDTypeDef values.
@param  pPendingCbfn function pointer to be stored as callback.
@retval HAL Status.
@brief Register callback for a dedicaated Exti line . @param hexti Exti handle . @param CallbackID User callback identifier . This parameter can be one of @arg @ref EXTI_CallbackIDTypeDef values . @param pPendingCbfn function pointer to be stored as callback . @retval HAL Status .
HAL_StatusTypeDef HAL_EXTI_RegisterCallback(EXTI_HandleTypeDef *hexti, EXTI_CallbackIDTypeDef CallbackID, void (*pPendingCbfn)(void))
{
  HAL_StatusTypeDef status = HAL_OK;
  switch (CallbackID)
  {
#ifdef EXTI_IMR1_IM0
    case  HAL_EXTI_COMMON_CB_ID:
      hexti->RisingCallback = pPendingCbfn;
      hexti->FallingCallback = pPendingCbfn;
      break;
    case  HAL_EXTI_RISING_CB_ID:
      hexti->RisingCallback = pPendingCbfn;
      break;
    case  HAL_EXTI_FALLING_CB_ID:
      hexti->FallingCallback = pPendingCbfn;
      break; 
#else
    case  HAL_EXTI_COMMON_CB_ID:
      hexti->Callback = pPendingCbfn;
      break;      
#endif
    default:
      status = HAL_ERROR;
      break;
  }
  return status;
}
HAL_StatusTypeDef HAL_EXTI_RegisterCallback ( EXTI_HandleTypeDef * hexti , EXTI_CallbackIDTypeDef CallbackID , void ( * pPendingCbfn ) ( void ) ) { HAL_StatusTypeDef status = HAL_OK ; switch ( CallbackID ) { #ifdef EXTI_IMR1_IM0 case HAL_EXTI_COMMON_CB_ID : hexti -> RisingCallback = pPendingCbfn ; hexti -> FallingCallback = pPendingCbfn ; break ; case HAL_EXTI_RISING_CB_ID : hexti -> RisingCallback = pPendingCbfn ; break ; case HAL_EXTI_FALLING_CB_ID : hexti -> FallingCallback = pPendingCbfn ; break ; #else case HAL_EXTI_COMMON_CB_ID : hexti -> Callback = pPendingCbfn ; break ; #endif default : status = HAL_ERROR ; break ; } return status ; }
@brief  Register callback for a dedicaated Exti line.
@brief Register callback for a dedicaated Exti line .